annotate app/main/member/settings_applications.lua @ 1419:e1a565a051d8
No whitespace before photo in profile
author |
bsw |
date |
Thu Aug 30 10:46:36 2018 +0200 (2018-08-30) |
parents |
32cc544d5a5b |
children |
afff8198bd98 |
rev |
line source |
bsw/jbe@1309
|
1 ui.titleMember(_"Connected applications")
|
bsw/jbe@1309
|
2
|
bsw/jbe@1309
|
3 ui.grid{ content = function()
|
bsw/jbe@1309
|
4 ui.cell_main{ content = function()
|
bsw/jbe@1309
|
5
|
bsw/jbe@1309
|
6 ui.container{ attr = { class = "mdl-card mdl-card__fullwidth mdl-shadow--2dp" }, content = function()
|
bsw/jbe@1309
|
7 ui.container{ attr = { class = "mdl-card__title mdl-card--border" }, content = function()
|
bsw/jbe@1309
|
8 ui.heading { attr = { class = "mdl-card__title-text" }, level = 2, content = _"Connected applications" }
|
bsw/jbe@1309
|
9 end }
|
bsw/jbe@1309
|
10
|
bsw/jbe@1309
|
11 local applications = MemberApplication:by_member_id(app.session.member_id)
|
bsw/jbe@1309
|
12
|
bsw/jbe@1309
|
13 for i, application in ipairs(applications) do
|
bsw/jbe@1309
|
14 ui.container{ attr = { class = "mdl-card__content mdl-card--border" }, content = function()
|
bsw/jbe@1309
|
15 if application.system_application_id then
|
bsw/jbe@1309
|
16 ui.heading{ level = 2, content = application.system_application.name }
|
bsw/jbe@1309
|
17 else
|
bsw/jbe@1309
|
18 ui.heading{ level = 2, content = application.domain }
|
bsw/jbe@1309
|
19 end
|
bsw/jbe@1309
|
20 local scopes = {}
|
bsw/jbe@1309
|
21 for scope in string.gmatch(application.scope, "[^ ]+") do
|
bsw/jbe@1309
|
22 scopes[#scopes+1] = util.scope_name(scope)
|
bsw/jbe@1309
|
23 end
|
bsw/jbe@1309
|
24 local scopes_string = table.concat(scopes, ", ")
|
bsw/jbe@1309
|
25 ui.container{ content = scopes_string }
|
bsw/jbe@1309
|
26 ui.link{ content = _"Remove application", module = "member", action = "remove_application", id = application.id }
|
bsw/jbe@1309
|
27 end }
|
bsw/jbe@1309
|
28 end
|
bsw/jbe@1309
|
29
|
bsw/jbe@1309
|
30 end }
|
bsw/jbe@1309
|
31 end }
|
bsw/jbe@1309
|
32
|
bsw/jbe@1309
|
33 ui.cell_sidebar{ content = function()
|
bsw/jbe@1309
|
34 execute.view {
|
bsw/jbe@1309
|
35 module = "member", view = "_sidebar_whatcanido", params = {
|
bsw/jbe@1309
|
36 member = app.session.member
|
bsw/jbe@1309
|
37 }
|
bsw/jbe@1309
|
38 }
|
bsw/jbe@1309
|
39 end }
|
bsw/jbe@1309
|
40
|
bsw/jbe@1309
|
41 end }
|