liquid_feedback_frontend

annotate app/main/lf2/_initiative_support.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 7ea52c710503
rev   line source
bsw@215 1 local initiative = param.get("initiative", "table")
bsw@215 2 local supporter = Supporter:by_pk(initiative.id, app.session.member.id)
bsw@215 3
bsw@215 4 local routing = {
bsw@215 5 default = {
bsw@215 6 mode = "redirect",
bsw@215 7 module = "lf2",
bsw@215 8 view = "initiative",
bsw@215 9 id = initiative.id
bsw@215 10 }
bsw@215 11 }
bsw@215 12
bsw@215 13 if not initiative.issue.fully_frozen and not initiative.issue.closed then
bsw@215 14 ui.box_row{ content = function()
bsw@215 15 if supporter then
bsw@215 16 ui.box_col{ class = "left", content = function()
bsw@215 17 if not supporter:has_critical_opinion() then
bsw@215 18 ui.image{ static = "lf2/icon_star.png" }
bsw@215 19 slot.put(" ")
bsw@215 20 ui.tag{ content = _"Your are supporter" }
bsw@215 21 else
bsw@215 22 ui.image{ static = "lf2/icon_star.png" }
bsw@215 23 slot.put(" ")
bsw@215 24 ui.tag{ content = _"Your are potential supporter" }
bsw@215 25 end
bsw@215 26 end }
bsw@215 27 ui.box_col{ class = "right", content = function()
bsw@215 28 ui.link{
bsw@215 29 text = _"Remove support",
bsw@215 30 module = "initiative",
bsw@215 31 action = "remove_support",
bsw@215 32 id = initiative.id,
bsw@215 33 routing = routing,
bsw@215 34 }
bsw@215 35 end }
bsw@215 36 elseif not initiative.revoked then
bsw@215 37 ui.box_col{ content = function()
bsw@215 38 ui.image{ static = "lf2/icon_star_grey.png" }
bsw@215 39 slot.put(" ")
bsw@215 40 ui.link{
bsw@215 41 text = _"Support this initiative",
bsw@215 42 module = "initiative",
bsw@215 43 action = "add_support",
bsw@215 44 id = initiative.id,
bsw@215 45 routing = routing
bsw@215 46 }
bsw@215 47 end }
bsw@215 48 end
bsw@215 49 end }
bsw@215 50 end
bsw@215 51

Impressum / About Us