| rev | line source | 
| bsw@1045 | 1 local issue = param.get("issue", "table") | 
| bsw@1045 | 2 local for_history = param.get("for_history", atom.boolean) | 
| bsw@1045 | 3 | 
| bsw@1045 | 4 ui.sectionHead( "issueInfo", function () | 
| bsw@1045 | 5   ui.container { attr = { class = "left" }, content = function() | 
| bsw@1045 | 6     ui.heading { level = 1, content = issue.name } | 
| bsw@1045 | 7   end } | 
| bsw@1045 | 8   if app.session.member then | 
| bsw@1045 | 9     ui.container { attr = { class = "right" }, content = function () | 
| bsw@1045 | 10       if issue.fully_frozen then | 
| bsw@1045 | 11         if issue.member_info.direct_voted then | 
| bsw@1045 | 12           ui.image { attr = { class = "icon48 right" }, static = "icons/48/voted_ok.png" } | 
| bsw@1045 | 13           ui.tag { content = _"You have voted" } | 
| bsw@1045 | 14           slot.put(" ") | 
| bsw@1045 | 15           if not issue.closed then | 
| bsw@1045 | 16             slot.put("<br />") | 
| bsw@1045 | 17             ui.link { | 
| bsw@1045 | 18               module = "vote", view = "list", | 
| bsw@1045 | 19               params = { issue_id = issue.id }, | 
| bsw@1045 | 20               text = _"change vote" | 
| bsw@1045 | 21             } | 
| bsw@1045 | 22           else | 
| bsw@1045 | 23             ui.link { | 
| bsw@1045 | 24               module = "vote", view = "list", | 
| bsw@1045 | 25               params = { issue_id = issue.id }, | 
| bsw@1045 | 26               text = _"show vote" | 
| bsw@1045 | 27             } | 
| bsw@1045 | 28           end | 
| bsw@1045 | 29           slot.put(" ") | 
| bsw@1045 | 30         elseif active_trustee_id then | 
| bsw@1045 | 31           ui.tag { content = _"You have voted via delegation" } | 
| bsw@1045 | 32           ui.link { | 
| bsw@1045 | 33             content = _"Show voting ballot", | 
| bsw@1045 | 34             module = "vote", view = "list", params = { | 
| bsw@1045 | 35               issue_id = issue.id, member_id = active_trustee_id | 
| bsw@1045 | 36             } | 
| bsw@1045 | 37           } | 
| bsw@1045 | 38         elseif not issue.closed then | 
| bsw@1045 | 39           ui.link { | 
| bsw@1045 | 40             attr = { class = "btn btn-default" }, | 
| bsw@1045 | 41             module = "vote", view = "list", | 
| bsw@1045 | 42             params = { issue_id = issue.id }, | 
| bsw@1045 | 43             text = _"vote now" | 
| bsw@1045 | 44           } | 
| bsw@1045 | 45         end | 
| bsw@1045 | 46       elseif not issue.closed then | 
| bsw@1045 | 47         if issue.member_info.own_participation then | 
| bsw@1045 | 48           ui.image { attr = { class = "icon48 right" }, static = "icons/48/eye.png" } | 
| bsw@1045 | 49           ui.tag{ content = _"You are interested in this issue" } | 
| bsw@1045 | 50           slot.put("<br />") | 
| bsw@1045 | 51           ui.link { | 
| bsw@1045 | 52             module = "interest", action = "update", | 
| bsw@1045 | 53             params = { issue_id = issue.id, delete = true }, | 
| bsw@1045 | 54             routing = { default = { | 
| bsw@1045 | 55               mode = "redirect", module = "issue", view = "show", id = issue.id | 
| bsw@1045 | 56             } }, | 
| bsw@1045 | 57             text = _"remove my interest" | 
| bsw@1045 | 58           } | 
| bsw@1045 | 59         else | 
| bsw@1045 | 60           ui.link { | 
| bsw@1045 | 61             attr = { class = "btn btn-default" }, | 
| bsw@1045 | 62             module = "interest", action = "update", | 
| bsw@1045 | 63             params = { issue_id = issue.id }, | 
| bsw@1045 | 64             routing = { default = { | 
| bsw@1045 | 65               mode = "redirect", module = "issue", view = "show", id = issue.id | 
| bsw@1045 | 66             } }, | 
| bsw@1045 | 67             text = _"add my interest" | 
| bsw@1045 | 68           } | 
| bsw@1045 | 69         end | 
| bsw@1045 | 70       end | 
| bsw@1045 | 71     end } | 
| bsw@1045 | 72   end | 
| bsw@1045 | 73 end) | 
| bsw@1045 | 74 | 
| bsw@1045 | 75 ui.container { | 
| bsw@1045 | 76   attr = { class = "ui_filter", style="clear: left; margin-top: 4px;" }, | 
| bsw@1045 | 77   content = function () | 
| bsw@1045 | 78     ui.container { | 
| bsw@1045 | 79       attr = { class = "ui_filter_head" }, | 
| bsw@1045 | 80       content = function () | 
| bsw@1045 | 81 | 
| bsw@1045 | 82         ui.link{ | 
| bsw@1045 | 83           attr = { class = not for_history and "active" or nil }, | 
| bsw@1045 | 84           text = _"Initiatives", | 
| bsw@1045 | 85           module = "issue", view = "show", id = issue.id | 
| bsw@1045 | 86         } | 
| bsw@1045 | 87         slot.put(" ") | 
| bsw@1045 | 88         ui.link{ | 
| bsw@1045 | 89           attr = { class = for_history and "active" or nil }, | 
| bsw@1045 | 90           text = _"History", | 
| bsw@1045 | 91           module = "issue", view = "history", id = issue.id | 
| bsw@1045 | 92         } | 
| bsw@1045 | 93       end | 
| bsw@1045 | 94     } | 
| bsw@1045 | 95   end | 
| bsw@1045 | 96 } |