liquid_feedback_frontend
view app/main/unit/_head.lua @ 792:8dbf04a404e7
Optical enhancements
| author | bsw | 
|---|---|
| date | Fri Jun 29 00:49:09 2012 +0200 (2012-06-29) | 
| parents | a3eb6ca34484 | 
| children | b68880106e7e | 
 line source
     1 local unit = param.get("unit", "table")
     2 local member = param.get("member", "table")
     4 local show_content = param.get("show_content", atom.boolean)
     6 unit:load_delegation_info_once_for_member_id(app.session.member_id)
     8 ui.container{ attr = { class = "unit_head" }, content = function()
    10   execute.view{ module = "delegation", view = "_info", params = { unit = unit, member = member } }
    12   ui.container{ attr = { class = "title" }, content = function()
    13     if not config.single_unit_id then
    14       ui.link{ 
    15         module = "unit", view = "show", id = unit.id,
    16         attr = { class = "unit_name" }, content = unit.name
    17       }
    18     else
    19       ui.link{ 
    20         module = "unit", view = "show", id = unit.id,
    21         attr = { class = "unit_name" }, content = _"LiquidFeedback" .. " · " .. config.instance_name
    22       }
    23     end
    24   end }
    26   if show_content then
    27     ui.container{ attr = { class = "content" }, content = function()
    29       if member and member:has_voting_right_for_unit_id(unit.id) then
    30         if app.session.member_id == member.id then
    31           ui.tag{ content = _"You have voting privileges for this unit" }
    32           slot.put(" · ")
    33           if unit.delegation_info.first_trustee_id == nil then
    34             ui.link{ text = _"Delegate unit", module = "delegation", view = "show", params = { unit_id = unit.id } }
    35           else
    36             ui.link{ text = _"Change unit delegation", module = "delegation", view = "show", params = { unit_id = unit.id } }
    37           end
    38         else
    39           ui.tag{ content = _"Member has voting privileges for this unit" }
    40         end
    41       end
    42     end }
    43   else
    44     slot.put("<br />")
    45   end
    47 end }
