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