liquid_feedback_frontend
view app/main/unit/_list.lua @ 1694:bca6a066d429
Fixed area without unit in single_unit mode
| author | bsw | 
|---|---|
| date | Thu Sep 23 14:29:39 2021 +0200 (2021-09-23) | 
| parents | 2a0d86117d54 | 
| children | 
 line source
     1 local for_admin = param.get("for_admin", atom.boolean)
     2 local units = Unit:get_flattened_tree{}
     4 ui.container{ attr = { class = "box" }, content = function()
     6   ui.list{
     7     attr = { class = "unit_list" },
     8     records = units,
     9     columns = {
    10       {
    11         content = function(unit)
    12           for i = 1, unit.depth - 1 do
    13             slot.put("     ")
    14           end
    15           if for_admin then
    16             ui.link{ text = unit.name, module = "admin", view = "unit_edit", id = unit.id }
    17           else
    18             ui.link{ text = unit.name, module = "index", view = "index", params = { unit = unit.id } }
    19           end
    20         end 
    21       }
    22     }
    23   }
    25 end }
