liquid_feedback_frontend

changeset 896:59f02db19531

Cleanup of issue.state attribute
author bsw
date Mon Aug 20 03:53:27 2012 +0200 (2012-08-20)
parents 773e0750709e
children 54e32e34be01
files app/main/issue/_show.lua model/issue.lua
line diff
     1.1 --- a/app/main/issue/_show.lua	Mon Aug 20 03:52:50 2012 +0200
     1.2 +++ b/app/main/issue/_show.lua	Mon Aug 20 03:53:27 2012 +0200
     1.3 @@ -75,11 +75,11 @@
     1.4        elseif issue.state_time_left then
     1.5          slot.put(" · ")
     1.6          if issue.state_time_left:sub(1,1) == "-" then
     1.7 -          if issue.state == "accepted" then
     1.8 +          if issue.state == "admission" then
     1.9              ui.tag{ content = _("Discussion starts soon") }
    1.10            elseif issue.state == "discussion" then
    1.11              ui.tag{ content = _("Verification starts soon") }
    1.12 -          elseif issue.state == "frozen" then
    1.13 +          elseif issue.state == "verification" then
    1.14              ui.tag{ content = _("Voting starts soon") }
    1.15            elseif issue.state == "voting" then
    1.16              ui.tag{ content = _("Counting starts soon") }
    1.17 @@ -250,7 +250,7 @@
    1.18    end }
    1.19  
    1.20    if not for_listing then
    1.21 -    if issue.state == "cancelled" then
    1.22 +    if issue.state:sub(1, #("canceled_")) == "canceled_" then
    1.23        local policy = issue.policy
    1.24        ui.container{
    1.25          attr = { class = "not_admitted_info" },
     2.1 --- a/model/issue.lua	Mon Aug 20 03:52:50 2012 +0200
     2.2 +++ b/model/issue.lua	Mon Aug 20 03:53:27 2012 +0200
     2.3 @@ -183,9 +183,9 @@
     2.4  
     2.5  function Issue:get_state_name_for_state(value)
     2.6    local state_name_table = {
     2.7 -    new          = _"New",
     2.8 -    accepted     = _"Discussion",
     2.9 -    frozen       = _"Frozen",
    2.10 +    admission    = _"New",
    2.11 +    discussion   = _"Discussion",
    2.12 +    verification = _"Frozen",
    2.13      voting       = _"Voting",
    2.14      finished     = _"Finished",
    2.15      cancelled    = _"Cancelled"
    2.16 @@ -239,44 +239,11 @@
    2.17    end
    2.18  end
    2.19  
    2.20 -function Issue.object_get:state()
    2.21 -  if self.closed then
    2.22 -    if self.fully_frozen then
    2.23 -      return "finished"
    2.24 -    else
    2.25 -      return "cancelled"
    2.26 -    end
    2.27 -  elseif self.fully_frozen then
    2.28 -    return "voting"
    2.29 -  elseif self.half_frozen then
    2.30 -    return "frozen"
    2.31 -  elseif self.accepted then
    2.32 -    return "accepted"
    2.33 -  else
    2.34 -    return "new"
    2.35 -  end
    2.36 -
    2.37 -end
    2.38  
    2.39  function Issue.object_get:state_name()
    2.40    return Issue:get_state_name_for_state(self.state)
    2.41  end
    2.42  
    2.43 -function Issue.object_get:next_states()
    2.44 -  local state = self.state
    2.45 -  local next_states
    2.46 -  if state == "new" then
    2.47 -    next_states = { "accepted", "cancelled" }
    2.48 -  elseif state == "accepted" then
    2.49 -    next_states = { "frozen" }
    2.50 -  elseif state == "frozen" then
    2.51 -    next_states = { "voting" }
    2.52 -  elseif state == "voting" then
    2.53 -    next_states = { "finished" }
    2.54 -  end
    2.55 -  return next_states
    2.56 -end
    2.57 -
    2.58  function Issue.object_get:next_states_names()
    2.59    local next_states = self.next_states
    2.60    if not next_states then

Impressum / About Us