annotate app/main/area/list.lua @ 262:7ef1e03e4057
Added unit chooser and unit support to area list
author |
bsw |
date |
Tue Feb 07 17:54:00 2012 +0100 (2012-02-07) |
parents |
743194cbdd89 |
children |
1b8d51e21614 |
rev |
line source |
bsw@262
|
1 local unit_id = param.get("unit_id", atom.integer)
|
bsw@262
|
2
|
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@262
|
8 if config.feature_units_enabled then
|
bsw@262
|
9 slot.put_into("title", 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@249
|
27 if app.session.member_id then
|
bsw@249
|
28 execute.view{
|
bsw@249
|
29 module = "delegation",
|
bsw@249
|
30 view = "_show_box",
|
bsw@249
|
31 params = { unit_id = unit_id }
|
bsw@249
|
32 }
|
bsw@249
|
33 end
|
bsw@248
|
34
|
bsw/jbe@0
|
35
|
bsw/jbe@0
|
36 execute.view{
|
bsw/jbe@0
|
37 module = "area",
|
bsw/jbe@0
|
38 view = "_list",
|
bsw/jbe@0
|
39 params = { areas_selector = areas_selector }
|
bsw/jbe@0
|
40 }
|