liquid_feedback_frontend
diff app/main/registration_admin/verification_accredited.lua @ 1309:32cc544d5a5b
Cumulative patch for upcoming frontend version 4
author | bsw/jbe |
---|---|
date | Sun Jul 15 14:07:29 2018 +0200 (2018-07-15) |
parents | |
children | 7e328a78da93 |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/app/main/registration_admin/verification_accredited.lua Sun Jul 15 14:07:29 2018 +0200 1.3 @@ -0,0 +1,110 @@ 1.4 +local mode = param.get("mode") 1.5 + 1.6 +ui.title(function() 1.7 + ui.link { module = "registration_admin", view = "index", content = _"Usermanagement" } 1.8 + slot.put ( " ยป " ) 1.9 + ui.tag { tag = "span", content = "Accredited users"} 1.10 +end) 1.11 +app.html_title.title = _"Usermanagement" 1.12 + 1.13 +ui.container{ attr = { class = "mdl-grid" }, content = function() 1.14 + ui.container{ attr = { class = "mdl-cell mdl-cell--12-col" }, content = function() 1.15 + 1.16 + ui.container{ attr = { class = "mdl-card mdl-card__fullwidth mdl-shadow--2dp" }, content = function() 1.17 + ui.container{ attr = { class = "mdl-card__title mdl-card--border" }, content = function() 1.18 + ui.heading { attr = { class = "mdl-card__title-text" }, level = 2, content = function() 1.19 + ui.tag{ content = _"Accredited users" } 1.20 + end } 1.21 + end } 1.22 + 1.23 + ui.container{ attr = { class = "mdl-card__content mdl-card--border" }, content = function() 1.24 + 1.25 + local verifications_selector = Verification:new_selector() 1.26 + :join("member", nil, "member.id = verification.verified_member_id") 1.27 + :add_where("member.deleted ISNULL") 1.28 + 1.29 + if mode == "activated" then 1.30 + verifications_selector:add_where("member.activated NOTNULL") 1.31 + end 1.32 + 1.33 + if mode ~= "not_activated" then 1.34 + verifications_selector:add_order_by("member.identification") 1.35 + local verifications = verifications_selector:exec() 1.36 + 1.37 + if #verifications > 0 then 1.38 + ui.list{ 1.39 + records = verifications, 1.40 + columns = { 1.41 + { 1.42 + label = _"Name", 1.43 + content = function(record) 1.44 + ui.container{ content = function() 1.45 + local member = Member:by_id(record.verified_member_id) 1.46 + if member then 1.47 + ui.link{ module = "registration_admin", view = "verification", id = record.id, content = member.identification } 1.48 + end 1.49 + end } 1.50 + end 1.51 + }, 1.52 + --[[ 1.53 + { 1.54 + label = _"City", 1.55 + content = function(record) 1.56 + ui.container{ content = (record.verification_data or record.request_data).zip_code } 1.57 + ui.tag{ content = " " } 1.58 + ui.tag{ content = (record.verification_data or record.request_data).city } 1.59 + end 1.60 + }, 1.61 + --]] 1.62 + { 1.63 + label = _"Account", 1.64 + content = function(record) 1.65 + local member = Member:by_id(record.verified_member_id) 1.66 + if member and member.activated then 1.67 + ui.link{ module = "member", view = "show", id = record.verified_member_id, content = "ID " .. record.verified_member_id } 1.68 + else 1.69 + ui.tag{ content = "ID " } 1.70 + ui.tag{ content = record.verified_member_id } 1.71 + ui.tag{ content = ", " } 1.72 + ui.tag{ content = _"not activated (yet)" } 1.73 + 1.74 + end 1.75 + end 1.76 + }, 1.77 + { 1.78 + label = _"Verified at", 1.79 + content = function(record) 1.80 + ui.tag{ content = format.timestamp(record.verified) } 1.81 + end 1.82 + }, 1.83 + { 1.84 + label = _"Verified by", 1.85 + content = function(record) 1.86 + if record.verifying_member_id then 1.87 + local member = Member:by_id(record.verifying_member_id) 1.88 + ui.link{ module = "member", view = "show", id = member.id, content = member.identification or (member.id .. " " .. member.name) } 1.89 + local state = string.match(record.comment, "[^/]+$") 1.90 + slot.put(" ") 1.91 + ui.tag{ content = state } 1.92 + elseif record.verified then 1.93 + ui.tag{ content = _"SMS" } 1.94 + end 1.95 + 1.96 + end 1.97 + }, 1.98 + } 1.99 + } 1.100 + end 1.101 + elseif mode == "not_activated" then 1.102 + verifications_selector:add_where("member.activated ISNULL") 1.103 + :add_order_by("verification.id DESC") 1.104 + local verifications = verifications_selector:exec() 1.105 + execute.view{ module = "registration_admin", view = "_verification_list", params = { verifications = verifications } } 1.106 + end 1.107 + 1.108 + end } 1.109 + end } 1.110 + 1.111 + end } 1.112 +end } 1.113 +