liquid_feedback_frontend
view app/main/admin/member_list.lua @ 583:edf6b6814a68
Added delegation chain preview for inherited unit/area delegations
author | bsw |
---|---|
date | Wed Jun 20 21:31:14 2012 +0200 (2012-06-20) |
parents | c676054cb0bc |
children | 6fc640d87c8f |
line source
1 local show_locked = param.get("show_locked", atom.boolean)
3 local locked = show_locked or false
4 local search = param.get("search")
5 if search then
6 locked = nil
7 end
9 local members_selector = Member:build_selector{
10 admin_search = search,
11 locked = locked,
12 order = "identification"
13 }
16 ui.title(_"Member list")
19 slot.select("head", function()
20 ui.container{ attr = { class = "content" }, content = function()
21 ui.container{ attr = { class = "actions" }, content = function()
22 ui.link{
23 attr = { class = { "admin_only" } },
24 text = _"Register new member",
25 module = "admin",
26 view = "member_edit"
27 }
28 slot.put(" · ")
29 if show_locked then
30 ui.link{
31 attr = { class = { "admin_only" } },
32 text = _"Show active members",
33 module = "admin",
34 view = "member_list"
35 }
36 else
37 ui.link{
38 attr = { class = { "admin_only" } },
39 text = _"Show locked members",
40 module = "admin",
41 view = "member_list",
42 params = { show_locked = true }
43 }
44 end
45 end }
46 end }
47 end)
50 ui.form{
51 module = "admin", view = "member_list",
52 content = function()
54 ui.field.text{ label = _"Search for members", name = "search" }
56 ui.submit{ value = _"Start search" }
58 end
59 }
61 ui.paginate{
62 selector = members_selector,
63 per_page = 30,
64 content = function()
65 ui.list{
66 records = members_selector:exec(),
67 columns = {
68 {
69 field_attr = { style = "text-align: right;" },
70 label = _"Id",
71 name = "id"
72 },
73 {
74 label = _"Identification",
75 name = "identification"
76 },
77 {
78 label = _"Screen name",
79 name = "name"
80 },
81 {
82 label = _"Admin?",
83 content = function(record)
84 if record.admin then
85 ui.field.text{ value = "admin" }
86 end
87 end
88 },
89 {
90 content = function(record)
91 if record.locked then
92 ui.field.text{ value = "locked" }
93 elseif not record.activated then
94 ui.field.text{ value = "not activated" }
95 elseif not record.active then
96 ui.field.text{ value = "inactive" }
97 end
98 end
99 },
100 {
101 content = function(record)
102 ui.link{
103 attr = { class = "action admin_only" },
104 text = _"Edit",
105 module = "admin",
106 view = "member_edit",
107 id = record.id
108 }
109 end
110 }
111 }
112 }
113 end
114 }