liquid_feedback_frontend
diff app/main/registration_admin/role_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/role_verification_accredited.lua Sun Jul 15 14:07:29 2018 +0200 1.3 @@ -0,0 +1,86 @@ 1.4 +local mode = param.get("mode") 1.5 + 1.6 +ui.title(function() 1.7 + ui.link { module = "registration_admin", view = "index", content = _"Rolemanagement" } 1.8 + slot.put ( " ยป " ) 1.9 + ui.tag { tag = "span", content = "Accredited role accounts"} 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 role accounts" } 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 = RoleVerification:new_selector() 1.26 + :join("member", nil, "member.id = role_verification.verified_member_id") 1.27 + :add_where("member.deleted ISNULL") 1.28 + :add_order_by("member.identification") 1.29 + 1.30 + if mode == "activated" then 1.31 + verifications_selector:add_where("member.activated NOTNULL") 1.32 + elseif mode == "not_activated" then 1.33 + verifications_selector:add_where("member.activated ISNULL") 1.34 + end 1.35 + 1.36 + local verifications = verifications_selector:exec() 1.37 + 1.38 + if #verifications > 0 then 1.39 + ui.list{ 1.40 + records = verifications, 1.41 + columns = { 1.42 + { 1.43 + label = _"Identification", 1.44 + content = function(record) 1.45 + ui.container{ content = function() 1.46 + local member = Member:by_id(record.verified_member_id) 1.47 + if member then 1.48 + ui.link{ module = "registration_admin", view = "role_verification", id = record.id, content = member.identification } 1.49 + end 1.50 + end } 1.51 + end 1.52 + }, 1.53 + { 1.54 + label = _"Account", 1.55 + content = function(record) 1.56 + local member = Member:by_id(record.verified_member_id) 1.57 + if member and member.activated then 1.58 + ui.link{ module = "member", view = "show", id = record.verified_member_id, content = "ID " .. record.verified_member_id } 1.59 + else 1.60 + ui.tag{ content = "ID " } 1.61 + ui.tag{ content = record.verified_member_id } 1.62 + ui.tag{ content = ", " } 1.63 + ui.tag{ content = _"not activated (yet)" } 1.64 + 1.65 + end 1.66 + end 1.67 + }, 1.68 + { 1.69 + label = _"Verified at", 1.70 + content = function(record) 1.71 + ui.tag{ content = format.timestamp(record.verified) } 1.72 + end 1.73 + }, 1.74 + { 1.75 + label = _"Verified by", 1.76 + content = function(record) 1.77 + local member = Member:by_id(record.verifying_member_id) 1.78 + ui.link{ module = "member", view = "show", id = member.id, content = member.identification or (member.id .. " " .. member.name) } 1.79 + end 1.80 + }, 1.81 + } 1.82 + } 1.83 + end 1.84 + end } 1.85 + end } 1.86 + 1.87 + end } 1.88 +end } 1.89 +