liquid_feedback_frontend
view app/main/unit/_head.lua @ 570:b904fc12cc1a
Show only units with voting privilege in member_home page
author | bsw |
---|---|
date | Tue Jun 19 23:18:39 2012 +0200 (2012-06-19) |
parents | 5ca9de94cb13 |
children | f52f918b38b8 |
line source
1 local unit = param.get("unit", "table")
3 local show_content = param.get("show_content", atom.boolean)
5 unit:load_delegation_info_once_for_member_id(app.session.member_id)
7 ui.container{ attr = { class = "unit_head" }, content = function()
9 execute.view{ module = "delegation", view = "_info", params = { unit = unit } }
11 ui.container{ attr = { class = "title" }, content = function()
12 if not config.single_unit_id then
13 ui.link{
14 module = "unit", view = "show", id = unit.id,
15 attr = { class = "unit_name" }, content = unit.name
16 }
17 else
18 ui.link{
19 module = "unit", view = "show", id = unit.id,
20 attr = { class = "unit_name" }, content = config.app_title
21 }
22 end
23 end }
25 if show_content then
26 ui.container{ attr = { class = "content" }, content = function()
28 if app.session.member_id and app.session.member:has_voting_right_for_unit_id(unit.id) then
29 ui.tag{ content = _"You have voting privileges for this unit" }
30 slot.put(" · ")
31 if unit.delegation_info.first_trustee_id == nil then
32 ui.link{ text = _"Delegate unit", module = "delegation", view = "show", params = { unit_id = unit.id } }
33 else
34 ui.link{ text = _"Change unit delegation", module = "delegation", view = "show", params = { unit_id = unit.id } }
35 end
36 end
37 end }
38 else
39 slot.put("<br />")
40 end
42 end }