annotate app/main/area/list.lua @ 279:23c98752e697
Added wiki support for suggestions and member statements
| author |
bsw |
| date |
Thu Feb 16 14:08:43 2012 +0100 (2012-02-16) |
| parents |
fecd4c13054a |
| children |
808269b7f41c |
| rev |
line source |
|
bsw@264
|
1 local unit_id = config.single_unit_id or param.get("unit_id", atom.integer)
|
|
bsw@278
|
2 local title = param.get("title", "function")
|
|
bsw@262
|
3
|
|
bsw@241
|
4 local areas_selector = Area:build_selector{ active = true, unit_id = unit_id }
|
|
bsw@273
|
5 areas_selector:add_order_by("member_weight DESC")
|
|
bsw@197
|
6
|
|
bsw@247
|
7 local unit = Unit:by_id(unit_id)
|
|
bsw@247
|
8
|
|
bsw@197
|
9
|
|
bsw@264
|
10 if not config.single_unit_id then
|
|
bsw@262
|
11 slot.put_into("title", unit.name)
|
|
bsw@51
|
12 else
|
|
bsw@51
|
13 slot.put_into("title", encode.html(config.app_title))
|
|
bsw@51
|
14 end
|
|
bsw@51
|
15
|
|
bsw@197
|
16
|
|
bsw@69
|
17 if not app.session.member_id and config.motd_public then
|
|
bsw@69
|
18 local help_text = config.motd_public
|
|
bsw@69
|
19 ui.container{
|
|
bsw@69
|
20 attr = { class = "wiki motd" },
|
|
bsw@69
|
21 content = function()
|
|
bsw@69
|
22 slot.put(format.wiki_text(help_text))
|
|
bsw@69
|
23 end
|
|
bsw@69
|
24 }
|
|
bsw@51
|
25 end
|
|
bsw/jbe@0
|
26
|
|
bsw/jbe@4
|
27 util.help("area.list", _"Area list")
|
|
bsw/jbe@4
|
28
|
|
bsw@249
|
29 if app.session.member_id then
|
|
bsw@249
|
30 execute.view{
|
|
bsw@249
|
31 module = "delegation",
|
|
bsw@249
|
32 view = "_show_box",
|
|
bsw@249
|
33 params = { unit_id = unit_id }
|
|
bsw@249
|
34 }
|
|
bsw@249
|
35 end
|
|
bsw@248
|
36
|
|
bsw/jbe@0
|
37
|
|
bsw/jbe@0
|
38 execute.view{
|
|
bsw/jbe@0
|
39 module = "area",
|
|
bsw/jbe@0
|
40 view = "_list",
|
|
bsw@278
|
41 params = { areas_selector = areas_selector, title = title }
|
|
bsw/jbe@0
|
42 }
|