bsw@1045: local issue = param.get("issue", "table") bsw/jbe@1309: local ommit_initiative_id = param.get ( "ommit_initiative_id", "number" ) bsw@1045: bsw/jbe@1309: --[[ bsw/jbe@1309: ui.heading { bsw/jbe@1309: level = 2, bsw/jbe@1309: content = _"Competing initiatives" bsw/jbe@1309: } bsw/jbe@1309: --]] bsw/jbe@1309: bsw/jbe@1309: if #(issue.initiatives) > (ommit_initiative_id and 1 or 0) then bsw@1045: execute.view { bsw@1045: module = "initiative", view = "_list", bsw@1045: params = { bsw@1045: issue = issue, bsw@1045: initiatives = issue.initiatives, bsw/jbe@1309: ommit_initiative_id = ommit_initiative_id bsw@1045: } bsw@1045: } bsw/jbe@1309: end bsw/jbe@1309: bsw/jbe@1309: if #issue.initiatives == 1 then bsw/jbe@1309: ui.container { attr = { class = "mdl-card__content" }, content = function() bsw/jbe@1309: if not issue.closed and not (issue.state == "voting") then bsw/jbe@1309: ui.tag { content = _"Currently this is the only initiative in this issue, because nobody started a competing initiative (yet)." } bsw/jbe@1309: else bsw/jbe@1309: ui.container { content = _"This is the only initiative in this issue, because nobody started a competing initiative." } bsw/jbe@1309: end bsw/jbe@1309: end } bsw/jbe@1309: end bsw@1045: bsw/jbe@1309: if app.session.member bsw/jbe@1309: and app.session.member:has_voting_right_for_unit_id(issue.area.unit_id) bsw/jbe@1309: and not issue.closed and not issue.fully_frozen bsw/jbe@1309: then bsw/jbe@1309: ui.container{ attr = { class = "mdl-card__actions mdl-card--border" }, content = function() bsw/jbe@1309: ui.link { bsw/jbe@1309: attr = { class = "mdl-button mdl-js-button" }, bsw/jbe@1309: module = "initiative", view = "new", bsw/jbe@1309: params = { issue_id = issue.id }, bsw/jbe@1309: content = _"start a new competing initiative" bsw/jbe@1309: } bsw/jbe@1309: end } bsw/jbe@1309: end