liquid_feedback_frontend

view app/main/admin/member_list.lua @ 1453:d310cca38a87

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

Impressum / About Us