bsw@581: local search = param.get("search") bsw@193: bsw@1045: ui.titleAdmin(_"Member list") bsw@1045: bsw@1045: ui.section( function() bsw@1045: bsw@1045: ui.sectionHead( function() bsw@1045: ui.heading { level = 1, content = _"Member list" } bsw@1045: end ) bsw/jbe@0: bsw@1045: ui.sectionRow( function () bsw@1045: ui.form{ bsw@1045: module = "admin", view = "member_list", bsw@1045: content = function() bsw@1045: bsw@1045: ui.field.text{ label = _"search", name = "search", value = search } bsw@1045: bsw@1045: ui.submit{ value = _"search" } bsw@1045: bsw@1045: end bsw@1045: } bsw@1045: end ) bsw@581: bsw@581: bsw@1045: ui.sectionRow( function () bsw@1045: local members_selector = Member:build_selector{ bsw@1045: admin_search = search, bsw@1045: order = "identification" bsw@1045: } bsw@584: bsw@584: bsw@1045: ui.paginate{ bsw@1045: selector = members_selector, bsw@1045: per_page = 30, bsw@1045: content = function() bsw@1045: ui.list{ bsw@1045: records = members_selector:exec(), bsw@1045: columns = { bsw@1045: { bsw@1045: label = _"Id", bsw@1045: content = function(record) bsw@1045: ui.link{ bsw@1045: text = record.id, bsw@1045: module = "admin", bsw@1045: view = "member_edit", bsw@1045: id = record.id bsw@1045: } bsw@1045: end bsw@1045: }, bsw@1045: { bsw@1045: label = _"Identification", bsw@1045: content = function(record) bsw@1045: ui.link{ bsw@1045: text = record.identification or "", bsw@1045: module = "admin", bsw@1045: view = "member_edit", bsw@1045: id = record.id bsw@1045: } bsw@1045: end bsw@1045: }, bsw@1045: { bsw@1045: label = _"Screen name", bsw@1045: content = function(record) bsw@1045: ui.link{ bsw@1045: text = record.name or "", bsw@1045: module = "admin", bsw@1045: view = "member_edit", bsw@1045: id = record.id bsw@1045: } bsw@1045: end bsw@1045: }, bsw@1045: { bsw@1045: content = function(record) bsw@1045: if record.admin then bsw@1045: ui.field.text{ value = "admin" } bsw@1045: end bsw@1045: end bsw@1045: }, bsw@1045: { bsw@1045: content = function(record) bsw@1045: if not record.activated then bsw@1045: ui.field.text{ value = "not activated" } bsw@1045: elseif not record.active then bsw@1045: ui.field.text{ value = "inactive" } bsw@1045: end bsw@1045: end bsw@1045: }, bsw@1045: { bsw@1045: content = function(record) bsw@1045: if record.locked then bsw@1045: ui.field.text{ value = "locked" } bsw@1045: end bsw@1045: end bsw@1045: }, bsw@1045: } bsw/jbe@0: } bsw@1045: end bsw/jbe@0: } bsw@1045: end ) bsw@1045: end )