liquid_feedback_frontend

view app/main/area/_sidebar_whatcanido.lua @ 1157:591b78770f66

merge
author jbe
date Mon Mar 23 23:18:43 2015 +0100 (2015-03-23)
parents 701a5cf6b067
children 84f6e17c7ceb
line source
1 local member = param.get ( "member", "table" ) or app.session.member
3 local area = param.get ( "area", "table" )
5 local participating_trustee_id
6 local participating_trustee_name
7 if member then
8 if area.delegation_info.first_trustee_participation then
9 participating_trustee_id = area.delegation_info.first_trustee_id
10 participating_trustee_name = area.delegation_info.first_trustee_name
11 elseif area.delegation_info.other_trustee_participation then
12 participating_trustee_id = area.delegation_info.other_trustee_id
13 participating_trustee_name = area.delegation_info.other_trustee_name
14 end
15 end
17 ui.sidebar ( "tab-whatcanido", function ()
19 ui.sidebarHeadWhatCanIDo()
21 if member and not app.session.member:has_voting_right_for_unit_id(area.unit_id) then
22 ui.sidebarSection( _"You are not entitled to vote in this unit" )
23 end
25 if member and app.session.member:has_voting_right_for_unit_id(area.unit_id) then
26 if not area.delegation_info.own_participation then
27 ui.sidebarSection ( function ()
29 ui.heading {
30 level = 3,
31 content = _"I want to participate in this subject area"
32 }
33 ui.tag { tag = "ul", attr = { class = "ul" }, content = function ()
34 ui.tag { tag = "li", content = function ()
35 ui.tag { content = function ()
36 ui.link {
37 module = "membership", action = "update",
38 routing = { default = {
39 mode = "redirect", module = "area", view = "show", id = area.id
40 } },
41 params = { area_id = area.id },
42 text = _"subscribe"
43 }
44 end }
45 end }
46 end }
47 end )
48 end
50 if area.delegation_info.own_participation then
51 ui.sidebarSection ( function ()
52 ui.image{ attr = { class = "right" }, static = "icons/48/star.png" }
53 ui.heading {
54 level = 3,
55 content = _"You are subscribed for this subject area"
56 }
57 ui.tag { tag = "ul", attr = { class = "ul" }, content = function ()
58 ui.tag { tag = "li", content = function ()
59 ui.tag { content = function ()
60 ui.link {
61 module = "membership", action = "update",
62 routing = { default = {
63 mode = "redirect", module = "area", view = "show", id = area.id
64 } },
65 params = { area_id = area.id, delete = true },
66 text = _"unsubscribe"
67 }
68 end }
69 end }
70 end }
71 end )
72 end
75 ui.sidebarSection ( function ()
78 if not area.delegation_info.first_trustee_id then
79 ui.heading{ level = 3, content = _"I want to delegate this subject area" }
80 else
81 ui.container { attr = { class = "right" }, content = function()
82 local member = Member:by_id(area.delegation_info.first_trustee_id)
83 execute.view{
84 module = "member_image",
85 view = "_show",
86 params = {
87 member = member,
88 image_type = "avatar",
89 show_dummy = true
90 }
91 }
92 end }
93 ui.heading{ level = 3, content = _"You delegated this subject area" }
94 end
96 ui.tag { tag = "ul", attr = { class = "ul" }, content = function ()
97 if area.delegation_info.own_delegation_scope == "unit" then
98 ui.tag { tag = "li", content = function ()
99 ui.link {
100 module = "delegation", view = "show", params = {
101 unit_id = area.unit_id,
102 },
103 content = _("change/revoke delegation of organizational unit")
104 }
105 end }
106 end
108 if area.delegation_info.own_delegation_scope == nil then
109 ui.tag { tag = "li", content = function ()
110 ui.link {
111 module = "delegation", view = "show", params = {
112 area_id = area.id
113 },
114 content = _"choose subject area delegatee"
115 }
116 end }
117 elseif area.delegation_info.own_delegation_scope == "area" then
118 ui.tag { tag = "li", content = function ()
119 ui.link {
120 module = "delegation", view = "show", params = {
121 area_id = area.id
122 },
123 content = _"change/revoke area delegation"
124 }
125 end }
126 else
127 ui.tag { tag = "li", content = function ()
128 ui.link {
129 module = "delegation", view = "show", params = {
130 area_id = area.id
131 },
132 content = _"change/revoke delegation only for this subject area"
133 }
134 end }
135 end
136 end }
137 end )
142 if app.session.member:has_voting_right_for_unit_id ( area.unit_id ) then
143 ui.sidebarSection ( function ()
144 ui.heading {
145 level = 3,
146 content = _("I want to start a new initiative", {
147 area_name = area.name
148 } )
149 }
150 ui.tag { tag = "ul", attr = { class = "ul" }, content = function ()
151 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." }
152 ui.tag { tag = "li", content = function ()
153 ui.tag { content = function ()
154 ui.tag { content = _"If you cannot find any appropriate existing issue, " }
155 ui.link {
156 module = "initiative", view = "new",
157 params = { area_id = area.id },
158 text = _"start an initiative in a new issue"
159 }
160 end }
161 end }
162 end }
163 end )
164 end
165 else
166 end
168 end )

Impressum / About Us