# HG changeset patch # User bsw # Date 1345427607 -7200 # Node ID 59f02db195315c4f6a611a62fff0372a0471fbee # Parent 773e0750709e60f4bd4f5be4b5a945da891fe144 Cleanup of issue.state attribute diff -r 773e0750709e -r 59f02db19531 app/main/issue/_show.lua --- a/app/main/issue/_show.lua Mon Aug 20 03:52:50 2012 +0200 +++ b/app/main/issue/_show.lua Mon Aug 20 03:53:27 2012 +0200 @@ -75,11 +75,11 @@ elseif issue.state_time_left then slot.put(" · ") if issue.state_time_left:sub(1,1) == "-" then - if issue.state == "accepted" then + if issue.state == "admission" then ui.tag{ content = _("Discussion starts soon") } elseif issue.state == "discussion" then ui.tag{ content = _("Verification starts soon") } - elseif issue.state == "frozen" then + elseif issue.state == "verification" then ui.tag{ content = _("Voting starts soon") } elseif issue.state == "voting" then ui.tag{ content = _("Counting starts soon") } @@ -250,7 +250,7 @@ end } if not for_listing then - if issue.state == "cancelled" then + if issue.state:sub(1, #("canceled_")) == "canceled_" then local policy = issue.policy ui.container{ attr = { class = "not_admitted_info" }, diff -r 773e0750709e -r 59f02db19531 model/issue.lua --- a/model/issue.lua Mon Aug 20 03:52:50 2012 +0200 +++ b/model/issue.lua Mon Aug 20 03:53:27 2012 +0200 @@ -183,9 +183,9 @@ function Issue:get_state_name_for_state(value) local state_name_table = { - new = _"New", - accepted = _"Discussion", - frozen = _"Frozen", + admission = _"New", + discussion = _"Discussion", + verification = _"Frozen", voting = _"Voting", finished = _"Finished", cancelled = _"Cancelled" @@ -239,44 +239,11 @@ end end -function Issue.object_get:state() - if self.closed then - if self.fully_frozen then - return "finished" - else - return "cancelled" - end - elseif self.fully_frozen then - return "voting" - elseif self.half_frozen then - return "frozen" - elseif self.accepted then - return "accepted" - else - return "new" - end - -end function Issue.object_get:state_name() return Issue:get_state_name_for_state(self.state) end -function Issue.object_get:next_states() - local state = self.state - local next_states - if state == "new" then - next_states = { "accepted", "cancelled" } - elseif state == "accepted" then - next_states = { "frozen" } - elseif state == "frozen" then - next_states = { "voting" } - elseif state == "voting" then - next_states = { "finished" } - end - return next_states -end - function Issue.object_get:next_states_names() local next_states = self.next_states if not next_states then