liquid_feedback_frontend
diff app/main/admin/area_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 | 46351752814f |
| children | bc6934411019 |
line diff
1.1 --- a/app/main/admin/area_list.lua Tue Feb 07 17:54:00 2012 +0100 1.2 +++ b/app/main/admin/area_list.lua Tue Feb 07 18:13:00 2012 +0100 1.3 @@ -1,19 +1,30 @@ 1.4 +local unit_id = param.get("unit_id", atom.integer) 1.5 +local unit = Unit:by_id(unit_id) 1.6 + 1.7 local show_not_in_use = param.get("show_not_in_use", atom.boolean) or false 1.8 1.9 -local areas = Area:build_selector{ active = not show_not_in_use }:exec() 1.10 +local areas = Area:build_selector{ unit_id = unit_id, active = not show_not_in_use }:exec() 1.11 1.12 1.13 -slot.put_into("title", _"Area list") 1.14 +slot.put_into("title", _("Area list of '#{unit_name}'", { unit_name = unit.name})) 1.15 1.16 1.17 slot.select("actions", function() 1.18 1.19 + ui.link{ 1.20 + attr = { class = { "admin_only" } }, 1.21 + text = _"Back to unit list", 1.22 + module = "admin", 1.23 + view = "unit_list" 1.24 + } 1.25 + 1.26 if show_not_in_use then 1.27 ui.link{ 1.28 attr = { class = { "admin_only" } }, 1.29 text = _"Show areas in use", 1.30 module = "admin", 1.31 - view = "area_list" 1.32 + view = "area_list", 1.33 + params = { unit_id = unit_id } 1.34 } 1.35 1.36 else 1.37 @@ -21,14 +32,15 @@ 1.38 attr = { class = { "admin_only" } }, 1.39 text = _"Create new area", 1.40 module = "admin", 1.41 - view = "area_show" 1.42 + view = "area_show", 1.43 + params = { unit_id = unit_id } 1.44 } 1.45 ui.link{ 1.46 attr = { class = { "admin_only" } }, 1.47 text = _"Show areas not in use", 1.48 module = "admin", 1.49 view = "area_list", 1.50 - params = { show_not_in_use = true } 1.51 + params = { show_not_in_use = true, unit_id = unit_id } 1.52 } 1.53 end 1.54