annotate app/main/unit/_list.lua @ 1447:930fed8d0004
Fixed missing closing end
author |
bsw |
date |
Thu Oct 18 17:12:47 2018 +0200 (2018-10-18) |
parents |
c18bee9e186e |
children |
2a0d86117d54 |
rev |
line source |
bsw@1045
|
1 local for_admin = param.get("for_admin", atom.boolean)
|
bsw@276
|
2 local units = Unit:get_flattened_tree{ active = true }
|
bsw@276
|
3
|
bsw@462
|
4 ui.container{ attr = { class = "box" }, content = function()
|
bsw@462
|
5
|
bsw@462
|
6 ui.list{
|
bsw@462
|
7 attr = { class = "unit_list" },
|
bsw@462
|
8 records = units,
|
bsw@462
|
9 columns = {
|
bsw@462
|
10 {
|
bsw@462
|
11 content = function(unit)
|
bsw@462
|
12 for i = 1, unit.depth - 1 do
|
bsw@462
|
13 slot.put(" ")
|
bsw@462
|
14 end
|
bsw@1045
|
15 if for_admin then
|
bsw@1045
|
16 ui.link{ text = unit.name, module = "admin", view = "unit_edit", id = unit.id }
|
bsw@1045
|
17 else
|
bsw@1433
|
18 ui.link{ text = unit.name, module = "index", view = "index", params = { unit = unit.id } }
|
bsw@1045
|
19 end
|
bsw@462
|
20 end
|
bsw@462
|
21 }
|
bsw@276
|
22 }
|
bsw@276
|
23 }
|
bsw@462
|
24
|
bsw@1433
|
25 end }
|