annotate app/main/area/list.lua @ 296:d39fa6c0ff0b
Check voting right of delegation trustee
author |
bsw |
date |
Sat Feb 25 22:20:38 2012 +0100 (2012-02-25) |
parents |
808269b7f41c |
children |
|
rev |
line source |
bsw@264
|
1 local unit_id = config.single_unit_id or 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@273
|
4 areas_selector:add_order_by("member_weight DESC")
|
bsw@197
|
5
|
bsw@247
|
6 local unit = Unit:by_id(unit_id)
|
bsw@247
|
7
|
bsw@197
|
8
|
bsw@264
|
9 if not config.single_unit_id then
|
bsw@262
|
10 slot.put_into("title", unit.name)
|
bsw@51
|
11 else
|
bsw@51
|
12 slot.put_into("title", encode.html(config.app_title))
|
bsw@51
|
13 end
|
bsw@51
|
14
|
bsw@197
|
15
|
bsw@69
|
16 if not app.session.member_id and config.motd_public then
|
bsw@69
|
17 local help_text = config.motd_public
|
bsw@69
|
18 ui.container{
|
bsw@69
|
19 attr = { class = "wiki motd" },
|
bsw@69
|
20 content = function()
|
bsw@69
|
21 slot.put(format.wiki_text(help_text))
|
bsw@69
|
22 end
|
bsw@69
|
23 }
|
bsw@51
|
24 end
|
bsw/jbe@0
|
25
|
bsw/jbe@4
|
26 util.help("area.list", _"Area list")
|
bsw/jbe@4
|
27
|
bsw@249
|
28 if app.session.member_id then
|
bsw@249
|
29 execute.view{
|
bsw@249
|
30 module = "delegation",
|
bsw@249
|
31 view = "_show_box",
|
bsw@249
|
32 params = { unit_id = unit_id }
|
bsw@249
|
33 }
|
bsw@249
|
34 end
|
bsw@248
|
35
|
bsw/jbe@0
|
36
|
bsw/jbe@0
|
37 execute.view{
|
bsw/jbe@0
|
38 module = "area",
|
bsw/jbe@0
|
39 view = "_list",
|
bsw@280
|
40 params = { areas_selector = areas_selector }
|
bsw/jbe@0
|
41 }
|