liquid_feedback_frontend
view app/main/admin/member_list.lua @ 1343:63970058b2dc
Added missing comma
| author | bsw | 
|---|---|
| date | Fri Aug 03 17:43:37 2018 +0200 (2018-08-03) | 
| parents | 701a5cf6b067 | 
| children | 0739091c56fa | 
 line source
     1 local search = param.get("search")
     3 ui.titleAdmin(_"Member list")
     5 ui.section( function()
     7   ui.sectionHead( function()
     8     ui.heading { level = 1, content = _"Member list" }
     9   end )
    11   ui.sectionRow( function ()
    12     ui.form{
    13       module = "admin", view = "member_list",
    14       content = function()
    16         ui.field.text{ label = _"search", name = "search", value = search }
    18         ui.submit{ value = _"search" }
    20       end
    21     }
    22   end )
    25   ui.sectionRow( function ()
    26     local members_selector = Member:build_selector{
    27       admin_search = search,
    28       order = "identification"
    29     }
    32     ui.paginate{
    33       selector = members_selector,
    34       per_page = 30,
    35       content = function() 
    36         ui.list{
    37           records = members_selector:exec(),
    38           columns = {
    39             {
    40               label = _"Id",
    41               content = function(record)
    42                 ui.link{
    43                   text = record.id,
    44                   module = "admin",
    45                   view = "member_edit",
    46                   id = record.id
    47                 }
    48               end
    49             },
    50             {
    51               label = _"Identification",
    52               content = function(record)
    53                 ui.link{
    54                   text = record.identification or "",
    55                   module = "admin",
    56                   view = "member_edit",
    57                   id = record.id
    58                 }
    59               end
    60             },
    61             {
    62               label = _"Screen name",
    63               content = function(record)
    64                 ui.link{
    65                   text = record.name or "",
    66                   module = "admin",
    67                   view = "member_edit",
    68                   id = record.id
    69                 }
    70               end
    71             },
    72             {
    73               content = function(record)
    74                 if record.admin then
    75                   ui.field.text{ value = "admin" }
    76                 end
    77               end
    78             },
    79             {
    80               content = function(record)
    81                 if not record.activated then
    82                   ui.field.text{ value = "not activated" }
    83                 elseif not record.active then
    84                   ui.field.text{ value = "inactive" }
    85                 end
    86               end
    87             },
    88             {
    89               content = function(record)
    90                 if record.locked then
    91                   ui.field.text{ value = "locked" }
    92                 end
    93               end
    94             },
    95           }
    96         }
    97       end
    98     }
    99   end )
   100 end )
