liquid_feedback_frontend

annotate app/main/admin/member_list.lua @ 595:bc6934411019

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

Impressum / About Us