liquid_feedback_frontend
view app/main/member/history.lua @ 1451:fc89a38b52c5
Fixed wrong nesting
| author | bsw | 
|---|---|
| date | Thu Oct 18 17:18:19 2018 +0200 (2018-10-18) | 
| parents | 32cc544d5a5b | 
| children | 
 line source
     1 local member = Member:by_id(param.get_id())
     3 if not member then
     4   execute.view { module = "index", view = "404" }
     5   request.set_status("404 Not Found")
     6   return
     7 end
    10 ui.titleMember(member)
    12 ui.grid{ content = function()
    13   ui.cell_main{ content = function()
    14     ui.container{ attr = { class = "mdl-card mdl-card__fullwidth mdl-shadow--2dp" }, content = function()
    16       ui.container{ attr = { class = "mdl-card__title mdl-card--border" }, content = function()
    17         ui.heading { attr = { class = "mdl-card__title-text" }, level = 2, content = _"Account history" }
    18       end }
    20       ui.container{ attr = { class = "mdl-card__content" }, content = function()
    23         ui.form{
    24           attr = { class = "vertical" },
    25           content = function()
    26             ui.field.text{ label = _"Current name", value = member.name }
    27             ui.field.text{ label = _"Current status", value = member.active and _'activated' or _'deactivated' }
    28           end
    29         }
    32         local entries = member:get_reference_selector("history_entries"):add_order_by("id DESC"):exec()
    34         if #entries > 0 then
    35           ui.tag{
    36             tag = "table",
    37             content = function()
    38               ui.tag{
    39                 tag = "tr",
    40                 content = function()
    41                   ui.tag{
    42                     tag = "th",
    43                     content = _("Name")
    44                   }
    45                   ui.tag{
    46                     tag = "th",
    47                     content = _("Status")
    48                   }
    49                   ui.tag{
    50                     tag = "th",
    51                     content = _("until")
    52                   }
    53                 end
    54               }
    55               for i, entry in ipairs(entries) do
    56                 ui.tag{
    57                   tag = "tr",
    58                   content = function()
    59                     ui.tag{
    60                       tag = "td",
    61                       content = entry.name
    62                     }
    63                     ui.tag{
    64                       tag = "td",
    65                       content = entry.active and _'activated' or _'deactivated',
    66                     }
    67                     ui.tag{
    68                       tag = "td",
    69                       content = format.timestamp(entry["until"])
    70                     }
    71                   end
    72                 }
    73               end
    74             end
    75           }
    76         end
    77         slot.put("<br />")
    78         ui.container{
    79           content = _("This member account has been created at #{created}", { created = format.timestamp(member.activated)})
    80         }
    82       end}
    83     end}
    84   end }
    85   ui.cell_sidebar{ content = function()
    86     execute.view {
    87       module = "member", view = "_sidebar_whatcanido", params = {
    88         member = member
    89       }
    90     }
    91   end }
    93 end }
