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