bsw/jbe@19: local initiative = param.get("initiative", "table") bsw/jbe@19: bsw/jbe@19: if not initiative then bsw/jbe@19: initiative = Initiative:new_selector():add_where{ "id = ?", param.get_id()}:single_object_mode():exec() bsw/jbe@19: end bsw/jbe@19: bsw/jbe@19: slot.select("actions", function() bsw/jbe@19: ui.link{ bsw/jbe@19: content = function() poelzi@149: local count = Initiative:new_selector():add_where{ "issue_id = ?", initiative.issue.id}:count()-1 bsw/jbe@19: ui.image{ static = "icons/16/script.png" } poelzi@149: if count and count > 0 then poelzi@149: slot.put(_("Show alternative initiatives (#{count})", {count=count})) poelzi@149: else poelzi@149: slot.put(_"Show alternative initiatives") poelzi@149: end bsw/jbe@19: end, bsw/jbe@19: module = "issue", bsw/jbe@19: view = "show", bsw/jbe@19: id = initiative.issue.id bsw/jbe@19: } bsw/jbe@19: end) bsw/jbe@19: bsw/jbe@19: execute.view{ bsw/jbe@19: module = "issue", bsw/jbe@19: view = "_show_head", poelzi@111: params = { issue = initiative.issue, poelzi@111: initiative = initiative } bsw/jbe@19: } bsw/jbe@19: bsw/jbe@19: --slot.put_into("html_head", '') bsw/jbe@19: bsw@51: if app.session.member_id then bsw@51: slot.select("actions", function() bsw@51: if not initiative.issue.fully_frozen and not initiative.issue.closed then bsw@51: ui.link{ bsw@51: image = { static = "icons/16/script_add.png" }, bsw@51: attr = { class = "action" }, bsw@51: text = _"Create alternative initiative", bsw@51: module = "initiative", bsw@51: view = "new", bsw@51: params = { issue_id = initiative.issue.id } bsw@51: } bsw@51: end bsw@51: end) bsw@51: end bsw/jbe@19: bsw@35: slot.put_into("sub_title", encode.html(_("Initiative: '#{name}'", { name = initiative.name }) )) bsw/jbe@19: bsw/jbe@19: execute.view{ bsw/jbe@19: module = "initiative", bsw/jbe@19: view = "show_partial", bsw/jbe@19: params = { bsw@23: initiative = initiative, bsw@23: expanded = true bsw/jbe@19: } bsw@31: }