bsw@1045: local issue = Issue:by_id ( param.get_id () ) bsw@1045: bsw@1045: if not issue then bsw@1045: execute.view { module = "index", view = "404" } bsw@1045: request.set_status("404 Not Found") bsw@1045: return bsw@1045: end bsw@1045: bsw@1045: local initiatives = issue.initiatives bsw@1045: bsw@548: if app.session.member_id then bsw@1045: issue:load_everything_for_member_id ( app.session.member_id ) bsw@1045: initiatives:load_everything_for_member_id ( app.session.member_id ) bsw@548: end bsw/jbe@0: jorges@106: if not app.html_title.title then bsw@1045: app.html_title.title = _("Issue ##{id}", { id = issue.id }) jorges@106: end jorges@103: bsw@1045: execute.view { bsw@1045: module = "issue", view = "_head", bsw@1045: params = { issue = issue, member = app.session.member } bsw@1045: } bsw@2: bsw@1045: execute.view{ module = "issue", view = "_sidebar_state", params = { bsw@1045: issue = issue bsw@1045: } } bsw/jbe@0: bsw@1045: execute.view { bsw@1045: module = "issue", view = "_sidebar_whatcanido", params = { bsw@1045: issue = issue bsw@1045: } bsw@1045: } bsw@719: bsw@1045: execute.view { bsw@1045: module = "issue", view = "_sidebar_members", params = { bsw@1045: issue = issue bsw@1045: } bsw@1045: } bsw@1045: bsw@1045: ui.section( function () bsw@1045: bsw@1045: execute.view{ bsw@1045: module = "issue", view = "_head2", params = { bsw@1045: issue = issue bsw@719: } bsw@719: } bsw@719: bsw@1045: if issue.initiatives[1].rank == 1 then bsw@1045: execute.view{ module = "initiative", view = "_sidebar_state", params = { bsw@1045: initiative = issue.initiatives[1] bsw@1045: } } bsw@1045: end bsw@719: bsw@1045: ui.sectionRow( function () bsw@1045: execute.view { bsw@1045: module = "initiative", view = "_list", bsw@1045: params = { bsw@1045: issue = issue, bsw@1045: initiatives = initiatives bsw@1045: } bsw@1045: } bsw@1045: end ) bsw@1045: bsw@1045: end ) bsw/jbe@19: bsw@1045: ui.section(function() bsw@1045: ui.sectionHead( function() bsw@1045: ui.heading { level = 1, content = _"Details" } bsw@1045: end ) bsw@1045: local policy = issue.policy bsw@1045: ui.form{ bsw@1045: record = issue, bsw@1045: readonly = true, bsw@1045: attr = { class = "sectionRow form" }, bsw@1045: content = function() bsw@1045: if issue.snapshot then bsw@1045: ui.field.timestamp{ label = _"Last counting:", value = issue.snapshot } bsw@1045: end bsw@1045: ui.field.text{ label = _"Population", name = "population" } bsw@1045: ui.field.timestamp{ label = _"Created at", name = "created" } bsw@1045: if policy.polling then bsw@1045: ui.field.text{ label = _"Admission time", value = _"Implicitly admitted" } bsw@1045: else bsw@1234: ui.field.text{ label = _"Minimum admission time", value = format.interval_text(issue.min_admission_time_text) } bsw@1234: ui.field.text{ label = _"Maximum admission time", value = format.interval_text(issue.max_admission_time_text) } bsw@1045: ui.field.text{ bsw@1045: label = _"Issue quorum", bsw@1045: value = format.percentage(policy.issue_quorum_num / policy.issue_quorum_den) bsw@1045: } bsw@1045: if issue.population then bsw@1045: ui.field.text{ bsw@1045: label = _"Currently required", bsw@1045: value = math.ceil(issue.population * policy.issue_quorum_num / policy.issue_quorum_den) bsw@1045: } bsw@1045: end bsw@1045: end bsw@1045: if issue.accepted then bsw@1045: ui.field.timestamp{ label = _"Accepted at", name = "accepted" } bsw@1045: end bsw@1045: ui.field.text{ label = _"Discussion time", value = format.interval_text(issue.discussion_time_text) } bsw@1045: if issue.half_frozen then bsw@1045: ui.field.timestamp{ label = _"Half frozen at", name = "half_frozen" } bsw@1045: end bsw@1045: ui.field.text{ label = _"Verification time", value = format.interval_text(issue.verification_time_text) } bsw@1045: ui.field.text{ bsw@1045: label = _"Initiative quorum", bsw@1045: value = format.percentage(policy.initiative_quorum_num / policy.initiative_quorum_den) bsw@1045: } bsw@1045: if issue.population then bsw@1045: ui.field.text{ bsw@1045: label = _"Currently required", bsw@1045: value = math.ceil(issue.population * (issue.policy.initiative_quorum_num / issue.policy.initiative_quorum_den)), bsw@1045: } bsw@1045: end bsw@1045: if issue.fully_frozen then bsw@1045: ui.field.timestamp{ label = _"Fully frozen at", name = "fully_frozen" } bsw@1045: end bsw@1045: ui.field.text{ label = _"Voting time", value = format.interval_text(issue.voting_time_text) } bsw@1045: if issue.closed then bsw@1045: ui.field.timestamp{ label = _"Closed", name = "closed" } bsw@1045: end bsw@1045: end bsw@1045: } bsw/jbe@19: bsw@1045: end ) bsw@1045: