liquid_feedback_frontend
diff app/main/lf2/_initiative_support.lua @ 215:1dab81353eb1
More enhancements for second generation frontend
| author | bsw |
|---|---|
| date | Sat Mar 05 15:34:17 2011 +0100 (2011-03-05) |
| parents | |
| children | 7ea52c710503 |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/app/main/lf2/_initiative_support.lua Sat Mar 05 15:34:17 2011 +0100 1.3 @@ -0,0 +1,51 @@ 1.4 +local initiative = param.get("initiative", "table") 1.5 +local supporter = Supporter:by_pk(initiative.id, app.session.member.id) 1.6 + 1.7 +local routing = { 1.8 + default = { 1.9 + mode = "redirect", 1.10 + module = "lf2", 1.11 + view = "initiative", 1.12 + id = initiative.id 1.13 + } 1.14 +} 1.15 + 1.16 +if not initiative.issue.fully_frozen and not initiative.issue.closed then 1.17 + ui.box_row{ content = function() 1.18 + if supporter then 1.19 + ui.box_col{ class = "left", content = function() 1.20 + if not supporter:has_critical_opinion() then 1.21 + ui.image{ static = "lf2/icon_star.png" } 1.22 + slot.put(" ") 1.23 + ui.tag{ content = _"Your are supporter" } 1.24 + else 1.25 + ui.image{ static = "lf2/icon_star.png" } 1.26 + slot.put(" ") 1.27 + ui.tag{ content = _"Your are potential supporter" } 1.28 + end 1.29 + end } 1.30 + ui.box_col{ class = "right", content = function() 1.31 + ui.link{ 1.32 + text = _"Remove support", 1.33 + module = "initiative", 1.34 + action = "remove_support", 1.35 + id = initiative.id, 1.36 + routing = routing, 1.37 + } 1.38 + end } 1.39 + elseif not initiative.revoked then 1.40 + ui.box_col{ content = function() 1.41 + ui.image{ static = "lf2/icon_star_grey.png" } 1.42 + slot.put(" ") 1.43 + ui.link{ 1.44 + text = _"Support this initiative", 1.45 + module = "initiative", 1.46 + action = "add_support", 1.47 + id = initiative.id, 1.48 + routing = routing 1.49 + } 1.50 + end } 1.51 + end 1.52 + end } 1.53 +end 1.54 +