liquid_feedback_frontend

view app/main/admin/member_list.lua @ 587:f0ffe4420fe2

Make member menu right aligned
author bsw
date Wed Jun 20 22:29:33 2012 +0200 (2012-06-20)
parents 6fc640d87c8f
children ae7649ddccf4
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 record.locked then
71 ui.field.text{ value = "locked" }
72 elseif not record.activated then
73 ui.field.text{ value = "not activated" }
74 elseif not record.active then
75 ui.field.text{ value = "inactive" }
76 else
77 ui.field.text{ value = "active" }
78 end
79 end
80 },
81 {
82 content = function(record)
83 ui.link{
84 attr = { class = "action admin_only" },
85 text = _"Edit",
86 module = "admin",
87 view = "member_edit",
88 id = record.id
89 }
90 end
91 }
92 }
93 }
94 end
95 }

Impressum / About Us