liquid_feedback_frontend

view app/main/registration_admin/verification_accredited.lua @ 1858:3d1f0464a3ea

Handle missing ldap.member.allowed function
author bsw
date Tue Sep 20 17:35:29 2022 +0200 (20 months ago)
parents 899fdfb23465
children
line source
1 local mode = param.get("mode")
3 ui.title(function()
4 ui.link { module = "registration_admin", view = "index", content = _"User management" }
5 slot.put ( " ยป " )
6 ui.tag { tag = "span", content = "Accredited users"}
7 end)
8 app.html_title.title = _"User management"
10 ui.container{ attr = { class = "mdl-grid" }, content = function()
11 ui.container{ attr = { class = "mdl-cell mdl-cell--12-col" }, content = function()
13 ui.container{ attr = { class = "mdl-card mdl-card__fullwidth mdl-shadow--2dp" }, content = function()
14 ui.container{ attr = { class = "mdl-card__title mdl-card--border" }, content = function()
15 ui.heading { attr = { class = "mdl-card__title-text" }, level = 2, content = function()
16 ui.tag{ content = _"Accredited users" }
17 end }
18 end }
20 ui.container{ attr = { class = "mdl-card__content mdl-card--border" }, content = function()
22 local verifications_selector = Verification:new_selector()
23 :join("member", nil, "member.id = verification.verified_member_id")
24 :add_where("member.deleted ISNULL")
26 if mode == "activated" then
27 verifications_selector:add_where("member.activated NOTNULL")
28 end
30 if mode ~= "not_activated" then
31 verifications_selector:add_order_by("member.identification")
32 local verifications = verifications_selector:exec()
34 if #verifications > 0 then
35 ui.list{
36 records = verifications,
37 columns = {
38 {
39 label = _"Name",
40 content = function(record)
41 ui.container{ content = function()
42 local member = Member:by_id(record.verified_member_id)
43 if member then
44 ui.link{ module = "registration_admin", view = "verification", id = record.id, content = member.identification or "[no ident]" }
45 end
46 end }
47 end
48 },
49 --[[
50 {
51 label = _"City",
52 content = function(record)
53 ui.container{ content = (record.verification_data or record.request_data).zip_code }
54 ui.tag{ content = " " }
55 ui.tag{ content = (record.verification_data or record.request_data).city }
56 end
57 },
58 --]]
59 {
60 label = _"Account",
61 content = function(record)
62 local member = Member:by_id(record.verified_member_id)
63 if member and member.activated then
64 ui.link{ module = "member", view = "show", id = record.verified_member_id, content = "ID " .. record.verified_member_id }
65 else
66 ui.tag{ content = "ID " }
67 ui.tag{ content = record.verified_member_id }
68 ui.tag{ content = ", " }
69 ui.tag{ content = _"not activated (yet)" }
71 end
72 end
73 },
74 {
75 label = _"Verified at",
76 content = function(record)
77 ui.tag{ content = format.timestamp(record.verified) }
78 end
79 },
80 {
81 label = _"Verified by",
82 content = function(record)
83 if record.verifying_member_id then
84 local member = Member:by_id(record.verifying_member_id)
85 ui.link{ module = "member", view = "show", id = member.id, content = member.identification or (member.id .. " " .. member.name) }
86 local state = string.match(record.comment, "[^/]+$")
87 slot.put(" ")
88 ui.tag{ content = state }
89 elseif record.verified then
90 ui.tag{ content = _"automatically verified" }
91 end
93 end
94 },
95 }
96 }
97 end
98 elseif mode == "not_activated" then
99 verifications_selector:add_where("member.activated ISNULL")
100 :add_order_by("verification.id DESC")
101 local verifications = verifications_selector:exec()
102 execute.view{ module = "registration_admin", view = "_verification_list", params = { verifications = verifications } }
103 end
105 end }
106 end }
108 end }
109 end }

Impressum / About Us