rev |
line source |
bsw@1045
|
1 local area = param.get ( "area", "table" )
|
bsw/jbe@1309
|
2 area:load_delegation_info_once_for_member_id(app.session.member_id)
|
bsw@1045
|
3
|
bsw@1045
|
4 local participating_trustee_id
|
bsw@1045
|
5 local participating_trustee_name
|
bsw/jbe@1309
|
6 if app.session.member then
|
bsw@1045
|
7 if area.delegation_info.first_trustee_participation then
|
bsw@1045
|
8 participating_trustee_id = area.delegation_info.first_trustee_id
|
bsw@1045
|
9 participating_trustee_name = area.delegation_info.first_trustee_name
|
bsw@1045
|
10 elseif area.delegation_info.other_trustee_participation then
|
bsw@1045
|
11 participating_trustee_id = area.delegation_info.other_trustee_id
|
bsw@1045
|
12 participating_trustee_name = area.delegation_info.other_trustee_name
|
bsw@1045
|
13 end
|
bsw@1045
|
14 end
|
bsw@1045
|
15
|
bsw/jbe@1309
|
16 ui.container{ attr = { class = "mdl-card mdl-card__fullwidth mdl-shadow--2dp" }, content = function()
|
bsw/jbe@1309
|
17 ui.container{ attr = { class = "mdl-card__title mdl-card--border" }, content = function()
|
bsw/jbe@1309
|
18 ui.heading { attr = { class = "mdl-card__title-text" }, level = 2, content = _"What can I do here?" }
|
bsw/jbe@1309
|
19 end }
|
bsw/jbe@1309
|
20 ui.container{ attr = { class = "what-can-i-do-here" }, content = function()
|
bsw@1045
|
21
|
bsw/jbe@1309
|
22 if app.session.member and app.session.member:has_voting_right_for_unit_id(area.unit_id) then
|
bsw@1250
|
23
|
bsw/jbe@1309
|
24 if not app.session.member.disable_notifications then
|
bsw/jbe@1309
|
25
|
bsw/jbe@1309
|
26 local ignored_area = IgnoredArea:by_pk(app.session.member_id, area.id)
|
bsw@1250
|
27
|
bsw/jbe@1309
|
28 if not ignored_area then
|
bsw/jbe@1309
|
29 ui.container{ attr = { class = "mdl-card__content mdl-card--border" }, content = function()
|
bsw/jbe@1309
|
30 ui.tag{ content = _"You are receiving updates by email for this subject area" }
|
bsw/jbe@1309
|
31 ui.tag { tag = "ul", attr = { class = "ul" }, content = function ()
|
bsw/jbe@1309
|
32 ui.tag { tag = "li", content = function ()
|
bsw/jbe@1309
|
33 ui.tag { content = function ()
|
bsw/jbe@1309
|
34 ui.link {
|
bsw/jbe@1309
|
35 module = "area", action = "update_ignore",
|
bsw/jbe@1309
|
36 params = { area_id = area.id },
|
bsw/jbe@1309
|
37 routing = { default = {
|
bsw/jbe@1309
|
38 mode = "redirect", module = "index", view = "index", params = { unit = area.unit_id, area = area.id }
|
bsw/jbe@1309
|
39 } },
|
bsw/jbe@1309
|
40 text = _"unsubscribe from update emails about this area"
|
bsw/jbe@1309
|
41 }
|
bsw/jbe@1309
|
42 end }
|
bsw@1250
|
43 end }
|
bsw@1250
|
44 end }
|
bsw@1250
|
45 end }
|
bsw/jbe@1309
|
46 end
|
bsw/jbe@1309
|
47
|
bsw/jbe@1309
|
48 if ignored_area then
|
bsw/jbe@1309
|
49 ui.container{ attr = { class = "mdl-card__content mdl-card--border" }, content = function()
|
bsw/jbe@1309
|
50 ui.tag{ content = _"I want to stay informed" }
|
bsw/jbe@1309
|
51 ui.tag { tag = "ul", attr = { class = "ul" }, content = function ()
|
bsw/jbe@1309
|
52 ui.tag { tag = "li", content = function ()
|
bsw/jbe@1309
|
53 ui.tag { content = function ()
|
bsw/jbe@1309
|
54 ui.link {
|
bsw/jbe@1309
|
55 module = "area", action = "update_ignore",
|
bsw/jbe@1309
|
56 params = { area_id = area.id, delete = true },
|
bsw/jbe@1309
|
57 routing = { default = {
|
bsw/jbe@1309
|
58 mode = "redirect", module = "index", view = "index", params = { unit = area.unit_id, area = area.id }
|
bsw/jbe@1309
|
59 } },
|
bsw/jbe@1309
|
60 text = _"subscribe for update emails about this area"
|
bsw/jbe@1309
|
61 }
|
bsw/jbe@1309
|
62 end }
|
bsw/jbe@1309
|
63 end }
|
bsw/jbe@1309
|
64 end }
|
bsw/jbe@1309
|
65 end }
|
bsw/jbe@1309
|
66 end
|
bsw@1250
|
67
|
bsw/jbe@1309
|
68 else
|
bsw/jbe@1309
|
69 ui.container{ attr = { class = "mdl-card__content mdl-card--border" }, content = function()
|
bsw/jbe@1309
|
70 ui.tag{ content = _"I want to stay informed about this subject area" }
|
bsw@1250
|
71 ui.tag { tag = "ul", attr = { class = "ul" }, content = function ()
|
bsw@1250
|
72 ui.tag { tag = "li", content = function ()
|
bsw@1250
|
73 ui.tag { content = function ()
|
bsw/jbe@1309
|
74 ui.tag{ content = _"Edit your global " }
|
bsw@1250
|
75 ui.link {
|
bsw/jbe@1309
|
76 module = "member", view = "settings_notification",
|
bsw/jbe@1309
|
77 params = { return_to = "area", return_to_area_id = area.id },
|
bsw/jbe@1309
|
78 text = _"notification settings"
|
bsw@1250
|
79 }
|
bsw/jbe@1309
|
80 ui.tag{ content = _" to receive updates by email" }
|
bsw@1250
|
81 end }
|
bsw@1250
|
82 end }
|
bsw@1250
|
83 end }
|
bsw@1250
|
84 end }
|
bsw/jbe@1309
|
85 end
|
bsw@1045
|
86
|
bsw/jbe@1309
|
87 if app.session.member:has_voting_right_for_unit_id ( area.unit_id ) then
|
bsw/jbe@1309
|
88 ui.container{ attr = { class = "mdl-card__content mdl-card--border" }, content = function()
|
bsw/jbe@1309
|
89 ui.tag{ content = _"I want to vote" }
|
bsw/jbe@1309
|
90 ui.tag { tag = "ul", attr = { class = "ul" }, content = function ()
|
bsw/jbe@1309
|
91 ui.tag { tag = "li", content = _"check the issues on the right, and click on 'Vote now' to vote on an issue which is in voting phase." }
|
bsw@1045
|
92 end }
|
bsw@1045
|
93 end }
|
bsw/jbe@1309
|
94 end
|
bsw/jbe@1309
|
95
|
bsw/jbe@1309
|
96 if app.session.member and not app.session.member:has_voting_right_for_unit_id(area.unit_id) then
|
bsw/jbe@1309
|
97 ui.container{ attr = { class = "mdl-card__content mdl-card--border" }, content = _"You are not entitled to vote in this unit" }
|
bsw/jbe@1309
|
98 end
|
bsw@1045
|
99
|
bsw/jbe@1309
|
100 if app.session.member and app.session.member:has_voting_right_for_unit_id(area.unit_id) then
|
bsw/jbe@1309
|
101
|
bsw/jbe@1309
|
102 if not config.disable_delegations then
|
bsw/jbe@1309
|
103
|
bsw/jbe@1309
|
104 ui.container{ attr = { class = "mdl-card__content mdl-card--border" }, content = function()
|
bsw/jbe@1309
|
105
|
bsw/jbe@1309
|
106 if not area.delegation_info.first_trustee_id then
|
bsw/jbe@1309
|
107 ui.tag{ content = _"I want to delegate this subject area" }
|
bsw/jbe@1309
|
108 else
|
bsw/jbe@1309
|
109 ui.container { attr = { class = "right" }, content = function()
|
bsw/jbe@1309
|
110 local member = Member:by_id(area.delegation_info.first_trustee_id)
|
bsw/jbe@1309
|
111 execute.view{
|
bsw/jbe@1309
|
112 module = "member_image",
|
bsw/jbe@1309
|
113 view = "_show",
|
bsw/jbe@1309
|
114 params = {
|
bsw/jbe@1309
|
115 member = member,
|
bsw/jbe@1309
|
116 image_type = "avatar",
|
bsw/jbe@1309
|
117 show_dummy = true
|
bsw/jbe@1309
|
118 }
|
bsw/jbe@1309
|
119 }
|
bsw/jbe@1309
|
120 end }
|
bsw/jbe@1309
|
121 ui.tag{ content = _"You delegated this subject area" }
|
bsw/jbe@1309
|
122 end
|
bsw@1045
|
123
|
bsw/jbe@1309
|
124 ui.tag { tag = "ul", attr = { class = "ul" }, content = function ()
|
bsw/jbe@1309
|
125 if area.delegation_info.own_delegation_scope == "unit" then
|
bsw/jbe@1309
|
126 ui.tag { tag = "li", content = function ()
|
bsw/jbe@1309
|
127 ui.link {
|
bsw/jbe@1309
|
128 module = "delegation", view = "show", params = {
|
bsw/jbe@1309
|
129 unit_id = area.unit_id,
|
bsw/jbe@1309
|
130 },
|
bsw/jbe@1309
|
131 content = _("change/revoke delegation of organizational unit")
|
bsw/jbe@1309
|
132 }
|
bsw/jbe@1309
|
133 end }
|
bsw/jbe@1309
|
134 end
|
bsw/jbe@1309
|
135
|
bsw/jbe@1309
|
136 if area.delegation_info.own_delegation_scope == nil then
|
bsw/jbe@1309
|
137 ui.tag { tag = "li", content = function ()
|
bsw/jbe@1309
|
138 ui.link {
|
bsw/jbe@1309
|
139 module = "delegation", view = "show", params = {
|
bsw/jbe@1309
|
140 area_id = area.id
|
bsw/jbe@1309
|
141 },
|
bsw/jbe@1309
|
142 content = _"choose subject area delegatee"
|
bsw/jbe@1309
|
143 }
|
bsw/jbe@1309
|
144 end }
|
bsw/jbe@1309
|
145 elseif area.delegation_info.own_delegation_scope == "area" then
|
bsw/jbe@1309
|
146 ui.tag { tag = "li", content = function ()
|
bsw/jbe@1309
|
147 ui.link {
|
bsw/jbe@1309
|
148 module = "delegation", view = "show", params = {
|
bsw/jbe@1309
|
149 area_id = area.id
|
bsw/jbe@1309
|
150 },
|
bsw/jbe@1309
|
151 content = _"change/revoke area delegation"
|
bsw/jbe@1309
|
152 }
|
bsw/jbe@1309
|
153 end }
|
bsw/jbe@1309
|
154 else
|
bsw/jbe@1309
|
155 ui.tag { tag = "li", content = function ()
|
bsw/jbe@1309
|
156 ui.link {
|
bsw/jbe@1309
|
157 module = "delegation", view = "show", params = {
|
bsw/jbe@1309
|
158 area_id = area.id
|
bsw/jbe@1309
|
159 },
|
bsw/jbe@1309
|
160 content = _"change/revoke delegation only for this subject area"
|
bsw/jbe@1309
|
161 }
|
bsw/jbe@1309
|
162 end }
|
bsw/jbe@1309
|
163 end
|
bsw/jbe@1309
|
164 end }
|
bsw/jbe@1309
|
165 end }
|
bsw/jbe@1309
|
166 end
|
bsw/jbe@1309
|
167
|
bsw/jbe@1309
|
168 if app.session.member:has_initiative_right_for_unit_id ( area.unit_id ) then
|
bsw/jbe@1309
|
169 ui.container{ attr = { class = "mdl-card__content mdl-card--border" }, content = function()
|
bsw/jbe@1309
|
170 ui.tag{
|
bsw/jbe@1309
|
171 content = _("I want to start a new initiative", {
|
bsw/jbe@1309
|
172 area_name = area.name
|
bsw/jbe@1309
|
173 } )
|
bsw@1045
|
174 }
|
bsw/jbe@1309
|
175 ui.tag { tag = "ul", attr = { class = "ul" }, content = function ()
|
bsw/jbe@1309
|
176 ui.tag { tag = "li", content = _"Take a look through the existing issues. Maybe someone else started a debate on your topic (and you can join it) or the topic has been decided already in the past." }
|
bsw/jbe@1309
|
177 ui.tag { tag = "li", content = function ()
|
bsw/jbe@1309
|
178 ui.tag { content = function ()
|
bsw/jbe@1309
|
179 ui.tag { content = _"If you cannot find any appropriate existing issue, " }
|
bsw/jbe@1309
|
180 ui.link {
|
bsw/jbe@1309
|
181 module = "initiative", view = "new",
|
bsw/jbe@1309
|
182 params = { area_id = area.id },
|
bsw/jbe@1309
|
183 text = _"start an initiative in a new issue"
|
bsw/jbe@1309
|
184 }
|
bsw/jbe@1309
|
185 end }
|
bsw/jbe@1309
|
186 end }
|
bsw/jbe@1309
|
187 end }
|
bsw@1045
|
188 end }
|
bsw@1045
|
189 end
|
bsw/jbe@1309
|
190
|
bsw/jbe@1309
|
191 end
|
bsw/jbe@1309
|
192 else
|
bsw/jbe@1309
|
193 ui.container { attr = { class = "mdl-card__content mdl-card--border" }, content = function ()
|
bsw/jbe@1309
|
194 ui.tag{ content = _"You are not entitled to vote in this unit" }
|
bsw/jbe@1309
|
195 ui.tag{ tag = "ul", content = function()
|
bsw/jbe@1309
|
196 ui.tag{ tag = "li", content = function()
|
bsw/jbe@1309
|
197 ui.link{ module = "index", view = "login", content = _"Login" }
|
bsw@1045
|
198 end }
|
bsw@1045
|
199 end }
|
bsw/jbe@1309
|
200 end }
|
bsw@1045
|
201 end
|
bsw/jbe@1309
|
202 end }
|
bsw@1045
|
203
|
bsw/jbe@1309
|
204 end }
|