liquid_feedback_frontend

view app/main/member/_area_list.lua @ 308:aebddf876f67

Changed two links from area/list to unit/show
author bsw
date Sun Feb 26 22:29:52 2012 +0100 (2012-02-26)
parents 22e4e26717ac
children 89d32158bfd5
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 local area_count = areas_selector:count()
10 local class = "heading"
11 if area_count > 0 then
12 class = class .. " member_area_list"
13 end
14 ui.link{
15 attr = { class = class },
16 text = unit.name,
17 module = "unit", view = "show", id = unit.id
18 }
20 if area_count > 0 then
21 execute.view{
22 module = "area", view = "_list",
23 params = { areas_selector = areas_selector }
24 }
25 else
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 = "unit", view = "show", id = unit.id
31 }
32 end
33 slot.put("<br />")
34 slot.put("<br />")
36 end

Impressum / About Us