liquid_feedback_frontend

view app/main/admin/member_list.lua @ 590:ae7649ddccf4

Make it possible to set an member inactive, display activation status and lock status seperately in admin member list
author bsw
date Thu Jun 21 17:22:25 2012 +0200 (2012-06-21)
parents 6fc640d87c8f
children b5684668ac4b
line source
1 local search = param.get("search")
3 ui.title(_"Member list")
5 slot.select("head", function()
6 ui.container{ attr = { class = "content" }, content = function()
7 ui.container{ attr = { class = "actions" }, content = function()
8 ui.link{
9 attr = { class = { "admin_only" } },
10 text = _"Register new member",
11 module = "admin",
12 view = "member_edit"
13 }
14 end }
15 end }
16 end)
19 ui.form{
20 module = "admin", view = "member_list",
21 content = function()
23 ui.field.text{ label = _"Search for members", name = "search" }
25 ui.submit{ value = _"Start search" }
27 end
28 }
30 if not search then
31 return
32 end
34 local members_selector = Member:build_selector{
35 admin_search = search,
36 order = "identification"
37 }
40 ui.paginate{
41 selector = members_selector,
42 per_page = 30,
43 content = function()
44 ui.list{
45 records = members_selector:exec(),
46 columns = {
47 {
48 field_attr = { style = "text-align: right;" },
49 label = _"Id",
50 name = "id"
51 },
52 {
53 label = _"Identification",
54 name = "identification"
55 },
56 {
57 label = _"Screen name",
58 name = "name"
59 },
60 {
61 label = _"Admin?",
62 content = function(record)
63 if record.admin then
64 ui.field.text{ value = "admin" }
65 end
66 end
67 },
68 {
69 content = function(record)
70 if not record.activated then
71 ui.field.text{ value = "not activated" }
72 elseif not record.active then
73 ui.field.text{ value = "inactive" }
74 else
75 ui.field.text{ value = "active" }
76 end
77 end
78 },
79 {
80 content = function(record)
81 if record.locked then
82 ui.field.text{ value = "locked" }
83 end
84 end
85 },
86 {
87 content = function(record)
88 ui.link{
89 attr = { class = "action admin_only" },
90 text = _"Edit",
91 module = "admin",
92 view = "member_edit",
93 id = record.id
94 }
95 end
96 }
97 }
98 }
99 end

Impressum / About Us