bsw/jbe@0: bsw/jbe@0: local issue = param.get("issue", "table") bsw@339: local initiative = param.get("initiative", "table") bsw/jbe@0: bsw/jbe@4: local interest = Interest:by_pk(issue.id, app.session.member.id) bsw@173: local membership = Membership:by_pk(issue.area_id, app.session.member_id) bsw/jbe@0: bsw@277: slot.select("interest", function() bsw@277: if interest then bsw/jbe@0: bsw/jbe@0: ui.container{ bsw/jbe@0: content = function() bsw/jbe@4: ui.container{ bsw/jbe@4: attr = { bsw@243: class = "head head_active", bsw/jbe@4: }, bsw/jbe@4: content = function() bsw/jbe@5: ui.image{ bsw/jbe@5: static = "icons/16/eye.png" bsw/jbe@5: } bsw/jbe@4: slot.put(_"Your are interested") bsw/jbe@19: bsw/jbe@4: end bsw/jbe@0: } bsw@277: bsw@277: if issue.state ~= "finished" and issue.state ~= "cancelled" and issue.state ~= "voting" then bsw@277: ui.link{ bsw@277: image = { static = "icons/16/cross.png" }, bsw@277: text = _"Withdraw interest", bsw@277: module = "interest", bsw@277: action = "update", bsw@277: params = { issue_id = issue.id, delete = true }, bsw@339: routing = { default = { mode = "redirect", module = initiative and "initiative" or "issue", view = "show", id = initiative and initiative.id or issue.id } } bsw@277: } bsw@277: end bsw/jbe@0: end bsw/jbe@4: } bsw@281: elseif app.session.member:has_voting_right_for_unit_id(issue.area.unit_id) then bsw@277: if not issue.closed and not issue.fully_frozen then bsw@277: ui.link{ bsw@277: image = { static = "icons/16/user_add.png" }, bsw@277: text = _"Add my interest", bsw@277: module = "interest", bsw@277: action = "update", bsw@277: params = { issue_id = issue.id }, bsw@339: routing = { default = { mode = "redirect", module = initiative and "initiative" or "issue", view = "show", id = initiative and initiative.id or issue.id } } bsw@277: } bsw@277: end bsw@16: end bsw@277: end)