liquid_feedback_frontend
view app/main/issue/_sidebar_issue.lua @ 1533:d432f85e868e
Completed firstlife group mirror feature
| author | bsw | 
|---|---|
| date | Mon Oct 05 15:51:47 2020 +0200 (2020-10-05) | 
| parents | ed3c40911ae1 | 
| children | 97dfef4eb2d7 | 
 line source
     1 local issue = param.get("issue", "table")
     2 local ommit_initiative_id = param.get ( "ommit_initiative_id", "number" )
     4 --[[
     5 ui.heading {
     6   level = 2,
     7   content = _"Competing initiatives"
     8 }
     9 --]]
    11 if #(issue.initiatives) > (ommit_initiative_id and 1 or 0) then
    12   execute.view {
    13     module = "initiative", view = "_list",
    14     params = {
    15       issue = issue,
    16       initiatives = issue.initiatives,
    17       ommit_initiative_id = ommit_initiative_id
    18     }
    19   }
    20 end
    22 if #issue.initiatives == 1 then
    23   ui.container { attr = { class = "mdl-card__content" }, content = function()
    24     if not issue.closed and not (issue.state == "voting") then
    25       ui.tag { content = _"Currently this is the only initiative in this issue, because nobody started a competing initiative (yet)." }
    26     else
    27       ui.container { content = _"This is the only initiative in this issue, because nobody started a competing initiative." }
    28     end
    29   end }
    30 end
    32 if app.session.member 
    33     and app.session.member:has_voting_right_for_unit_id(issue.area.unit_id) 
    34     and not issue.closed and not issue.fully_frozen 
    35 then
    36   ui.container{ attr = { class = "mdl-card__actions mdl-card--border" }, content = function()
    37     ui.link {
    38       attr = { class = "mdl-button mdl-js-button" },
    39       module = "draft", view = "new", 
    40       params = { issue_id = issue.id },
    41       content = _"start a new competing initiative"
    42     }
    43   end }
    44 end
