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