bsw@581: local search = param.get("search") bsw@193: bsw@1474: ui.titleAdmin(_"Member") bsw@1474: bsw@1452: ui.grid{ content = function() bsw/jbe@0: bsw@1452: ui.cell_main{ content = function() bsw@1452: ui.container{ attr = { class = "mdl-card mdl-card__fullwidth mdl-shadow--2dp" }, content = function() bsw@1452: ui.container{ attr = { class = "mdl-card__title mdl-card--border" }, content = function() bsw@1452: ui.heading { attr = { class = "mdl-card__title-text" }, level = 2, content = _"Member list" } bsw@1452: end } bsw@1452: ui.container{ attr = { class = "mdl-card__content" }, content = function() bsw@1452: ui.form{ bsw@1452: module = "admin", view = "member_list", bsw@1452: content = function() bsw@1452: bsw@1453: ui.field.text{ container_attr = { style = "display: inline-block;" }, label = _"search", name = "search", value = search } bsw@1452: bsw@1452: ui.submit{ value = _"search" } bsw@1452: bsw@1452: end bsw@1452: } bsw@581: bsw@1452: local members_selector = Member:build_selector{ bsw@1452: admin_search = search, bsw@1452: order = "identification" bsw@1452: } bsw@584: bsw@1452: ui.paginate{ bsw@1452: selector = members_selector, bsw@1452: per_page = 30, bsw@1452: content = function() bsw@1452: ui.list{ bsw@1452: records = members_selector:exec(), bsw@1452: columns = { bsw@1452: { bsw@1452: label = _"Id", bsw@1452: content = function(record) bsw@1452: ui.link{ bsw@1452: text = record.id, bsw@1452: module = "admin", bsw@1452: view = "member_edit", bsw@1452: id = record.id bsw@1452: } bsw@1452: end bsw@1452: }, bsw@1452: { bsw@1452: label = _"Identification", bsw@1452: content = function(record) bsw@1452: ui.link{ bsw@1452: text = record.identification or "", bsw@1452: module = "admin", bsw@1452: view = "member_edit", bsw@1452: id = record.id bsw@1452: } bsw@1452: end bsw@1452: }, bsw@1452: { bsw@1452: label = _"Screen name", bsw@1452: content = function(record) bsw@1452: ui.link{ bsw@1452: text = record.name or "", bsw@1452: module = "admin", bsw@1452: view = "member_edit", bsw@1452: id = record.id bsw@1452: } bsw@1452: end bsw@1452: }, bsw@1452: { bsw@1452: content = function(record) bsw@1452: if record.admin then bsw@1452: ui.field.text{ value = "admin" } bsw@1452: end bsw@1452: end bsw@1452: }, bsw@1452: { bsw@1452: content = function(record) bsw@1452: if not record.activated then bsw@1452: ui.field.text{ value = "not activated" } bsw@1452: elseif not record.active then bsw@1452: ui.field.text{ value = "inactive" } bsw@1452: end bsw@1452: end bsw@1452: }, bsw@1452: { bsw@1452: content = function(record) bsw@1452: if record.locked then bsw@1452: ui.field.text{ value = "locked" } bsw@1452: end bsw@1452: end bsw@1452: }, bsw@1452: } bsw@1452: } bsw@1452: end bsw/jbe@0: } bsw@1452: end } bsw@1452: end } bsw@1452: end } bsw@1452: end }