liquid_feedback_frontend
view app/main/admin/member_list.lua @ 1585:020fd82c6cb4
Updated include_roles parameter type to boolean
| author | bsw | 
|---|---|
| date | Tue Jan 26 18:57:19 2021 +0100 (2021-01-26) | 
| parents | a006f2e3b5b5 | 
| children | 
 line source
     1 local search = param.get("search")
     3 ui.titleAdmin(_"Member")
     5 ui.grid{ content = function()
     7   ui.cell_main{ content = function()
     8     ui.container{ attr = { class = "mdl-card mdl-card__fullwidth mdl-shadow--2dp" }, content = function()
     9       ui.container{ attr = { class = "mdl-card__title mdl-card--border" }, content = function()
    10         ui.heading { attr = { class = "mdl-card__title-text" }, level = 2, content = _"Member list" }
    11       end }
    12       ui.container{ attr = { class = "mdl-card__content" }, content = function()
    13         ui.form{
    14           module = "admin", view = "member_list",
    15           content = function()
    17             ui.field.text{ container_attr = { style = "display: inline-block;" }, label = _"search", name = "search", value = search }
    19             ui.submit{ value = _"search" }
    21           end
    22         }
    24         local members_selector = Member:build_selector{
    25           admin_search = search,
    26           order = "identification"
    27         }
    29         ui.paginate{
    30           selector = members_selector,
    31           per_page = 30,
    32           content = function() 
    33             ui.list{
    34               records = members_selector:exec(),
    35               columns = {
    36                 {
    37                   label = _"Id",
    38                   content = function(record)
    39                     ui.link{
    40                       text = record.id,
    41                       module = "admin",
    42                       view = "member_edit",
    43                       id = record.id
    44                     }
    45                   end
    46                 },
    47                 {
    48                   label = _"Identification",
    49                   content = function(record)
    50                     ui.link{
    51                       text = record.identification or "",
    52                       module = "admin",
    53                       view = "member_edit",
    54                       id = record.id
    55                     }
    56                   end
    57                 },
    58                 {
    59                   label = _"Screen name",
    60                   content = function(record)
    61                     ui.link{
    62                       text = record.name or "",
    63                       module = "admin",
    64                       view = "member_edit",
    65                       id = record.id
    66                     }
    67                   end
    68                 },
    69                 {
    70                   content = function(record)
    71                     if record.admin then
    72                       ui.field.text{ value = "admin" }
    73                     end
    74                   end
    75                 },
    76                 {
    77                   content = function(record)
    78                     if not record.activated then
    79                       ui.field.text{ value = "not activated" }
    80                     elseif not record.active then
    81                       ui.field.text{ value = "inactive" }
    82                     end
    83                   end
    84                 },
    85                 {
    86                   content = function(record)
    87                     if record.locked then
    88                       ui.field.text{ value = "locked" }
    89                     end
    90                   end
    91                 },
    92               }
    93             }
    94           end
    95         }
    96       end }
    97     end }
    98   end }
    99 end }
