liquid_feedback_frontend
view app/main/admin/unit_list.lua @ 518:46c05d8837b7
Removed artefacts from old API
| author | bsw | 
|---|---|
| date | Sun Apr 15 18:26:06 2012 +0200 (2012-04-15) | 
| parents | dbfde3c56790 | 
| children | bc6934411019 | 
 line source
     1 local units = Unit:get_flattened_tree{ active = true }
     3 slot.put_into("title", _"Unit list")
     5 slot.select("actions", function()
     6   ui.link{
     7     attr = { class = { "admin_only" } },
     8     text = _"Create new unit",
     9     module = "admin",
    10     view = "unit_edit"
    11   }
    12 end)
    14 ui.list{
    15   records = units,
    16   columns = {
    17     {
    18       label = "name",
    19       name = "name"
    20     },
    21     {
    22       content = function(unit)
    23         ui.link{
    24           attr = { class = "action admin_only" },
    25           text = _"Edit unit",
    26           module = "admin", view = "unit_edit", id = unit.id
    27         }
    28         ui.link{
    29           attr = { class = "action admin_only" },
    30           text = _"Edit areas",
    31           module = "admin", view = "area_list", params = { unit_id = unit.id }
    32         }
    33       end 
    34     }
    35   }
    36 }
