liquid_feedback_frontend
view app/main/area/list.lua @ 249:52b125fada5b
Show unit delegation button only for logged in users
author | bsw |
---|---|
date | Fri Dec 30 03:14:51 2011 +0100 (2011-12-30) |
parents | e3613831cd1e |
children | 743194cbdd89 |
line source
1 -- TODO support multiple units
2 local unit_id = param.get("units", atom.integer)
3 local areas_selector = Area:build_selector{ active = true, unit_id = unit_id }
5 local unit = Unit:by_id(unit_id)
8 if app.session.member_id then
9 slot.put_into("title", _("Area list of unit '#{unit_name}'", { unit_name = unit.name }))
10 else
11 slot.put_into("title", encode.html(config.app_title))
12 end
15 if not app.session.member_id and config.motd_public then
16 local help_text = config.motd_public
17 ui.container{
18 attr = { class = "wiki motd" },
19 content = function()
20 slot.put(format.wiki_text(help_text))
21 end
22 }
23 end
25 util.help("area.list", _"Area list")
27 if app.session.member_id then
28 execute.view{
29 module = "delegation",
30 view = "_show_box",
31 params = { unit_id = unit_id }
32 }
33 end
36 execute.view{
37 module = "area",
38 view = "_list",
39 params = { areas_selector = areas_selector }
40 }