liquid_feedback_frontend
view app/main/member/_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 |
line source
1 local units = app.session.member.units_with_voting_right
2 local member = param.get("member", "table")
3 for i, unit in ipairs(units) do
4 local areas_selector = Area:new_selector()
5 :join("membership", nil, { "membership.area_id = area.id AND membership.member_id = ?", member.id })
6 :add_where{ "area.unit_id = ?", unit.id }
7 :add_order_by("area.member_weight DESC")
9 if areas_selector:count() > 0 then
10 execute.view{
11 module = "area", view = "_list",
12 params = { areas_selector = areas_selector, title = function()
13 ui.link{
14 attr = { class = "heading" },
15 text = unit.name,
16 module = "area", view = "list", params = { unit_id = unit.id }
17 }
18 end},
19 }
20 else
21 ui.link{
22 attr = { class = "heading" },
23 text = unit.name,
24 module = "area", view = "list", params = { unit_id = unit.id }
25 }
26 ui.tag{ content = _"You have voting privileges for this unit, but you are not member of any of its areas." }
27 slot.put(" ")
28 ui.link{
29 text = _"Show all areas of this unit",
30 module = "area", view = "list", params = { unit_id = unit.id }
31 }
32 end
33 slot.put("<br />")
34 slot.put("<br />")
36 end
