liquid_feedback_frontend
diff app/main/agent/show.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/agent/show.lua Sun Jul 15 14:07:29 2018 +0200 1.3 @@ -0,0 +1,100 @@ 1.4 +local controlled_id = param.get("controlled_id") 1.5 + 1.6 + 1.7 +ui.titleMember(_"Account access") 1.8 + 1.9 +ui.grid{ content = function() 1.10 + 1.11 + ui.cell_main{ content = function() 1.12 + ui.container{ attr = { class = "mdl-card mdl-card__fullwidth mdl-shadow--2dp" }, content = function() 1.13 + ui.container{ attr = { class = "mdl-card__title mdl-card--border" }, content = function() 1.14 + ui.heading { attr = { class = "mdl-card__title-text" }, level = 2, content = _"Account access" } 1.15 + end } 1.16 + ui.container{ attr = { class = "mdl-card__content mdl-card--border" }, content = function() 1.17 + 1.18 + local agent = Agent:new_selector() 1.19 + :add_where{ "controller_id = ?", app.session.member_id } 1.20 + :add_where{ "controlled_id = ?", controlled_id } 1.21 + :optional_object_mode() 1.22 + :exec() 1.23 + 1.24 + if agent then 1.25 + 1.26 + if agent.accepted == nil then 1.27 + ui.container{ content = _"You have been granted access privileges for the following account:" } 1.28 + elseif agent.accepted == true then 1.29 + ui.container{ content = _"You have accepted access privileges for the following account:" } 1.30 + elseif agent.accepted == false then 1.31 + ui.container{ content = _"You have rejected access privileges for the following account:" } 1.32 + end 1.33 + 1.34 + slot.put("<br>") 1.35 + ui.link{ 1.36 + content = agent.controllee.display_name, 1.37 + module = "member", view = "show", id = agent.controlled_id 1.38 + } 1.39 + slot.put("<br><br>") 1.40 + 1.41 + ui.form{ 1.42 + attr = { class = "wide" }, 1.43 + module = "agent", 1.44 + action = "accept", 1.45 + params = { controlled_id = controlled_id }, 1.46 + routing = { 1.47 + ok = { 1.48 + mode = "redirect", 1.49 + module = "agent", 1.50 + view = "show", 1.51 + params = { controlled_id = controlled_id }, 1.52 + } 1.53 + }, 1.54 + content = function() 1.55 + 1.56 + if agent.accepted == nil then 1.57 + ui.tag{ 1.58 + tag = "input", 1.59 + attr = { 1.60 + type = "submit", 1.61 + class = "mdl-button mdl-js-button mdl-button--raised mdl-button--colored", 1.62 + value = _"Accept access privilege", 1.63 + name = "accepted" 1.64 + }, 1.65 + content = "" 1.66 + } 1.67 + slot.put(" ") 1.68 + ui.tag{ 1.69 + tag = "input", 1.70 + attr = { 1.71 + type = "submit", 1.72 + class = "mdl-button mdl-js-button mdl-button--raised", 1.73 + value = _"Reject access privilege", 1.74 + name = "rejected" 1.75 + }, 1.76 + content = "" 1.77 + } 1.78 + end 1.79 + slot.put(" ") 1.80 + ui.link { 1.81 + attr = { class = "mdl-button mdl-js-button" }, 1.82 + module = "index", view = "index", 1.83 + content = _"Cancel" 1.84 + } 1.85 + end 1.86 + } 1.87 + 1.88 + end 1.89 + 1.90 + end } 1.91 + end } 1.92 + end } 1.93 + 1.94 + ui.cell_sidebar{ content = function() 1.95 + execute.view { 1.96 + module = "member", view = "_sidebar_whatcanido", params = { 1.97 + member = app.session.member 1.98 + } 1.99 + } 1.100 + end } 1.101 + 1.102 +end } 1.103 +