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