liquid_feedback_frontend
view app/main/admin/unit_list.lua @ 1094:ef41e3449577
Fixed numbered lists in draft text
| author | bsw | 
|---|---|
| date | Mon Oct 20 12:47:41 2014 +0200 (2014-10-20) | 
| parents | 36fa53881a8e | 
| children | 
 line source
     1 local inactive = param.get("inactive", atom.boolean)
     3 local units = Unit:get_flattened_tree{ include_inactive = inactive }
     5 ui.title(_"Unit list")
     7 ui.actions(function()
     8   ui.link{
     9     text = _"Create new unit",
    10     module = "admin",
    11     view = "unit_edit"
    12   }
    13   slot.put(" · ")
    14   if inactive then
    15     ui.link{
    16       text = _"Hide active units",
    17       module = "admin",
    18       view = "unit_list"
    19     }
    20   else
    21     ui.link{
    22       text = _"Show inactive units",
    23       module = "admin",
    24       view = "unit_list",
    25       params = { inactive = true }
    26     }
    27   end
    28 end)
    30 ui.list{
    31   records = units,
    32   columns = {
    33     {
    34       content = function(unit)
    35         for i = 1, unit.depth - 1 do
    36           slot.put("     ")
    37         end
    38         local style = ""
    39         if not unit.active then
    40           style = "text-decoration: line-through;"
    41         end
    42         ui.link{
    43           attr = { style = "font-weight: bold;" .. style },
    44           text = unit.name,
    45           module = "admin", view = "unit_edit", id = unit.id
    46         }
    47         slot.put(" · ")
    48         ui.link{
    49           text = _"Edit areas",
    50           module = "admin", view = "area_list", params = { unit_id = unit.id }
    51         }
    52       end 
    53     }
    54   }
    55 }
