bsw/jbe@4: local issue = param.get("issue", "table") poelzi@111: local initiative = param.get("initiative", "table") bsw/jbe@4: bsw@51: local direct_voter bsw@51: bsw@51: if app.session.member_id then bsw@51: direct_voter = DirectVoter:by_pk(issue.id, app.session.member.id) bsw@51: end bsw/jbe@19: bsw/jbe@52: if config.feature_rss_enabled then bsw/jbe@52: util.html_rss_head{ title = _"Initiatives in this issue (last created first)", module = "initiative", view = "list_rss", params = { issue_id = issue.id } } bsw/jbe@52: util.html_rss_head{ title = _"Initiatives in this issue (last updated first)", module = "initiative", view = "list_rss", params = { issue_id = issue.id, order = "last_updated" } } bsw/jbe@52: end bsw/jbe@4: bsw/jbe@19: slot.select("title", function() bsw@271: ui.link{ bsw@271: content = _("Issue ##{id}", { id = issue.id }), bsw@271: module = "issue", bsw@271: view = "show", bsw@271: id = issue.id bsw@271: } bsw@273: slot.put(" · ") bsw/jbe@4: ui.link{ bsw/jbe@19: content = issue.area.name, bsw/jbe@4: module = "area", bsw/jbe@4: view = "show", bsw/jbe@4: id = issue.area.id bsw/jbe@4: } bsw@271: if not config.single_unit_id then bsw@271: slot.put(" · ") bsw@271: ui.link{ bsw@271: content = issue.area.unit.name, bsw@301: module = "unit", bsw@301: view = "show", bsw@301: id = issue.area.unit_id bsw@271: } bsw@271: end bsw/jbe@5: end) bsw/jbe@5: bsw/jbe@4: bsw@271: slot.select("title2", function() bsw@271: ui.tag{ bsw@271: tag = "div", bsw@317: attr = { class = "issue_policy_info" }, bsw@271: content = function() bsw@272: bsw@272: ui.link{ bsw@272: text = issue.policy.name, bsw@272: module = "policy", bsw@272: view = "show", bsw@272: id = issue.policy.id bsw@272: } bsw@272: bsw@271: slot.put(" · ") bsw@271: ui.tag{ content = issue.state_name } bsw@271: bsw@273: if issue.state_time_left then bsw@273: slot.put(" · ") bsw@346: ui.tag{ content = _("#{time_left} left", { bsw@346: time_left = issue.state_time_left:gsub("days", _"days"):gsub("day", _"day") bsw@346: }) } bsw@271: end bsw@271: bsw@271: end bsw@271: } bsw@271: bsw@271: bsw@271: end) bsw@271: bsw/jbe@4: slot.select("actions", function() bsw/jbe@5: bsw@51: if app.session.member_id then bsw@51: bsw@281: if issue.state == 'voting' and app.session.member:has_voting_right_for_unit_id(issue.area.unit_id) then bsw@51: local text bsw@51: if not direct_voter then bsw@51: text = _"Vote now" bsw@51: else bsw@51: text = _"Change vote" bsw@51: end bsw@51: ui.link{ bsw@51: content = function() bsw@51: ui.image{ static = "icons/16/email_open.png" } bsw@51: slot.put(text) bsw@51: end, bsw@51: module = "vote", bsw@51: view = "list", bsw@51: params = { issue_id = issue.id } bsw@51: } bsw/jbe@19: end bsw/jbe@5: bsw/jbe@5: execute.view{ bsw@51: module = "interest", bsw/jbe@5: view = "_show_box", bsw@339: params = { issue = issue, initiative = initiative } bsw/jbe@5: } bsw@7: bsw@51: if not issue.closed then bsw@51: execute.view{ bsw@51: module = "delegation", bsw@51: view = "_show_box", poelzi@111: params = { issue_id = issue.id, poelzi@111: initiative_id = initiative and initiative.id or nil} bsw@51: } bsw@51: end bsw@51: bsw@51: end bsw/jbe@4: bsw@10: if config.issue_discussion_url_func then bsw@10: local url = config.issue_discussion_url_func(issue) bsw@10: ui.link{ bsw@10: attr = { target = "_blank" }, bsw@10: external = url, bsw@10: content = function() bsw@10: ui.image{ static = "icons/16/comments.png" } bsw@10: slot.put(_"Discussion on issue") bsw@10: end, bsw@10: } bsw@10: end bsw@286: bsw@286: if config.etherpad and app.session.member then bsw@286: local url = config.etherpad.base_url .. "p/" .. config.etherpad.group_id .. "$Issue" .. issue.id bsw@286: ui.link{ bsw@286: attr = { target = "_blank" }, bsw@286: external = url, bsw@286: content = function() bsw@286: ui.image{ static = "icons/16/comments.png" } bsw@286: slot.put(_"Issue pad") bsw@286: end, bsw@286: } bsw@286: end bsw@286: bsw/jbe@4: end) bsw/jbe@4: bsw@281: if app.session.member_id and app.session.member:has_voting_right_for_unit_id(issue.area.unit_id) then bsw@272: slot.select("actions", function() bsw@272: if not issue.fully_frozen and not issue.closed then bsw@272: ui.link{ bsw@272: image = { static = "icons/16/script_add.png" }, bsw@272: attr = { class = "action" }, bsw@272: text = _"Create alternative initiative", bsw@272: module = "initiative", bsw@272: view = "new", bsw@272: params = { issue_id = issue.id } bsw@272: } bsw@272: end bsw@272: end) bsw@272: end bsw/jbe@4: bsw@271: local issue = param.get("issue", "table") bsw@271: bsw@60: if config.public_access_issue_head and not app.session.member_id then bsw@60: config.public_access_issue_head(issue) bsw@60: end bsw/jbe@6: bsw@281: if app.session.member_id and issue.state == 'voting' and not direct_voter bsw@281: and app.session.member:has_voting_right_for_unit_id(issue.area.unit_id) bsw@281: then bsw/jbe@6: ui.container{ bsw/jbe@6: attr = { class = "voting_active_info" }, bsw/jbe@6: content = function() bsw/jbe@6: slot.put(_"Voting for this issue is currently running!") bsw/jbe@6: slot.put(" ") bsw@51: if app.session.member_id then bsw@51: ui.link{ bsw@51: content = function() bsw@51: slot.put(_"Vote now") bsw@51: end, bsw@51: module = "vote", bsw@51: view = "list", bsw@51: params = { issue_id = issue.id } bsw@51: } bsw@51: end bsw/jbe@6: end bsw/jbe@6: } bsw/jbe@6: slot.put("
") bsw/jbe@6: end bsw/jbe@6: