annotate app/main/area/list.lua @ 248:e3613831cd1e
Migrate global delegation to unit level
author |
bsw |
date |
Fri Dec 30 03:13:10 2011 +0100 (2011-12-30) |
parents |
8e284d4319be |
children |
52b125fada5b |
rev |
line source |
bsw@241
|
1 -- TODO support multiple units
|
bsw@241
|
2 local unit_id = param.get("units", atom.integer)
|
bsw@241
|
3 local areas_selector = Area:build_selector{ active = true, unit_id = unit_id }
|
bsw@197
|
4
|
bsw@247
|
5 local unit = Unit:by_id(unit_id)
|
bsw@247
|
6
|
bsw@197
|
7
|
bsw@51
|
8 if app.session.member_id then
|
bsw@247
|
9 slot.put_into("title", _("Area list of unit '#{unit_name}'", { unit_name = unit.name }))
|
bsw@51
|
10 else
|
bsw@51
|
11 slot.put_into("title", encode.html(config.app_title))
|
bsw@51
|
12 end
|
bsw@51
|
13
|
bsw@197
|
14
|
bsw@69
|
15 if not app.session.member_id and config.motd_public then
|
bsw@69
|
16 local help_text = config.motd_public
|
bsw@69
|
17 ui.container{
|
bsw@69
|
18 attr = { class = "wiki motd" },
|
bsw@69
|
19 content = function()
|
bsw@69
|
20 slot.put(format.wiki_text(help_text))
|
bsw@69
|
21 end
|
bsw@69
|
22 }
|
bsw@51
|
23 end
|
bsw/jbe@0
|
24
|
bsw/jbe@4
|
25 util.help("area.list", _"Area list")
|
bsw/jbe@4
|
26
|
bsw@248
|
27 execute.view{
|
bsw@248
|
28 module = "delegation",
|
bsw@248
|
29 view = "_show_box",
|
bsw@248
|
30 params = { unit_id = unit_id }
|
bsw@248
|
31 }
|
bsw@248
|
32
|
bsw/jbe@0
|
33
|
bsw/jbe@0
|
34 execute.view{
|
bsw/jbe@0
|
35 module = "area",
|
bsw/jbe@0
|
36 view = "_list",
|
bsw/jbe@0
|
37 params = { areas_selector = areas_selector }
|
bsw/jbe@0
|
38 }
|