bsw@16: local issue = param.get("issue", "table") bsw@16: bsw@16: bsw@16: if issue.closed and issue.half_frozen then bsw@16: return bsw@16: end bsw@16: bsw@16: local interest = Interest:by_pk(issue.id, app.session.member.id) bsw@16: bsw@16: if not interest then bsw@16: return bsw@16: end bsw@16: bsw@16: if interest.voting_requested ~= nil then bsw@16: slot.select("actions", function() bsw@16: bsw@16: ui.container{ bsw@16: attr = { class = "voting_requested vote_info"}, bsw@16: content = function() bsw@16: ui.container{ bsw@16: attr = { bsw@16: class = "head head_active", bsw@16: onclick = "document.getElementById('voting_requested_content').style.display = 'block';" bsw@16: }, bsw@16: content = function() bsw@16: if interest.voting_requested == false then bsw@16: ui.image{ bsw@16: static = "icons/16/clock_play.png" bsw@16: } bsw@16: slot.put(_"You want to vote later") bsw@16: ui.image{ bsw@16: static = "icons/16/dropdown.png" bsw@16: } bsw@16: end bsw@16: end bsw@16: } bsw@16: ui.container{ bsw@16: attr = { class = "content", id = "voting_requested_content" }, bsw@16: content = function() bsw@16: ui.container{ bsw@16: attr = { bsw@16: class = "close", bsw@16: style = "cursor: pointer;", bsw@16: onclick = "document.getElementById('voting_requested_content').style.display = 'none';" bsw@16: }, bsw@16: content = function() bsw@16: ui.image{ static = "icons/16/cross.png" } bsw@16: end bsw@16: } bsw@16: ui.link{ bsw/jbe@19: text = _"Remove my request to vote later", bsw/jbe@19: module = "interest", bsw/jbe@19: action = "update_voting_requested", bsw/jbe@19: params = { issue_id = issue.id, voting_requested = nil }, bsw@16: routing = { default = { mode = "redirect", module = "issue", view = "show", id = issue.id } } bsw@16: } bsw@16: slot.put("
") bsw@16: end bsw@16: } bsw@16: end bsw@16: } bsw@16: end) bsw@16: else bsw@16: if not issue.closed and not issue.half_frozen then bsw@16: ui.link{ bsw/jbe@19: image = { static = "icons/16/clock_play.png" }, bsw/jbe@19: text = _"Vote later", bsw@16: module = "interest", bsw@16: action = "update_voting_requested", bsw@16: params = { bsw@16: issue_id = issue.id, bsw@16: voting_requested = false bsw@16: }, bsw@16: routing = { default = { mode = "redirect", module = "issue", view = "show", id = issue.id } } bsw@16: } bsw@16: end bsw@16: end