liquid_feedback_frontend
diff app/main/member/settings.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 |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/app/main/member/settings.lua Sun Jul 15 14:07:29 2018 +0200 1.3 @@ -0,0 +1,55 @@ 1.4 +execute.view{ module = "index", view = "_lang_chooser" } 1.5 + 1.6 +ui.grid{ content = function() 1.7 + ui.cell_main{ content = function() 1.8 + 1.9 + ui.container{ attr = { class = "mdl-card mdl-card__fullwidth mdl-shadow--2dp" }, content = function() 1.10 + ui.container{ attr = { class = "mdl-card__title mdl-card--border" }, content = function() 1.11 + ui.heading { attr = { class = "mdl-card__title-text" }, level = 2, content = _"Settings" } 1.12 + end } 1.13 + ui.container{ attr = { class = "mdl-card__content mdl-card--border" }, content = function() 1.14 + 1.15 + local agents = Agent:new_selector() 1.16 + :add_where{ "controller_id = ?", app.session.member_id } 1.17 + :add_where{ "accepted ISNULL" } 1.18 + :exec() 1.19 + 1.20 + if #agents > 0 then 1.21 + ui.container { attr = { class = "mdl-card__content mdl-card--border" }, content = function () 1.22 + ui.container{ content = _"You have been granted access to the following account(s):" } 1.23 + for i, agent in ipairs(agents) do 1.24 + local member = Member:by_id(agent.controlled_id) 1.25 + ui.tag { tag = "ul", content = function() 1.26 + ui.tag{ tag = "li", content = function() 1.27 + ui.link{ 1.28 + module = "agent", view = "show", params = { controlled_id = agent.controlled_id }, 1.29 + content= _("Account access invitation from '#{member_name}'", { member_name = member.name }) 1.30 + } 1.31 + end } 1.32 + end } 1.33 + end 1.34 + end } 1.35 + end 1.36 + 1.37 + 1.38 + local controlled_members_count = Member:new_selector() 1.39 + :join("agent", nil, "agent.controlled_id = member.id") 1.40 + :add_where("agent.accepted") 1.41 + :add_where("NOT member.locked") 1.42 + :add_where{ "agent.controller_id = ?", app.session.member_id } 1.43 + :count() 1.44 + if controlled_members_count > 0 or app.session.real_member_id then 1.45 + ui.container { attr = { class = "mdl-card__content mdl-card--border" }, content = function () 1.46 + ui.container{ content = _"I want to switch to another account" } 1.47 + ui.tag { tag = "ul", content = function() 1.48 + execute.view{ module = "member", view = "_agent_menu" } 1.49 + end } 1.50 + end } 1.51 + end 1.52 + 1.53 + execute.view{ module = "member", view = "_settings_list" } 1.54 + 1.55 + end } 1.56 + end } 1.57 + end } 1.58 +end }