liquid_feedback_frontend
diff app/main/lf2/_area.lua @ 217:73dbc9e2bfd4
Cummulative patch for enhancements at next generation frontend
author | bsw |
---|---|
date | Sat Mar 12 19:22:50 2011 +0100 (2011-03-12) |
parents | 1dab81353eb1 |
children |
line diff
1.1 --- a/app/main/lf2/_area.lua Mon Mar 07 12:15:22 2011 +0100 1.2 +++ b/app/main/lf2/_area.lua Sat Mar 12 19:22:50 2011 +0100 1.3 @@ -4,48 +4,46 @@ 1.4 1.5 local trustees = Member:new_selector() 1.6 :add_field("delegation_chain.*") 1.7 - :join("delegation_chain(" .. app.session.member_id .. ", " .. area.id .. ", NULL)", "delegation_chain", "member.id = delegation_chain.member_id") 1.8 + :join({ "delegation_chain(?, null, ?, null)", app.session.member_id, area.id }, "delegation_chain", "member.id = delegation_chain.member_id") 1.9 :add_order_by("index") 1.10 :exec() 1.11 1.12 + 1.13 ui.box{ class = "area", content = function() 1.14 - 1.15 ui.box_row{ class = "head", content = function() 1.16 - ui.box_col{ class = "head left name", content = area.name } 1.17 + ui.box_col{ class = "head left name", content = function() 1.18 + if membership then 1.19 + local text = _"You are member of this area" 1.20 + ui.image{ attr = { title = text, alt = text }, static = "lf2/icon_star.png" } 1.21 + else 1.22 + end 1.23 + slot.put(" ") 1.24 + ui.tag{ content = area.name } 1.25 + end } 1.26 ui.box_col{ class = "right", content = _("#{direct_count}+#{delegated_count} members", { 1.27 direct_count = area.direct_member_count, 1.28 delegated_count = area.member_weight - area.direct_member_count 1.29 } ) } 1.30 end } 1.31 1.32 - if area.description and #area.description > 0 then 1.33 - ui.box_row{ class = "description", content = function() ui.box_col{ content = area.description } end } 1.34 - end 1.35 - 1.36 if #trustees > 1 then 1.37 ui.box_row{ content = function() 1.38 ui.box_col{ class = "left", content = function() 1.39 execute.view{ module = "lf2", view = "_avatars", params = { members = trustees, arrows = true, size = "small" } } 1.40 end } 1.41 - if trustees[1].scope_out == "area" then 1.42 - text = _"Change or revoke area delegation" 1.43 - else 1.44 - text = _"Set area delegation" 1.45 - end 1.46 - ui.box_col{ class = "right", content = function() 1.47 - ui.link{ 1.48 - text = text, 1.49 - module = "lf2", view = "delegation", params = { area_id = area.id } 1.50 - } 1.51 - end } 1.52 end } 1.53 end 1.54 1.55 ui.box_row{ content = function() 1.56 ui.box_col{ class = "left", content = function() 1.57 if membership then 1.58 - ui.image{ static = "lf2/icon_star.png" } 1.59 - slot.put(" ", _"You are member of this area") 1.60 + ui.link{ 1.61 + module = "membership", action = "update", params = { area_id = area.id, delete = true }, 1.62 + routing = { default = { 1.63 + mode = "redirect", module = "lf2", view = "area", id = area.id 1.64 + } }, 1.65 + text = _"Give up area membership" 1.66 + } 1.67 else 1.68 ui.link{ 1.69 module = "membership", action = "update", params = { area_id = area.id }, 1.70 @@ -55,27 +53,21 @@ 1.71 text = _"Become a member of this area" 1.72 } 1.73 end 1.74 - end } 1.75 - ui.box_col{ class = "right", content = function() 1.76 - if membership then 1.77 - ui.link{ 1.78 - module = "membership", action = "update", params = { area_id = area.id, delete = true }, 1.79 - routing = { default = { 1.80 - mode = "redirect", module = "lf2", view = "area", id = area.id 1.81 - } }, 1.82 - text = _"Give up membership" 1.83 - } 1.84 - end 1.85 - if #trustees == 1 then 1.86 - if membership then 1.87 - slot.put(" · ") 1.88 - end 1.89 - ui.link{ 1.90 - text = _"Set area delegation", 1.91 - module = "lf2", view = "delegation", params = { area_id = area.id } 1.92 - } 1.93 - end 1.94 + slot.put(" · ") 1.95 + if trustees[1].scope_out == "area" then 1.96 + text = _"Change or revoke area delegation" 1.97 + else 1.98 + text = _"Set area delegation" 1.99 + end 1.100 + ui.link{ 1.101 + text = text, 1.102 + module = "lf2", view = "delegation", params = { area_id = area.id } 1.103 + } 1.104 end } 1.105 end } 1.106 1.107 + if area.description and #area.description > 0 then 1.108 +-- ui.box_row{ class = "description", content = function() ui.box_col{ content = area.description } end } 1.109 + end 1.110 + 1.111 end } 1.112 \ No newline at end of file