liquid_feedback_frontend
view app/main/member/_sidebar_whatcanido.lua @ 1772:a6aa58ffccec
Fixed capitalization
| author | bsw | 
|---|---|
| date | Mon Oct 18 16:05:43 2021 +0200 (2021-10-18) | 
| parents | 32cc544d5a5b | 
| children | 
 line source
     1 local member = param.get("member", "table")
     3 ui.container{ attr = { class = "mdl-card mdl-card__fullwidth mdl-shadow--2dp" }, content = function()
     4   ui.container{ attr = { class = "mdl-card__title mdl-card--border" }, content = function()
     5     ui.heading { attr = { class = "mdl-card__title-text" }, level = 2, content = _"What can I do here?" }
     6   end }
     7   ui.container{ attr = { class = "what-can-i-do-here" }, content = function()
    10     if not member.active then
    11       ui.container { attr = { class = "mdl-card__content mdl-card--border" }, content = function ()
    12         slot.put(" · ")
    13         ui.tag{
    14           attr = { class = "interest deactivated_member_info" },
    15           content = _"This member is inactive"
    16         }
    17       end }   
    18     end
    20     if member.locked then
    21       ui.container { attr = { class = "mdl-card__content mdl-card--border" }, content = function ()
    22         slot.put(" · ")
    23         ui.tag{
    24           attr = { class = "interest deactivated_member_info" },
    25           content = _"This member is locked"
    26         }
    27       end }   
    28     end
    30     if app.session.member_id == member.id then
    31       execute.view{ module = "member", view = "_settings_list" }
    32     end
    34     if app.session.member_id and not (member.id == app.session.member.id) then
    36       ui.container { attr = { class = "mdl-card__content mdl-card--border" }, content = function ()
    38         local contact = Contact:by_pk(app.session.member.id, member.id)
    39         if not contact then
    40           ui.tag{ content = _"I want to save this member as contact (i.e. to use as delegatee)" }
    41           ui.tag { tag = "ul", attr = { class = "ul" }, content = function ()
    42             ui.tag { tag = "li", content = function ()
    43               ui.link{
    44                 text    = _"add to my list of public contacts",
    45                 module  = "contact",
    46                 action  = "add_member",
    47                 id      = member.id,
    48                 params = { public = true },
    49                 routing = {
    50                   default = {
    51                     mode = "redirect",
    52                     module = request.get_module(),
    53                     view = request.get_view(),
    54                     id = request.get_id_string(),
    55                     params = request.get_param_strings()
    56                   }
    57                 }
    58               }
    59             end }
    60             ui.tag { tag = "li", content = function ()
    61               ui.link{
    62                 text    = _"add to my list of private contacts",
    63                 module  = "contact",
    64                 action  = "add_member",
    65                 id      = member.id,
    66                 routing = {
    67                   default = {
    68                     mode = "redirect",
    69                     module = request.get_module(),
    70                     view = request.get_view(),
    71                     id = request.get_id_string(),
    72                     params = request.get_param_strings()
    73                   }
    74                 }
    75               }
    76             end }
    77           end }
    78         elseif contact.public then
    79           ui.tag{ content = _"You saved this member as contact (i.e. to use as delegatee) and others can see it" }
    80           ui.tag { tag = "ul", attr = { class = "ul" }, content = function ()
    81             ui.tag { tag = "li", content = function ()
    82               ui.link{
    83                 text   = _"make this contact private",
    84                 module = "contact",
    85                 action = "add_member",
    86                 id     = contact.other_member_id,
    87                 params = { public = false },
    88                 routing = {
    89                   default = {
    90                     mode = "redirect",
    91                     module = request.get_module(),
    92                     view = request.get_view(),
    93                     id = request.get_id_string(),
    94                     params = request.get_param_strings()
    95                   }
    96                 }
    97               }
    98             end }
    99             ui.tag { tag = "li", content = function ()
   100               ui.link{
   101                 text   = _"remove from my contact list",
   102                 module = "contact",
   103                 action = "remove_member",
   104                 id     = contact.other_member_id,
   105                 routing = {
   106                   default = {
   107                     mode = "redirect",
   108                     module = request.get_module(),
   109                     view = request.get_view(),
   110                     id = request.get_id_string(),
   111                     params = request.get_param_strings()
   112                   }
   113                 }
   114               }
   115             end }
   116           end }
   117         else
   118           ui.tag{ content = _"You saved this member as contact (i.e. to use as delegatee)" }
   119           ui.tag { tag = "ul", attr = { class = "ul" }, content = function ()
   120             ui.tag { tag = "li", content = function ()
   121               ui.link{
   122                 text   = _"make this contact public",
   123                 module = "contact",
   124                 action = "add_member",
   125                 id     = contact.other_member_id,
   126                 params = { public = true },
   127                 routing = {
   128                   default = {
   129                     mode = "redirect",
   130                     module = request.get_module(),
   131                     view = request.get_view(),
   132                     id = request.get_id_string(),
   133                     params = request.get_param_strings()
   134                   }
   135                 }
   136               }
   137             end }
   138             ui.tag { tag = "li", content = function ()
   139               ui.link{
   140                 text   = _"remove from my contact list",
   141                 module = "contact",
   142                 action = "remove_member",
   143                 id     = contact.other_member_id,
   144                 routing = {
   145                   default = {
   146                     mode = "redirect",
   147                     module = request.get_module(),
   148                     view = request.get_view(),
   149                     id = request.get_id_string(),
   150                     params = request.get_param_strings()
   151                   }
   152                 }
   153               }
   154             end }
   155           end }
   156         end
   157       end }
   159       ui.container { attr = { class = "mdl-card__content mdl-card--border" }, content = function ()
   160         local ignored_member = IgnoredMember:by_pk(app.session.member.id, member.id)
   161         if not ignored_member then
   162           ui.tag{ content = _"I do not like to hear from this member" }
   163           ui.tag { tag = "ul", attr = { class = "ul" }, content = function ()
   164             ui.tag { tag = "li", content = function ()
   165               ui.link{
   166                 attr = { class = "interest" },
   167                 text    = _"block this member",
   168                 module  = "member",
   169                 action  = "update_ignore_member",
   170                 id      = member.id,
   171                 routing = {
   172                   default = {
   173                     mode = "redirect",
   174                     module = request.get_module(),
   175                     view = request.get_view(),
   176                     id = request.get_id_string(),
   177                     params = request.get_param_strings()
   178                   }
   179                 }
   180               }
   181             end }
   182           end }
   183         else
   184           ui.tag{ content = _"You blocked this member (i.e. you will not be notified about this members actions)" }
   185           ui.tag { tag = "ul", attr = { class = "ul" }, content = function ()
   186             ui.tag { tag = "li", content = function ()
   187               ui.link{
   188                 text   = _"unblock member",
   189                 module = "member",
   190                 action = "update_ignore_member",
   191                 id     = member.id,
   192                 params = { delete = true },
   193                 routing = {
   194                   default = {
   195                     mode = "redirect",
   196                     module = request.get_module(),
   197                     view = request.get_view(),
   198                     id = request.get_id_string(),
   199                     params = request.get_param_strings()
   200                   }
   201                 }
   202               }
   203             end }
   204           end }
   205         end
   206       end }
   208     end
   209   end }
   210 end }
