liquid_feedback_frontend

view app/main/admin/member_list.lua @ 603:b5684668ac4b

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

Impressum / About Us