liquid_feedback_frontend
diff app/main/unit/_head.lua @ 1045:701a5cf6b067
Imported LiquidFeedback Frontend 3.0 branch
author | bsw |
---|---|
date | Thu Jul 10 01:19:48 2014 +0200 (2014-07-10) |
parents | b68880106e7e |
children | 32cc544d5a5b |
line diff
1.1 --- a/app/main/unit/_head.lua Thu Jul 10 01:02:43 2014 +0200 1.2 +++ b/app/main/unit/_head.lua Thu Jul 10 01:19:48 2014 +0200 1.3 @@ -1,49 +1,32 @@ 1.4 local unit = param.get("unit", "table") 1.5 -local member = param.get("member", "table") 1.6 - 1.7 -local show_content = param.get("show_content", atom.boolean) 1.8 1.9 -if app.session.member_id then 1.10 - unit:load_delegation_info_once_for_member_id(app.session.member_id) 1.11 -end 1.12 - 1.13 -ui.container{ attr = { class = "unit_head" }, content = function() 1.14 +ui.title ( function () 1.15 1.16 - execute.view{ module = "delegation", view = "_info", params = { unit = unit, member = member } } 1.17 + ui.tag{ attr = { class = "unit" }, content = function() 1.18 + -- unit link 1.19 + ui.link { 1.20 + attr = { class = "unit" }, 1.21 + content = function() 1.22 + ui.tag{ attr = { class = "name" }, content = unit.name } 1.23 + end, 1.24 + module = "unit", view = "show", 1.25 + id = unit.id 1.26 + } 1.27 1.28 - ui.container{ attr = { class = "title" }, content = function() 1.29 - if not config.single_unit_id then 1.30 - ui.link{ 1.31 - module = "unit", view = "show", id = unit.id, 1.32 - attr = { class = "unit_name" }, content = unit.name 1.33 + execute.view { 1.34 + module = "delegation", view = "_info", params = { 1.35 + unit = unit, member = member 1.36 } 1.37 - else 1.38 - ui.link{ 1.39 - module = "unit", view = "show", id = unit.id, 1.40 - attr = { class = "unit_name" }, content = _"LiquidFeedback" .. " · " .. config.instance_name 1.41 + } 1.42 + 1.43 + if config.single_unit_id and not app.session.member_id and config.motd_public then 1.44 + ui.container{ 1.45 + attr = { class = "wiki motd" }, 1.46 + content = function() 1.47 + slot.put(config.motd_public) 1.48 + end 1.49 } 1.50 end 1.51 end } 1.52 - 1.53 - if show_content then 1.54 - ui.container{ attr = { class = "content" }, content = function() 1.55 - 1.56 - if member and member:has_voting_right_for_unit_id(unit.id) then 1.57 - if app.session.member_id == member.id then 1.58 - ui.tag{ content = _"You have voting privileges for this unit" } 1.59 - slot.put(" · ") 1.60 - if unit.delegation_info.first_trustee_id == nil then 1.61 - ui.link{ text = _"Delegate unit", module = "delegation", view = "show", params = { unit_id = unit.id } } 1.62 - else 1.63 - ui.link{ text = _"Change unit delegation", module = "delegation", view = "show", params = { unit_id = unit.id } } 1.64 - end 1.65 - else 1.66 - ui.tag{ content = _"Member has voting privileges for this unit" } 1.67 - end 1.68 - end 1.69 - end } 1.70 - else 1.71 - slot.put("<br />") 1.72 - end 1.73 - 1.74 -end } 1.75 + 1.76 +end ) 1.77 \ No newline at end of file