liquid_feedback_frontend

view app/main/index/_head.lua @ 1600:d47d2b0cd7c2

Removed debug code
author bsw
date Sun Jan 31 22:12:27 2021 +0100 (2021-01-31)
parents 6b203b43bef3
children a3a7120a67be
line source
1 local unit_id = config.single_unit_id or request.get_param{ name = "unit" }
2 local area_id = config.single_area_id or request.get_param{ name = "area" }
3 if unit_id == "all" then
4 unit_id = nil
5 area_id = nil
6 end
7 local unit
8 if unit_id then
9 unit = Unit:by_id(unit_id)
10 end
11 if area_id == "all" then
12 area_id = nil
13 end
14 local area
15 if area_id then
16 area = Area:by_id(area_id)
17 end
19 if unit then
20 ui.container{ attr = { class = "mdl-card mdl-card__fullwidth mdl-shadow--2dp" }, content = function()
21 ui.container{ attr = { class = "mdl-card__title mdl-card--border" }, content = function()
22 ui.heading { attr = { class = "mdl-card__title-text" }, level = 2, content = unit.name }
23 if unit.description and #(unit.description) > 0 then
24 ui.container{ attr = { class = "mdl-card__subtitle-text" }, content = unit.description }
25 end
26 if config.render_external_reference_unit then
27 config.render_external_reference_unit(unit)
28 end
29 end }
32 if not (config.voting_only and config.disable_delegations) and app.session.member_id then
33 ui.container{ attr = { class = "mdl-card__actions" }, content = function()
35 unit:load_delegation_info_once_for_member_id(app.session.member_id)
37 local text
38 if unit.delegation_info.own_delegation_scope == "unit" then
39 local member = Member:by_id(unit.delegation_info.first_trustee_id)
40 ui.tag{ tag = "i", attr = { class = "material-icons" }, content = "forward" }
41 execute.view{
42 module = "member",
43 view = "_show_thumb",
44 params = {
45 member = member
46 }
47 }
48 text = _"change delegation..."
49 else
50 text = _"delegate..."
51 end
53 ui.link {
54 attr = { class = "mdl-button mdl-js-button mdl-js-ripple-effect mdl-button--underlined" },
55 module = "delegation", view = "show", params = {
56 unit_id = unit.id,
57 },
58 content = text
59 }
61 end }
62 end
63 end }
64 end
66 if area then
68 ui.container{ attr = { class = "mdl-card mdl-card__fullwidth mdl-shadow--2dp" }, content = function()
69 if unit then
70 ui.container{ attr = { class = "mdl-card__title mdl-card--border" }, content = function()
71 ui.heading { attr = { class = "mdl-card__title-text" }, level = 2, content = area.name }
72 if area.description and #(area.description) > 0 then
73 ui.container{ attr = { class = "mdl-card__subtitle-text" }, content = area.description }
74 end
75 end }
76 end
77 if not (config.voting_only and config.disable_delegations) and app.session.member_id then
78 ui.container{ attr = { class = "mdl-card__actions" }, content = function()
80 area:load_delegation_info_once_for_member_id(app.session.member_id)
82 local text
83 if area.delegation_info.own_delegation_scope == "area" then
84 local member = Member:by_id(area.delegation_info.first_trustee_id)
85 ui.tag{ tag = "i", attr = { class = "material-icons" }, content = "forward" }
86 execute.view{
87 module = "member",
88 view = "_show_thumb",
89 params = {
90 member = member
91 }
92 }
93 text = _"change delegation..."
94 else
95 text = _"delegate..."
96 end
98 ui.link {
99 attr = { class = "mdl-button mdl-js-button mdl-js-ripple-effect mdl-button--underlined" },
100 module = "delegation", view = "show", params = {
101 area_id = area.id,
102 },
103 content = text
104 }
106 if not config.voting_only and app.session.member_id and app.session.member:has_initiative_right_for_unit_id ( area.unit_id ) then
107 ui.link {
108 attr = { class = "mdl-button mdl-js-button mdl-js-ripple-effect mdl-button--underlined" },
109 module = "draft", view = "new",
110 params = { area_id = area.id },
111 content = function()
112 ui.tag{ tag = "i", attr = { class = "material-icons" }, content = "add" }
113 ui.tag{ content = _"new issue" }
114 end
115 }
116 end
117 end }
118 end
119 end }
120 end

Impressum / About Us