liquid_feedback_frontend
view app/main/member/settings_applications.lua @ 1832:3f677f526f55
Show tree depth in unit parent selector
| author | bsw | 
|---|---|
| date | Thu Feb 03 12:42:29 2022 +0100 (2022-02-03) | 
| parents | afff8198bd98 | 
| children | 
 line source
     1 ui.titleMember(_"Connected applications")
     3 ui.grid{ content = function()
     4   ui.cell_main{ content = function()
     6     ui.container{ attr = { class = "mdl-card mdl-card__fullwidth mdl-shadow--2dp" }, content = function()
     7       ui.container{ attr = { class = "mdl-card__title mdl-card--border" }, content = function()
     8         ui.heading { attr = { class = "mdl-card__title-text" }, level = 2, content = _"Connected applications" }
     9       end }
    11       local applications = MemberApplication:by_member_id(app.session.member_id)
    13       if #applications == 0 then
    14         ui.container{ attr = { class = "mdl-card__content mdl-card--border" }, content = _"No applications connected" }
    16       end
    18       for i, application in ipairs(applications) do
    19         ui.container{ attr = { class = "mdl-card__content mdl-card--border" }, content = function()
    20           if application.system_application_id then
    21             ui.heading{ level = 2, content = application.system_application.name }
    22           else
    23             ui.heading{ level = 2, content = application.domain }
    24           end
    25           local scopes = {}
    26           for scope in string.gmatch(application.scope, "[^ ]+") do
    27             scopes[#scopes+1] = util.scope_name(scope)
    28           end
    29           local scopes_string = table.concat(scopes, ", ")
    30           ui.container{ content = scopes_string }
    31           ui.link{ content = _"Remove application", module = "member", action = "remove_application", id = application.id }
    32         end }
    33       end
    35     end }
    36   end }
    38   ui.cell_sidebar{ content = function()
    39     execute.view {
    40       module = "member", view = "_sidebar_whatcanido", params = {
    41         member = app.session.member
    42       }
    43     }
    44   end }
    46 end }
