annotate app/main/admin/unit_list.lua @ 495:37b12af64990
Added alt tags
 | author | 
 bsw | 
 | date | 
 Sat Mar 17 13:00:25 2012 +0100 (2012-03-17) | 
 | parents | 
 f42d16567c5d  | 
 | children | 
 dbfde3c56790  | 
 
 | rev | 
   line source | 
| 
bsw@263
 | 
     1 local units = Unit:get_flattened_tree{ active = true }
 | 
| 
bsw@263
 | 
     2 
 | 
| 
bsw@263
 | 
     3 slot.put_into("title", _"Unit list")
 | 
| 
bsw@263
 | 
     4 
 | 
| 
bsw@263
 | 
     5 slot.select("actions", function()
 | 
| 
bsw@263
 | 
     6   ui.link{
 | 
| 
bsw@263
 | 
     7     attr = { class = { "admin_only" } },
 | 
| 
bsw@263
 | 
     8     text = _"Create new unit",
 | 
| 
bsw@263
 | 
     9     module = "admin",
 | 
| 
bsw@263
 | 
    10     view = "unit_edit"
 | 
| 
bsw@263
 | 
    11   }
 | 
| 
bsw@263
 | 
    12 end)
 | 
| 
bsw@263
 | 
    13  
 | 
| 
bsw@263
 | 
    14 ui.list{
 | 
| 
bsw@263
 | 
    15   records = units,
 | 
| 
bsw@263
 | 
    16   columns = {
 | 
| 
bsw@263
 | 
    17     {
 | 
| 
bsw@263
 | 
    18       label = "name",
 | 
| 
bsw@263
 | 
    19       content = function(unit)
 | 
| 
bsw@263
 | 
    20         ui.link{ text = unit.name, module = "admin", view = "area_list", params = { unit_id = unit.id } }
 | 
| 
bsw@263
 | 
    21       end 
 | 
| 
bsw@263
 | 
    22     }
 | 
| 
bsw@263
 | 
    23   }
 | 
| 
bsw@263
 | 
    24 } |