bsw@1045: local issue = param.get("issue", "table")
bsw@1045: local for_history = param.get("for_history", atom.boolean)
bsw@1045: 
bsw@1045: ui.sectionHead( "issueInfo", function ()
bsw@1045:   ui.container { attr = { class = "left" }, content = function()
bsw@1045:     ui.heading { level = 1, content = issue.name }
bsw@1045:   end }
bsw@1045:   if app.session.member then
bsw@1045:     ui.container { attr = { class = "right" }, content = function ()
bsw@1045:       if issue.fully_frozen then
bsw@1045:         if issue.member_info.direct_voted then
bsw@1045:           ui.image { attr = { class = "icon48 right" }, static = "icons/48/voted_ok.png" }
bsw@1045:           ui.tag { content = _"You have voted" }
bsw@1045:           slot.put(" ")
bsw@1045:           if not issue.closed then
bsw@1045:             slot.put("
")
bsw@1045:             ui.link {
bsw@1045:               module = "vote", view = "list", 
bsw@1045:               params = { issue_id = issue.id },
bsw@1045:               text = _"change vote"
bsw@1045:             }
bsw@1045:           else
bsw@1045:             ui.link {
bsw@1045:               module = "vote", view = "list", 
bsw@1045:               params = { issue_id = issue.id },
bsw@1045:               text = _"show vote"
bsw@1045:             }
bsw@1045:           end
bsw@1045:           slot.put(" ")
bsw@1045:         elseif active_trustee_id then
bsw@1045:           ui.tag { content = _"You have voted via delegation" }
bsw@1045:           ui.link {
bsw@1045:             content = _"Show voting ballot",
bsw@1045:             module = "vote", view = "list", params = {
bsw@1045:               issue_id = issue.id, member_id = active_trustee_id
bsw@1045:             }
bsw@1045:           }
bsw@1045:         elseif not issue.closed then
bsw@1045:           ui.link {
bsw@1045:             attr = { class = "btn btn-default" },
bsw@1045:             module = "vote", view = "list", 
bsw@1045:             params = { issue_id = issue.id },
bsw@1045:             text = _"vote now"
bsw@1045:           }
bsw@1045:         end
bsw@1045:       elseif not issue.closed then
bsw@1045:         if issue.member_info.own_participation then
bsw@1045:           ui.image { attr = { class = "icon48 right" }, static = "icons/48/eye.png" }
bsw@1045:           ui.tag{ content = _"You are interested in this issue" }
bsw@1045:           slot.put("
")
bsw@1045:           ui.link {
bsw@1045:             module = "interest", action = "update", 
bsw@1045:             params = { issue_id = issue.id, delete = true },
bsw@1045:             routing = { default = {
bsw@1045:               mode = "redirect", module = "issue", view = "show", id = issue.id
bsw@1045:             } },
bsw@1045:             text = _"remove my interest"
bsw@1045:           }
bsw@1045:         else
bsw@1045:           ui.link {
bsw@1045:             attr = { class = "btn btn-default" },
bsw@1045:             module = "interest", action = "update", 
bsw@1045:             params = { issue_id = issue.id },
bsw@1045:             routing = { default = {
bsw@1045:               mode = "redirect", module = "issue", view = "show", id = issue.id
bsw@1045:             } },
bsw@1045:             text = _"add my interest"
bsw@1045:           }
bsw@1045:         end
bsw@1045:       end
bsw@1045:     end }
bsw@1045:   end
bsw@1045: end)
bsw@1045:   
bsw@1045: ui.container {
bsw@1045:   attr = { class = "ui_filter", style="clear: left; margin-top: 4px;" },
bsw@1045:   content = function ()
bsw@1045:     ui.container {
bsw@1045:       attr = { class = "ui_filter_head" },
bsw@1045:       content = function ()
bsw@1045:         
bsw@1045:         ui.link{
bsw@1045:           attr = { class = not for_history and "active" or nil },
bsw@1045:           text = _"Initiatives",
bsw@1045:           module = "issue", view = "show", id = issue.id
bsw@1045:         }
bsw@1045:         slot.put(" ")
bsw@1045:         ui.link{
bsw@1045:           attr = { class = for_history and "active" or nil },
bsw@1045:           text = _"History",
bsw@1045:           module = "issue", view = "history", id = issue.id
bsw@1045:         }
bsw@1045:       end
bsw@1045:     }
bsw@1045:   end
bsw@1045: }