liquid_feedback_frontend
view app/main/member/_settings_list.lua @ 1791:4edec387855f
Better handling of translation strings with links
| author | bsw | 
|---|---|
| date | Wed Oct 20 16:04:30 2021 +0200 (2021-10-20) | 
| parents | 32cc544d5a5b | 
| children | 
 line source
     3 ui.container { attr = { class = "mdl-card__content mdl-card--border" }, content = function ()
     4   ui.container{ content = _"I want to show or edit my profile" }
     5   ui.tag { tag = "ul", content = function()
     7     ui.tag{ tag = "li", content = function()
     8       ui.link{
     9         content = _"show my profile",
    10         module  = "member",
    11         view    = "show",
    12         id = app.session.member_id
    13       }
    14     end }
    15     ui.tag{ tag = "li", content = function()
    16       ui.link{
    17         content = _"edit my profile",
    18         module  = "member",
    19         view    = "edit",
    20         id = app.session.member_id
    21       }
    22     end }
    24   end }
    26 end }
    28 ui.container { attr = { class = "mdl-card__content mdl-card--border" }, content = function ()
    30   ui.container{ content = _"I want to change account settings" }
    32   ui.tag { tag = "ul", content = function()
    34     if not util.is_profile_field_locked(app.session.member, "login") and not app.session.member.role then
    35       ui.tag{ tag = "li", content = function()
    36         ui.link{
    37           content = _"change my login",
    38           module  = "member",
    39           view    = "settings_login",
    40         }
    41       end }
    42     end
    44     if not util.is_profile_field_locked(app.session.member, "password") and not app.session.member.role then
    45       ui.tag{ tag = "li", content = function()
    46         ui.link{
    47           content = _"change my password",
    48           module  = "member",
    49           view    = "settings_password",
    50         }
    51       end }
    52     end
    54     if not util.is_profile_field_locked(app.session.member, "name") then
    55       ui.tag{ tag = "li", content = function()
    56         ui.link{
    57           content = _"change my screen name",
    58           module  = "member",
    59           view    = "settings_name"
    60         }
    61       end }
    62     end
    64     ui.tag{ tag = "li", content = function()
    65       ui.link{
    66         content = _"change avatar/photo",
    67         module  = "member",
    68         view    = "edit_images",
    69       }
    70     end }
    72     ui.tag{ tag = "li", content = function()
    73       ui.link{
    74         content = _"notification settings",
    75         module  = "member",
    76         view    = "settings_notification",
    77       }
    78     end }
    79     if not util.is_profile_field_locked(app.session.member, "notify_email") then
    80       ui.tag{ tag = "li", content = function()
    81         ui.link{
    82           content = _"notification email address",
    83           module  = "member",
    84           view    = "settings_email",
    85         }
    86       end }
    87     end
    89     if app.session.member.role then
    90       ui.tag{ tag = "li", content = function()
    91         ui.link{
    92           content = _"agents",
    93           module  = "member",
    94           view    = "settings_agent",
    95         }
    96       end }
    97     end
    99     if config.role_registration and not app.session.member.role then
   100       ui.tag{ tag = "li", content = function()
   101         ui.link{
   102           content = _"request role account",
   103           module  = "role",
   104           view    = "request",
   105         }
   106       end }
   107     end
   109     if config.oauth2 then
   110       ui.tag{ tag = "li", content = function()
   111         ui.link{
   112           content = _"connected applications",
   113           module  = "member",
   114           view    = "settings_applications",
   115         }
   116       end }
   117     end
   119     if config.download_dir then
   120       ui.tag{ tag = "li", content = function()
   121         ui.link{
   122           content = _"database download",
   123           module  = "index",
   124           view    = "download",
   125         }
   126       end }
   127     end
   129   end }
   131 end }
   133 ui.container { attr = { class = "mdl-card__content mdl-card--border" }, content = function ()
   135   ui.container{ content = _"Logout" }
   137   ui.tag { tag = "ul", content = function()
   138     ui.tag{ tag = "li", content = function()
   139       ui.link{
   140         text   = _"logout",
   141         module = 'index',
   142         action = 'logout',
   143         routing = {
   144           default = {
   145             mode = "redirect",
   146             module = "index",
   147             view = "index"
   148           }
   149         }
   150       }
   151     end }
   153   end }
   155 end }
