| rev | line source | 
| bsw@1045 | 1 local issue = Issue:by_id ( param.get_id () ) | 
| bsw@1045 | 2 | 
| bsw@1045 | 3 if not issue then | 
| bsw/jbe@1309 | 4   return execute.view { module = "index", view = "404" } | 
| bsw@1045 | 5 end | 
| bsw@1045 | 6 | 
| bsw/jbe@1309 | 7 app.current_issue = issue | 
| bsw/jbe@1309 | 8 | 
| bsw/jbe@1309 | 9 issue.area:load_delegation_info_once_for_member_id(app.session.member_id) | 
| bsw/jbe@1309 | 10 | 
| bsw/jbe@1309 | 11 execute.view{ module = "issue", view = "_head", params = { issue = issue } } | 
| bsw/jbe@1309 | 12 | 
| bsw@1045 | 13 local initiatives = issue.initiatives | 
| bsw@1045 | 14 | 
| bsw@548 | 15 if app.session.member_id then | 
| bsw@1045 | 16   issue:load_everything_for_member_id ( app.session.member_id ) | 
| bsw@1045 | 17   initiatives:load_everything_for_member_id ( app.session.member_id ) | 
| bsw@548 | 18 end | 
| bsw/jbe@0 | 19 | 
| jorges@106 | 20 if not app.html_title.title then | 
| bsw@1045 | 21   app.html_title.title = _("Issue ##{id}", { id = issue.id }) | 
| jorges@106 | 22 end | 
| jorges@103 | 23 | 
| bsw/jbe@1309 | 24 ui.grid{ content = function() | 
| bsw/jbe@1309 | 25 | 
| bsw/jbe@1309 | 26   ui.cell_main{ content = function() | 
| bsw/jbe@0 | 27 | 
| bsw/jbe@1309 | 28     ui.container { attr = { class = "mdl-card mdl-shadow--2dp mdl-card__fullwidth" }, content = function() | 
| bsw/jbe@1309 | 29       ui.container{ attr = { class = "mdl-card__title mdl-card--border" }, content = function() | 
| bsw/jbe@1309 | 30         ui.heading { attr = { class = "mdl-card__title-text" }, level = 2, content = _"Competing initiatives" } | 
| bsw/jbe@1309 | 31       end } | 
| bsw/jbe@1309 | 32       execute.view { | 
| bsw/jbe@1309 | 33         module = "initiative", view = "_list", | 
| bsw/jbe@1309 | 34         params = { | 
| bsw/jbe@1309 | 35           issue = issue, | 
| bsw/jbe@1309 | 36           initiatives = initiatives | 
| bsw/jbe@1309 | 37         } | 
| bsw/jbe@1309 | 38       } | 
| bsw/jbe@1309 | 39     end } | 
| bsw@719 | 40 | 
| bsw/jbe@1309 | 41     ui.container { attr = { class = "mdl-card mdl-shadow--2dp mdl-card__fullwidth" }, content = function() | 
| bsw/jbe@1309 | 42 | 
| bsw/jbe@1309 | 43       ui.container{ attr = { class = "mdl-card__title mdl-card--border" }, content = function() | 
| bsw/jbe@1309 | 44         ui.heading { attr = { class = "mdl-card__title-text" }, level = 2, content = _"Details" } | 
| bsw/jbe@1309 | 45       end } | 
| bsw@1045 | 46 | 
| bsw/jbe@1309 | 47       ui.container{ attr = { class = "mdl-card__content" }, content = function() | 
| bsw/jbe@1309 | 48         local policy = issue.policy | 
| bsw/jbe@1309 | 49         ui.form{ | 
| bsw/jbe@1309 | 50           record = issue, | 
| bsw/jbe@1309 | 51           readonly = true, | 
| bsw/jbe@1309 | 52           attr = { class = "sectionRow form" }, | 
| bsw/jbe@1309 | 53           content = function() | 
| bsw/jbe@1309 | 54             if issue.snapshot then | 
| bsw/jbe@1309 | 55               ui.field.timestamp{ label = _"Last counting:", value = issue.snapshot } | 
| bsw/jbe@1309 | 56             end | 
| bsw/jbe@1309 | 57             ui.field.text{       label = _"Population",            name = "population" } | 
| bsw/jbe@1309 | 58             ui.field.timestamp{  label = _"Created at",            name = "created" } | 
| bsw/jbe@1309 | 59             if policy.polling then | 
| bsw/jbe@1309 | 60               ui.field.text{       label = _"Admission time",        value = _"Implicitly admitted" } | 
| bsw/jbe@1309 | 61             else | 
| bsw/jbe@1309 | 62               ui.field.text{       label = _"Minimum admission time",        value = format.interval_text(issue.min_admission_time_text) } | 
| bsw/jbe@1309 | 63               ui.field.text{       label = _"Maximum admission time",        value = format.interval_text(issue.max_admission_time_text) } | 
| bsw/jbe@1309 | 64               ui.field.text{ label = _"Issue quorum", value = issue.issue_quorum } | 
| bsw/jbe@1309 | 65             end | 
| bsw/jbe@1309 | 66             if issue.accepted then | 
| bsw/jbe@1309 | 67               ui.field.timestamp{  label = _"Accepted at",           name = "accepted" } | 
| bsw/jbe@1309 | 68             end | 
| bsw/jbe@1309 | 69             ui.field.text{       label = _"Discussion time",       value = format.interval_text(issue.discussion_time_text) } | 
| bsw/jbe@1309 | 70             if issue.half_frozen then | 
| bsw/jbe@1309 | 71               ui.field.timestamp{  label = _"Half frozen at",        name = "half_frozen" } | 
| bsw/jbe@1309 | 72             end | 
| bsw/jbe@1309 | 73             ui.field.text{       label = _"Verification time",     value = format.interval_text(issue.verification_time_text) } | 
| bsw/jbe@1309 | 74             ui.field.text{ | 
| bsw/jbe@1309 | 75               label   = _"Initiative quorum", | 
| bsw/jbe@1309 | 76               value = format.percentage(policy.initiative_quorum_num / policy.initiative_quorum_den) | 
| bsw/jbe@1309 | 77             } | 
| bsw/jbe@1309 | 78             if issue.fully_frozen then | 
| bsw/jbe@1309 | 79               ui.field.timestamp{  label = _"Fully frozen at",       name = "fully_frozen" } | 
| bsw/jbe@1309 | 80             end | 
| bsw/jbe@1309 | 81             ui.field.text{       label = _"Voting time",           value = format.interval_text(issue.voting_time_text) } | 
| bsw/jbe@1309 | 82             if issue.closed then | 
| bsw/jbe@1309 | 83               ui.field.timestamp{  label = _"Closed",                name = "closed" } | 
| bsw/jbe@1309 | 84             end | 
| bsw/jbe@1309 | 85           end | 
| bsw/jbe@1309 | 86         } | 
| bsw@719 | 87 | 
| bsw/jbe@1309 | 88         if issue.initiatives[1].rank == 1 then | 
| bsw/jbe@1309 | 89           execute.view{ module = "initiative", view = "_sidebar_state", params = { | 
| bsw/jbe@1309 | 90             initiative = issue.initiatives[1] | 
| bsw/jbe@1309 | 91           } } | 
| bsw/jbe@1309 | 92         end | 
| bsw/jbe@1309 | 93 | 
| bsw/jbe@1309 | 94       end } | 
| bsw/jbe@1309 | 95 | 
| bsw/jbe@1309 | 96     end } | 
| bsw/jbe@1309 | 97 | 
| bsw/jbe@1309 | 98   end } | 
| bsw/jbe@1309 | 99 | 
| bsw/jbe@1309 | 100   ui.cell_sidebar{ content = function() | 
| bsw/jbe@1309 | 101     if config.logo then | 
| bsw/jbe@1309 | 102       config.logo() | 
| bsw/jbe@1309 | 103     end | 
| bsw@1045 | 104     execute.view { | 
| bsw/jbe@1309 | 105       module = "issue", view = "_sidebar", | 
| bsw/jbe@1309 | 106       params = { | 
| bsw@1045 | 107         issue = issue, | 
| bsw/jbe@1309 | 108         member = app.session.member | 
| bsw@1045 | 109       } | 
| bsw@1045 | 110     } | 
| bsw/jbe@19 | 111 | 
| bsw/jbe@1309 | 112     execute.view { | 
| bsw/jbe@1309 | 113       module = "issue", view = "_sidebar_whatcanido", | 
| bsw/jbe@1309 | 114       params = { | 
| bsw/jbe@1309 | 115         issue = issue, | 
| bsw/jbe@1309 | 116         member = app.session.member | 
| bsw/jbe@1309 | 117       } | 
| bsw/jbe@1309 | 118     } | 
| bsw/jbe@1309 | 119 | 
| bsw/jbe@1309 | 120     if not config.voting_only or issue.state ~= "voting" then | 
| bsw/jbe@1309 | 121       execute.view { | 
| bsw/jbe@1309 | 122         module = "issue", view = "_sidebar_members", params = { | 
| bsw/jbe@1309 | 123           issue = issue | 
| bsw@1045 | 124         } | 
| bsw@1045 | 125       } | 
| bsw@1045 | 126     end | 
| bsw/jbe@1309 | 127   end } | 
| bsw/jbe@19 | 128 | 
| bsw/jbe@1309 | 129 end } |