liquid_feedback_frontend
diff app/main/membership/_show_box.lua @ 525:63d6549cc00b
Delegation chain preview improved, better visualisation of current context, code cleanup
author | bsw |
---|---|
date | Fri May 18 19:07:07 2012 +0200 (2012-05-18) |
parents | b77e6a17ca77 |
children |
line diff
1.1 --- a/app/main/membership/_show_box.lua Tue Apr 17 00:07:04 2012 +0200 1.2 +++ b/app/main/membership/_show_box.lua Fri May 18 19:07:07 2012 +0200 1.3 @@ -2,46 +2,43 @@ 1.4 1.5 local membership = Membership:by_pk(area.id, app.session.member.id) 1.6 1.7 -slot.select("interest", function() 1.8 +if membership then 1.9 1.10 - if membership then 1.11 + ui.container{ 1.12 + attr = { 1.13 + class = "head head_active", 1.14 + }, 1.15 + content = function() 1.16 + ui.image{ 1.17 + static = "icons/16/user_green.png" 1.18 + } 1.19 + slot.put(_"You are member") 1.20 + end 1.21 + } 1.22 1.23 - ui.container{ 1.24 - attr = { 1.25 - class = "head head_active", 1.26 - }, 1.27 - content = function() 1.28 - ui.image{ 1.29 - static = "icons/16/user_green.png" 1.30 - } 1.31 - slot.put(_"You are member") 1.32 - end 1.33 - } 1.34 - 1.35 - ui.link{ 1.36 - image = { static = "icons/16/cross.png" }, 1.37 - text = _"Withdraw membership", 1.38 - module = "membership", 1.39 - action = "update", 1.40 - params = { area_id = area.id, delete = true }, 1.41 - routing = { default = { mode = "redirect", module = "area", view = "show", id = area.id } } 1.42 - } 1.43 - elseif app.session.member:has_voting_right_for_unit_id(area.unit_id) then 1.44 - ui.link{ 1.45 - image = { static = "icons/16/user_add.png" }, 1.46 - text = _"Become a member", 1.47 - module = "membership", 1.48 - action = "update", 1.49 - params = { area_id = area.id }, 1.50 - routing = { 1.51 - default = { 1.52 - mode = "redirect", 1.53 - module = "area", 1.54 - view = "show", 1.55 - id = area.id 1.56 - } 1.57 + ui.link{ 1.58 + image = { static = "icons/16/cross.png" }, 1.59 + text = _"Withdraw membership", 1.60 + module = "membership", 1.61 + action = "update", 1.62 + params = { area_id = area.id, delete = true }, 1.63 + routing = { default = { mode = "redirect", module = "area", view = "show", id = area.id } } 1.64 + } 1.65 +elseif app.session.member:has_voting_right_for_unit_id(area.unit_id) then 1.66 + ui.link{ 1.67 + image = { static = "icons/16/user_add.png" }, 1.68 + text = _"Become a member", 1.69 + module = "membership", 1.70 + action = "update", 1.71 + params = { area_id = area.id }, 1.72 + routing = { 1.73 + default = { 1.74 + mode = "redirect", 1.75 + module = "area", 1.76 + view = "show", 1.77 + id = area.id 1.78 } 1.79 } 1.80 - end 1.81 + } 1.82 +end 1.83 1.84 -end)