bsw@1045: local for_admin = param.get("for_admin", atom.boolean) bsw@1504: local units = Unit:get_flattened_tree{} bsw@276: bsw@462: ui.container{ attr = { class = "box" }, content = function() bsw@462: bsw@462: ui.list{ bsw@462: attr = { class = "unit_list" }, bsw@462: records = units, bsw@462: columns = { bsw@462: { bsw@462: content = function(unit) bsw@462: for i = 1, unit.depth - 1 do bsw@462: slot.put("     ") bsw@462: end bsw@1045: if for_admin then bsw@1045: ui.link{ text = unit.name, module = "admin", view = "unit_edit", id = unit.id } bsw@1045: else bsw@1433: ui.link{ text = unit.name, module = "index", view = "index", params = { unit = unit.id } } bsw@1045: end bsw@462: end bsw@462: } bsw@276: } bsw@276: } bsw@462: bsw@1433: end }