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