liquid_feedback_frontend

view app/main/index/check_delegations.lua @ 1668:6d75df24e66e

Updated German translation
author bsw
date Sun Mar 07 09:52:36 2021 +0100 (2021-03-07)
parents 86a45c381bd9
children
line source
1 local delegations = Delegation:delegations_to_check_for_member_id(app.session.member_id)
3 ui.title(_"Current unit and area delegations need confirmation")
6 ui.grid{ content = function()
8 ui.cell_main{ content = function()
10 ui.container { attr = { class = "mdl-card mdl-shadow--2dp mdl-card__fullwidth" }, content = function()
11 ui.container{ attr = { class = "mdl-card__title mdl-card--border" }, content = function()
12 ui.heading { attr = { class = "mdl-card__title-text" }, level = 2, content = _("Current unit and area delegations need confirmation") }
13 end }
14 ui.container{ attr = { class = "mdl-card__content" }, content = function()
16 ui.form{
17 module = "index", action = "check_delegations",
18 routing = {
19 default = { mode = "redirect", module = "index", view = "index" },
20 error = { mode = "redirect", module = "index", view = "check_delegations" }
21 },
22 content = function()
24 ui.tag{
25 tag = "table", attr = {
26 class = "mdl-data-table mdl-js-data-table mdl-shadow--2dp"
27 },
28 content = function()
29 ui.tag{ tag = "tr", content = function()
31 ui.tag{
32 tag = "th", attr = {
33 class = "mdl-data-table__cell--non-numeric"
34 },
35 content = _"unit"
36 }
37 ui.tag{
38 tag = "th", attr = {
39 class = "mdl-data-table__cell--non-numeric"
40 },
41 content = _"area"
42 }
43 ui.tag{
44 tag = "th", attr = {
45 class = "mdl-data-table__cell--non-numeric"
46 },
47 content = _"delegated to"
48 }
49 ui.tag{
50 tag = "th", attr = {
51 class = "mdl-data-table__cell--non-numeric"
52 },
53 content = _"action"
54 }
55 end }
57 for i, delegation in ipairs(delegations) do
59 local unit = Unit:by_id(delegation.unit_id)
60 local area = Area:by_id(delegation.area_id)
61 local member = Member:by_id(delegation.trustee_id)
62 local info
63 if area then
64 area:load_delegation_info_once_for_member_id(app.session.member_id)
65 info = area.delegation_info
66 else
67 unit:load_delegation_info_once_for_member_id(app.session.member_id)
68 info = unit.delegation_info
69 end
71 ui.tag{ tag = "tr", content = function ()
73 ui.tag {
74 tag = "td",
75 attr = {
76 class = "mdl-data-table__cell--non-numeric"
77 },
78 content = delegation.unit_name
79 }
80 ui.tag {
81 tag = "td",
82 attr = {
83 class = "mdl-data-table__cell--non-numeric"
84 },
85 content = delegation.area_name
86 }
87 ui.tag {
88 tag = "td",
89 attr = {
90 class = "mdl-data-table__cell--non-numeric"
91 },
92 content = function()
93 if (member) then
94 local text = _"delegates to"
95 ui.image{
96 attr = { class = "delegation_arrow", alt = text, title = text },
97 static = "delegation_arrow_24_horizontal.png"
98 }
99 execute.view{ module = "member_image", view = "_show", params = {
100 member = member, class = "micro_avatar", popup_text = member.name,
101 image_type = "avatar", show_dummy = true,
102 } }
103 slot.put(" ")
104 ui.tag { tag = "span", content = delegation.member_name }
105 else
106 ui.tag{ tag = "span", content = _"Abandon unit delegation" }
107 end
108 end
109 }
111 ui.tag {
112 tag = "td",
113 attr = {
114 class = "mdl-data-table__cell--non-numeric"
115 },
116 content = function()
117 local checked = config.check_delegations_default
118 ui.tag{ tag = "input", attr = {
119 type = "radio",
120 id = "delegation_" .. delegation.id .. "_confirm",
121 name = "delegation_" .. delegation.id,
122 value = "confirm",
123 checked = checked == "confirm" and "checked" or nil
124 } }
125 ui.tag{
126 tag = "label",
127 attr = { ["for"] = "delegation_" .. delegation.id .. "_confirm" },
128 content = _"confirm"
129 }
130 ui.tag{ tag = "input", attr = {
131 type = "radio",
132 id = "delegation_" .. delegation.id .. "_revoke",
133 name = "delegation_" .. delegation.id,
134 value = "revoke",
135 checked = checked == "revoke" and "checked" or nil
136 } }
137 ui.tag{
138 tag = "label",
139 attr = { ["for"] = "delegation_" .. delegation.id .. "_revoke" },
140 content = _"revoke"
141 }
142 end
143 }
145 end }
147 end
149 end
150 }
153 slot.put("<br />")
155 ui.submit{
156 attr = { class = "mdl-button mdl-js-button mdl-button--raised mdl-button--colored" },
157 text = _"Finish delegation check"
158 }
159 if not app.session.needs_delegation_check then
160 slot.put(" &nbsp; ")
161 ui.link{
162 attr = { class = "mdl-button mdl-js-button" },
163 module = "index", view = "index", text = _"Cancel"
164 }
165 end
168 end
169 }
172 end }
173 end }
174 end }
176 end }

Impressum / About Us