bsw@1045: local issue = param.get("issue", "table") bsw@1045: local hide_initiatives = param.get("hide_initiatives", atom.boolean) bsw@1045: local highlight_initiative_id = param.get ( "highlight_initiative_id", "number" ) bsw@1045: bsw@1045: ui.sidebar ( "tab-whatcanido", function () bsw@1045: bsw@1045: ui.sidebarHead( function() bsw@1045: ui.heading { bsw@1045: level = 2, bsw@1045: content = _"Competing initiatives" bsw@1045: } bsw@1045: end ) bsw@1045: bsw@1045: execute.view { bsw@1045: module = "initiative", view = "_list", bsw@1045: params = { bsw@1045: issue = issue, bsw@1045: initiatives = issue.initiatives, bsw@1045: highlight_initiative_id = highlight_initiative_id bsw@1045: } bsw@1045: } bsw@1045: if #issue.initiatives == 1 then bsw@1045: ui.sidebarSection( function () bsw@1045: bsw@1045: if not issue.closed and not (issue.state == "voting") then bsw@1045: ui.container { content = function() bsw@1045: ui.tag { content = _"Currently this is the only initiative in this issue, because nobody started a competing initiative (yet)." } bsw@1045: if app.session.member and app.session.member:has_voting_right_for_unit_id(issue.area.unit_id) then bsw@1045: slot.put(" ") bsw@1045: ui.tag { content = _"To create a competing initiative see below." } bsw@1045: end bsw@1045: end } bsw@1045: else bsw@1045: ui.container { content = _"This is the only initiative in this issue, because nobody started a competing initiative." } bsw@1045: end bsw@1045: end ) bsw@1045: end bsw@1045: bsw@1045: end ) -- ui.sidebar