bsw@215: local initiative = param.get("initiative", "table") bsw@215: local supporter = Supporter:by_pk(initiative.id, app.session.member.id) bsw@215: bsw@215: local routing = { bsw@215: default = { bsw@215: mode = "redirect", bsw@215: module = "lf2", bsw@215: view = "initiative", bsw@215: id = initiative.id bsw@215: } bsw@215: } bsw@215: bsw@215: if not initiative.issue.fully_frozen and not initiative.issue.closed then bsw@215: ui.box_row{ content = function() bsw@215: if supporter then bsw@215: ui.box_col{ class = "left", content = function() bsw@215: if not supporter:has_critical_opinion() then bsw@215: ui.image{ static = "lf2/icon_star.png" } bsw@215: slot.put(" ") bsw@215: ui.tag{ content = _"Your are supporter" } bsw@215: else bsw@215: ui.image{ static = "lf2/icon_star.png" } bsw@215: slot.put(" ") bsw@215: ui.tag{ content = _"Your are potential supporter" } bsw@215: end bsw@218: slot.put(" · ") bsw@215: ui.link{ bsw@218: text = _"revoke", bsw@215: module = "initiative", bsw@215: action = "remove_support", bsw@215: id = initiative.id, bsw@215: routing = routing, bsw@215: } bsw@215: end } bsw@215: elseif not initiative.revoked then bsw@215: ui.box_col{ content = function() bsw@215: ui.image{ static = "lf2/icon_star_grey.png" } bsw@215: slot.put(" ") bsw@215: ui.link{ bsw@215: text = _"Support this initiative", bsw@215: module = "initiative", bsw@215: action = "add_support", bsw@215: id = initiative.id, bsw@215: routing = routing bsw@215: } bsw@215: end } bsw@215: end bsw@215: end } bsw@215: end bsw@215: