| rev | line source | 
| bsw/jbe@1309 | 1 local issue = param.get("issue", "table") | 
| bsw/jbe@1309 | 2 local initiative = param.get("initiative", "table") | 
| bsw/jbe@1309 | 3 | 
| bsw/jbe@1309 | 4 local member = param.get ( "member", "table" ) | 
| bsw/jbe@1309 | 5 | 
| bsw/jbe@1309 | 6 ui.container{ attr = { class = "mdl-card mdl-shadow--2dp mdl-card__fullwidth" }, content = function() | 
| bsw/jbe@1309 | 7 | 
| bsw/jbe@1309 | 8   ui.container{ attr = { class = "mdl-card__title mdl-card--border" }, content = function() | 
| bsw/jbe@1309 | 9     ui.heading { attr = { class = "mdl-card__title-text" }, level = 2, content = issue.name } | 
| bsw/jbe@1309 | 10   end } | 
| bsw/jbe@1309 | 11 | 
| bsw/jbe@1309 | 12   if issue.admin_notice then | 
| bsw/jbe@1309 | 13     ui.container{ attr = { class = "mdl-card__content mdl-card--border phases" }, content = function() | 
| bsw/jbe@1309 | 14       slot.put(encode.html_newlines(issue.admin_notice)) | 
| bsw/jbe@1309 | 15     end } | 
| bsw/jbe@1309 | 16   end | 
| bsw/jbe@1309 | 17 | 
| bsw/jbe@1309 | 18   ui.container{ attr = { class = "mdl-card__content mdl-card--border phases" }, content = function() | 
| bsw/jbe@1309 | 19     execute.view{ module = "issue", view = "_sidebar_state", params = { | 
| bsw/jbe@1309 | 20       issue = issue | 
| bsw/jbe@1309 | 21     } } | 
| bsw/jbe@1309 | 22   end } | 
| bsw/jbe@1309 | 23 | 
| bsw/jbe@1309 | 24   if app.session.member then | 
| bsw/jbe@1309 | 25     if issue.fully_frozen then | 
| bsw/jbe@1309 | 26       if issue.member_info.direct_voted then | 
| bsw/jbe@1309 | 27         ui.container{ attr = { class = "mdl-card__content mdl-card--border" }, content = function() | 
| bsw/jbe@1309 | 28           ui.tag{ tag = "i", attr = { class = "material-icons" }, content = "mail_outline" } | 
| bsw/jbe@1309 | 29           slot.put(" ") | 
| bsw/jbe@1309 | 30           ui.tag { content = _"You have voted" } | 
| bsw/jbe@1309 | 31         end } | 
| bsw/jbe@1309 | 32       elseif active_trustee_id then | 
| bsw/jbe@1309 | 33         ui.container{ attr = { class = "mdl-card__content mdl-card--border" }, content = function() | 
| bsw/jbe@1309 | 34           ui.tag{ tag = "i", attr = { class = "material-icons" }, content = "mail_outline" } | 
| bsw/jbe@1309 | 35           slot.put(" ") | 
| bsw/jbe@1309 | 36           ui.tag { content = _"You have voted via delegation" } | 
| bsw/jbe@1309 | 37         end } | 
| bsw/jbe@1309 | 38       end | 
| bsw/jbe@1309 | 39     elseif not issue.closed then | 
| bsw/jbe@1309 | 40       if issue.member_info.own_participation then | 
| bsw/jbe@1309 | 41         ui.container{ attr = { class = "mdl-card__content mdl-card--border" }, content = function() | 
| bsw@1603 | 42           ui.tag{ tag = "i", attr = { class = "material-icons" }, content = "star" } | 
| bsw/jbe@1309 | 43           slot.put(" ") | 
| bsw/jbe@1309 | 44           ui.tag{ content = _"You are interested in this issue" } | 
| bsw/jbe@1309 | 45         end } | 
| bsw/jbe@1309 | 46       end | 
| bsw/jbe@1309 | 47     end | 
| bsw/jbe@1309 | 48 | 
| bsw/jbe@1309 | 49     if not issue.closed then | 
| bsw/jbe@1309 | 50       ui.container{ attr = { class = "mdl-card__actions" }, content = function() | 
| bsw/jbe@1309 | 51         if issue.fully_frozen then | 
| bsw/jbe@1309 | 52           if issue.member_info.direct_voted then | 
| bsw/jbe@1309 | 53             if not issue.closed then | 
| bsw/jbe@1309 | 54               ui.link { | 
| bsw/jbe@1309 | 55                 attr = { class = "mdl-button mdl-js-button" }, | 
| bsw/jbe@1309 | 56                 module = "vote", view = "list", | 
| bsw/jbe@1309 | 57                 params = { issue_id = issue.id }, | 
| bsw/jbe@1309 | 58                 text = _"change vote" | 
| bsw/jbe@1309 | 59               } | 
| bsw/jbe@1309 | 60             else | 
| bsw/jbe@1309 | 61               ui.link { | 
| bsw/jbe@1309 | 62                 attr = { class = "mdl-button mdl-js-button" }, | 
| bsw/jbe@1309 | 63                 module = "vote", view = "list", | 
| bsw/jbe@1309 | 64                 params = { issue_id = issue.id }, | 
| bsw/jbe@1309 | 65                 text = _"show vote" | 
| bsw/jbe@1309 | 66               } | 
| bsw/jbe@1309 | 67             end | 
| bsw/jbe@1309 | 68           elseif active_trustee_id then | 
| bsw/jbe@1309 | 69             ui.link { | 
| bsw/jbe@1309 | 70               attr = { class = "mdl-button mdl-js-button" }, | 
| bsw/jbe@1309 | 71               content = _"Show voting ballot", | 
| bsw/jbe@1309 | 72               module = "vote", view = "list", params = { | 
| bsw/jbe@1309 | 73                 issue_id = issue.id, member_id = active_trustee_id | 
| bsw/jbe@1309 | 74               } | 
| bsw/jbe@1309 | 75             } | 
| bsw/jbe@1309 | 76           elseif not issue.closed then | 
| bsw/jbe@1309 | 77             ui.link { | 
| bsw/jbe@1309 | 78               attr = { class = "mdl-button mdl-js-button" }, | 
| bsw/jbe@1309 | 79               module = "vote", view = "list", | 
| bsw/jbe@1309 | 80               params = { issue_id = issue.id }, | 
| bsw/jbe@1309 | 81               text = _"vote now" | 
| bsw/jbe@1309 | 82             } | 
| bsw/jbe@1309 | 83           end | 
| bsw/jbe@1309 | 84         elseif not issue.closed then | 
| bsw/jbe@1309 | 85           if issue.member_info.own_participation then | 
| bsw/jbe@1309 | 86             ui.link { | 
| bsw/jbe@1309 | 87               attr = { class = "mdl-button mdl-js-button" }, | 
| bsw/jbe@1309 | 88               module = "interest", action = "update", | 
| bsw@1618 | 89               params = { issue_id = issue.id, interested = false }, | 
| bsw/jbe@1309 | 90               routing = { default = { | 
| bsw/jbe@1309 | 91                 mode = "redirect", module = initiative and "initiative" or "issue", view = "show", id = initiative and initiative.id or issue.id | 
| bsw/jbe@1309 | 92               } }, | 
| bsw/jbe@1309 | 93               text = _"remove my interest" | 
| bsw/jbe@1309 | 94             } | 
| bsw/jbe@1309 | 95           else | 
| bsw/jbe@1309 | 96             ui.link { | 
| bsw/jbe@1309 | 97               attr = { class = "mdl-button mdl-js-button" }, | 
| bsw/jbe@1309 | 98               module = "interest", action = "update", | 
| bsw@1618 | 99               params = { issue_id = issue.id, interested = true }, | 
| bsw/jbe@1309 | 100               routing = { default = { | 
| bsw/jbe@1309 | 101                 mode = "redirect", module = initiative and "initiative" or "issue", view = "show", id = initiative and initiative.id or issue.id | 
| bsw/jbe@1309 | 102               } }, | 
| bsw/jbe@1309 | 103               content = function() | 
| bsw@1603 | 104                 ui.tag{ tag = "i", attr = { class = "material-icons" }, content = "star" } | 
| bsw/jbe@1309 | 105                 slot.put(" ") | 
| bsw/jbe@1309 | 106                 ui.tag{ content = _"add my interest" } | 
| bsw/jbe@1309 | 107               end | 
| bsw/jbe@1309 | 108             } | 
| bsw/jbe@1309 | 109           end | 
| bsw/jbe@1309 | 110         end | 
| bsw/jbe@1309 | 111       end } | 
| bsw/jbe@1309 | 112     end | 
| bsw/jbe@1309 | 113   end | 
| bsw/jbe@1309 | 114 | 
| bsw/jbe@1309 | 115 end } | 
| bsw/jbe@1309 | 116 | 
| bsw/jbe@1309 | 117 if initiative then | 
| bsw/jbe@1309 | 118 | 
| bsw/jbe@1309 | 119   ui.container{ attr = { class = "mdl-card mdl-shadow--2dp mdl-card__fullwidth" }, content = function() | 
| bsw/jbe@1309 | 120     ui.container{ attr = { class = "mdl-card__title mdl-card--border" }, content = function() | 
| bsw/jbe@1309 | 121       ui.heading { attr = { class = "mdl-card__title-text" }, level = 2, content = _"Competing initiatives" } | 
| bsw/jbe@1309 | 122     end } | 
| bsw/jbe@1309 | 123 | 
| bsw/jbe@1309 | 124     execute.view { | 
| bsw/jbe@1309 | 125       module = "issue", view = "_sidebar_issue", | 
| bsw/jbe@1309 | 126       params = { | 
| bsw/jbe@1309 | 127         issue = issue, | 
| bsw/jbe@1309 | 128         ommit_initiative_id = initiative.id | 
| bsw/jbe@1309 | 129       } | 
| bsw/jbe@1309 | 130     } | 
| bsw/jbe@1309 | 131 | 
| bsw/jbe@1309 | 132   end } | 
| bsw/jbe@1309 | 133 end |