liquid_feedback_frontend

view app/main/area/_head.lua @ 815:3378ea16007f

Fixed public access to member home page
author bsw
date Fri Jul 06 14:02:05 2012 +0200 (2012-07-06)
parents 7878f3c20a86
children 701a5cf6b067
line source
1 local area = param.get("area", "table")
2 local member = param.get("member", "table")
4 local show_content = param.get("show_content", atom.boolean)
6 if app.session.member_id then
7 area:load_delegation_info_once_for_member_id(app.session.member_id)
8 end
10 if not param.get("hide_unit", atom.boolean) then
11 execute.view{ module = "unit", view = "_head", params = { unit = area.unit, member = member } }
12 end
14 ui.container{ attr = { class = "area_head" }, content = function()
16 execute.view{ module = "delegation", view = "_info", params = { area = area, member = member } }
18 ui.container{ attr = { class = "title" }, content = function()
19 -- area name
20 ui.link{
21 module = "area", view = "show", id = area.id,
22 attr = { class = "area_name" }, content = area.name
23 }
24 end }
26 if show_content then
28 ui.container{ attr = { class = "content" }, content = function()
30 -- actions (members with appropriate voting right only)
31 if member then
33 -- membership
34 local membership = Membership:by_pk(area.id, member.id)
36 if membership then
38 if app.session.member_id == member.id then
39 ui.tag{ content = _"You are participating in this area" }
40 slot.put(" ")
41 ui.tag{ content = function()
42 slot.put("(")
43 ui.link{
44 text = _"Withdraw",
45 module = "membership",
46 action = "update",
47 params = { area_id = area.id, delete = true },
48 routing = {
49 default = {
50 mode = "redirect",
51 module = request.get_module(),
52 view = request.get_view(),
53 id = param.get_id_cgi(),
54 params = param.get_all_cgi()
55 }
56 }
57 }
58 slot.put(")")
59 end }
60 else
61 ui.tag{ content = _"Member is participating in this area" }
62 end
64 elseif app.session.member_id == member.id and member:has_voting_right_for_unit_id(area.unit_id) then
65 ui.link{
66 text = _"Participate in this area",
67 module = "membership",
68 action = "update",
69 params = { area_id = area.id },
70 routing = {
71 default = {
72 mode = "redirect",
73 module = request.get_module(),
74 view = request.get_view(),
75 id = param.get_id_cgi(),
76 params = param.get_all_cgi()
77 }
78 }
79 }
80 end
82 if app.session.member_id == member.id and app.session.member:has_voting_right_for_unit_id(area.unit_id) then
84 slot.put(" · ")
85 if area.delegation_info.own_delegation_scope ~= "area" then
86 ui.link{ text = _"Delegate area", module = "delegation", view = "show", params = { area_id = area.id } }
87 else
88 ui.link{ text = _"Change area delegation", module = "delegation", view = "show", params = { area_id = area.id } }
89 end
90 slot.put(" · ")
92 ui.link{
93 content = function()
94 slot.put(_"Create new issue")
95 end,
96 module = "initiative",
97 view = "new",
98 params = { area_id = area.id }
99 }
100 end
102 end
104 end }
106 else
107 slot.put("<br />")
108 end
110 end }

Impressum / About Us