rev |
line source |
bsw@1045
|
1 local unit = param.get ( "unit", "table" )
|
bsw@1045
|
2
|
bsw@1045
|
3 ui.sidebar ( "tab-whatcanido", function ()
|
bsw@1045
|
4
|
bsw@1045
|
5 ui.sidebarHeadWhatCanIDo()
|
bsw@1045
|
6
|
bsw@1045
|
7 if app.session.member then
|
bsw@1045
|
8
|
bsw@1045
|
9 if app.session.member:has_voting_right_for_unit_id ( unit.id ) then
|
bsw@1045
|
10 ui.sidebarSection( function ()
|
bsw@1045
|
11
|
bsw@1045
|
12 if not unit.delegation_info.first_trustee_id then
|
bsw@1045
|
13 ui.heading{ level = 3, content = _"I want to delegate this organizational unit" }
|
bsw@1045
|
14 ui.tag { tag = "ul", attr = { class = "ul" }, content = function ()
|
bsw@1045
|
15 ui.tag { tag = "li", content = function ()
|
bsw@1045
|
16 ui.link {
|
bsw@1045
|
17 module = "delegation", view = "show", params = {
|
bsw@1045
|
18 unit_id = unit.id,
|
bsw@1045
|
19 },
|
bsw@1045
|
20 content = _("choose delegatee", {
|
bsw@1045
|
21 unit_name = unit.name
|
bsw@1045
|
22 })
|
bsw@1045
|
23 }
|
bsw@1045
|
24 end }
|
bsw@1045
|
25 end }
|
bsw@1045
|
26 else
|
bsw@1045
|
27 ui.container { attr = { class = "right" }, content = function()
|
bsw@1045
|
28 local member = Member:by_id(unit.delegation_info.first_trustee_id)
|
bsw@1045
|
29 execute.view{
|
bsw@1045
|
30 module = "member_image",
|
bsw@1045
|
31 view = "_show",
|
bsw@1045
|
32 params = {
|
bsw@1045
|
33 member = member,
|
bsw@1045
|
34 image_type = "avatar",
|
bsw@1045
|
35 show_dummy = true
|
bsw@1045
|
36 }
|
bsw@1045
|
37 }
|
bsw@1045
|
38 end }
|
bsw@1045
|
39 ui.heading{ level = 3, content = _"You delegated this unit" }
|
bsw@1045
|
40
|
bsw@1045
|
41 ui.tag { tag = "ul", attr = { class = "ul" }, content = function ()
|
bsw@1045
|
42 ui.tag { tag = "li", content = function ()
|
bsw@1045
|
43 ui.link {
|
bsw@1045
|
44 module = "delegation", view = "show", params = {
|
bsw@1045
|
45 unit_id = unit.id,
|
bsw@1045
|
46 },
|
bsw@1045
|
47 content = _("change/revoke delegation", {
|
bsw@1045
|
48 unit_name = unit.name
|
bsw@1045
|
49 })
|
bsw@1045
|
50 }
|
bsw@1045
|
51 end }
|
bsw@1045
|
52 end }
|
bsw@1045
|
53 end
|
bsw@1045
|
54 end )
|
bsw@1045
|
55
|
bsw@1045
|
56 ui.sidebarSection( function()
|
bsw@1045
|
57 ui.heading { level = 3, content = _"I want to start a new initiative" }
|
bsw@1045
|
58 ui.tag { tag = "ul", attr = { class = "ul" }, content = function ()
|
bsw@1045
|
59 ui.tag { tag = "li", content = _"Open the appropriate subject area where your issue fits in and follow the instruction on that page." }
|
bsw@1045
|
60 end }
|
bsw@1045
|
61 end )
|
bsw@1045
|
62
|
bsw@1045
|
63 else
|
bsw@1045
|
64 ui.sidebarSection( _"You are not entitled to vote in this unit" )
|
bsw@1045
|
65 end
|
bsw@1045
|
66
|
bsw@1045
|
67 end
|
bsw@1045
|
68
|
bsw@1045
|
69 end ) |