# HG changeset patch # User bsw # Date 1266758636 -3600 # Node ID 4b2af207cefafb0c0f0f1d5f0d16b2d880435533 # Parent 81586ea68d57d5d06fd590a84a88e6bf371d5eaf Use timings of issue instead of policy diff -r 81586ea68d57 -r 4b2af207cefa app/main/issue/_details.lua --- a/app/main/issue/_details.lua Sun Feb 21 14:09:11 2010 +0100 +++ b/app/main/issue/_details.lua Sun Feb 21 14:23:56 2010 +0100 @@ -6,27 +6,27 @@ readonly = true, attr = { class = "vertical" }, content = function() - ui.field.text{ label = _"Population", name = "population" } - ui.field.text{ label = _"State", name = "state" } - ui.field.timestamp{ label = _"Created at", name = "created" } - ui.field.text{ label = _"Admission time", value = policy.admission_time } + ui.field.text{ label = _"Population", name = "population" } + ui.field.text{ label = _"State", name = "state" } + ui.field.timestamp{ label = _"Created at", name = "created" } + ui.field.text{ label = _"Admission time", value = issue.admission_time } ui.field.text{ label = _"Issue quorum", value = format.percentage(policy.issue_quorum_num / policy.issue_quorum_den) } - ui.field.timestamp{ label = _"Accepted at", name = "accepted" } - ui.field.text{ label = _"Discussion time", value = policy.discussion_time } - ui.field.vote_now{ label = _"Vote now", name = "vote_now" } - ui.field.vote_later{ label = _"Vote later", name = "vote_later" } - ui.field.timestamp{ label = _"Half frozen at", name = "half_frozen" } - ui.field.text{ label = _"Verification time", value = policy.verification_time } + ui.field.timestamp{ label = _"Accepted at", name = "accepted" } + ui.field.text{ label = _"Discussion time", value = issue.discussion_time } + ui.field.vote_now{ label = _"Vote now", name = "vote_now" } + ui.field.vote_later{ label = _"Vote later", name = "vote_later" } + ui.field.timestamp{ label = _"Half frozen at", name = "half_frozen" } + ui.field.text{ label = _"Verification time", value = issue.verification_time } ui.field.text{ label = _"Initiative quorum", value = format.percentage(policy.initiative_quorum_num / policy.initiative_quorum_den) } - ui.field.timestamp{ label = _"Fully frozen at", name = "fully_frozen" } - ui.field.text{ label = _"Voting time", value = policy.voting_time } - ui.field.timestamp{ label = _"Closed", name = "closed" } + ui.field.timestamp{ label = _"Fully frozen at", name = "fully_frozen" } + ui.field.text{ label = _"Voting time", value = issue.voting_time } + ui.field.timestamp{ label = _"Closed", name = "closed" } end } ui.form{ diff -r 81586ea68d57 -r 4b2af207cefa model/issue.lua --- a/model/issue.lua Sun Feb 21 14:09:11 2010 +0100 +++ b/model/issue.lua Sun Feb 21 14:23:56 2010 +0100 @@ -176,16 +176,16 @@ local duration if state == "new" then last_event_time = self.created - duration = self.policy.admission_time + duration = self.admission_time elseif state == "accepted" then last_event_time = self.accepted - duration = self.policy.discussion_time + duration = self.discussion_time elseif state == "frozen" then last_event_time = self.half_frozen - duration = self.policy.verification_time + duration = self.verification_time elseif state == "voting" then last_event_time = self.fully_frozen - duration = self.policy.voting_time + duration = self.voting_time end return db:query{ "SELECT ?::timestamp + ?::interval - now() as time_left", last_event_time, duration }[1].time_left end