liquid_feedback_frontend
changeset 25:4b2af207cefa
Use timings of issue instead of policy
author | bsw |
---|---|
date | Sun Feb 21 14:23:56 2010 +0100 (2010-02-21) |
parents | 81586ea68d57 |
children | 3036f2732b83 |
files | app/main/issue/_details.lua model/issue.lua |
line diff
1.1 --- a/app/main/issue/_details.lua Sun Feb 21 14:09:11 2010 +0100 1.2 +++ b/app/main/issue/_details.lua Sun Feb 21 14:23:56 2010 +0100 1.3 @@ -6,27 +6,27 @@ 1.4 readonly = true, 1.5 attr = { class = "vertical" }, 1.6 content = function() 1.7 - ui.field.text{ label = _"Population", name = "population" } 1.8 - ui.field.text{ label = _"State", name = "state" } 1.9 - ui.field.timestamp{ label = _"Created at", name = "created" } 1.10 - ui.field.text{ label = _"Admission time", value = policy.admission_time } 1.11 + ui.field.text{ label = _"Population", name = "population" } 1.12 + ui.field.text{ label = _"State", name = "state" } 1.13 + ui.field.timestamp{ label = _"Created at", name = "created" } 1.14 + ui.field.text{ label = _"Admission time", value = issue.admission_time } 1.15 ui.field.text{ 1.16 label = _"Issue quorum", 1.17 value = format.percentage(policy.issue_quorum_num / policy.issue_quorum_den) 1.18 } 1.19 - ui.field.timestamp{ label = _"Accepted at", name = "accepted" } 1.20 - ui.field.text{ label = _"Discussion time", value = policy.discussion_time } 1.21 - ui.field.vote_now{ label = _"Vote now", name = "vote_now" } 1.22 - ui.field.vote_later{ label = _"Vote later", name = "vote_later" } 1.23 - ui.field.timestamp{ label = _"Half frozen at", name = "half_frozen" } 1.24 - ui.field.text{ label = _"Verification time", value = policy.verification_time } 1.25 + ui.field.timestamp{ label = _"Accepted at", name = "accepted" } 1.26 + ui.field.text{ label = _"Discussion time", value = issue.discussion_time } 1.27 + ui.field.vote_now{ label = _"Vote now", name = "vote_now" } 1.28 + ui.field.vote_later{ label = _"Vote later", name = "vote_later" } 1.29 + ui.field.timestamp{ label = _"Half frozen at", name = "half_frozen" } 1.30 + ui.field.text{ label = _"Verification time", value = issue.verification_time } 1.31 ui.field.text{ 1.32 label = _"Initiative quorum", 1.33 value = format.percentage(policy.initiative_quorum_num / policy.initiative_quorum_den) 1.34 } 1.35 - ui.field.timestamp{ label = _"Fully frozen at", name = "fully_frozen" } 1.36 - ui.field.text{ label = _"Voting time", value = policy.voting_time } 1.37 - ui.field.timestamp{ label = _"Closed", name = "closed" } 1.38 + ui.field.timestamp{ label = _"Fully frozen at", name = "fully_frozen" } 1.39 + ui.field.text{ label = _"Voting time", value = issue.voting_time } 1.40 + ui.field.timestamp{ label = _"Closed", name = "closed" } 1.41 end 1.42 } 1.43 ui.form{
2.1 --- a/model/issue.lua Sun Feb 21 14:09:11 2010 +0100 2.2 +++ b/model/issue.lua Sun Feb 21 14:23:56 2010 +0100 2.3 @@ -176,16 +176,16 @@ 2.4 local duration 2.5 if state == "new" then 2.6 last_event_time = self.created 2.7 - duration = self.policy.admission_time 2.8 + duration = self.admission_time 2.9 elseif state == "accepted" then 2.10 last_event_time = self.accepted 2.11 - duration = self.policy.discussion_time 2.12 + duration = self.discussion_time 2.13 elseif state == "frozen" then 2.14 last_event_time = self.half_frozen 2.15 - duration = self.policy.verification_time 2.16 + duration = self.verification_time 2.17 elseif state == "voting" then 2.18 last_event_time = self.fully_frozen 2.19 - duration = self.policy.voting_time 2.20 + duration = self.voting_time 2.21 end 2.22 return db:query{ "SELECT ?::timestamp + ?::interval - now() as time_left", last_event_time, duration }[1].time_left 2.23 end