bsw@263: local units = Unit:get_flattened_tree{ active = true } bsw@263: bsw@263: slot.put_into("title", _"Unit list") bsw@263: bsw@263: slot.select("actions", function() bsw@263: ui.link{ bsw@263: attr = { class = { "admin_only" } }, bsw@263: text = _"Create new unit", bsw@263: module = "admin", bsw@263: view = "unit_edit" bsw@263: } bsw@263: end) bsw@263: bsw@263: ui.list{ bsw@263: records = units, bsw@263: columns = { bsw@263: { bsw@263: label = "name", bsw@263: content = function(unit) bsw@263: ui.link{ text = unit.name, module = "admin", view = "area_list", params = { unit_id = unit.id } } bsw@263: end bsw@263: } bsw@263: } bsw@263: }