liquid_feedback_frontend
diff app/main/admin/unit_list.lua @ 263:f42d16567c5d
Added admin section for units, added unit support to areas in admin section
author | bsw |
---|---|
date | Tue Feb 07 18:13:00 2012 +0100 (2012-02-07) |
parents | |
children | dbfde3c56790 |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/app/main/admin/unit_list.lua Tue Feb 07 18:13:00 2012 +0100 1.3 @@ -0,0 +1,24 @@ 1.4 +local units = Unit:get_flattened_tree{ active = true } 1.5 + 1.6 +slot.put_into("title", _"Unit list") 1.7 + 1.8 +slot.select("actions", function() 1.9 + ui.link{ 1.10 + attr = { class = { "admin_only" } }, 1.11 + text = _"Create new unit", 1.12 + module = "admin", 1.13 + view = "unit_edit" 1.14 + } 1.15 +end) 1.16 + 1.17 +ui.list{ 1.18 + records = units, 1.19 + columns = { 1.20 + { 1.21 + label = "name", 1.22 + content = function(unit) 1.23 + ui.link{ text = unit.name, module = "admin", view = "area_list", params = { unit_id = unit.id } } 1.24 + end 1.25 + } 1.26 + } 1.27 +} 1.28 \ No newline at end of file