bsw/jbe@19: local initiative = param.get("initiative", "table") bsw/jbe@19: local initiator = param.get("initiator", "table") bsw/jbe@19: local initiators_members_selector = param.get("initiators_members_selector", "table") bsw/jbe@19: bsw/jbe@19: local initiator_count = initiators_members_selector:count() bsw/jbe@19: bsw/jbe@19: if initiator and initiator.accepted and not initiative.issue.fully_frozen and not initiative.issue.closed and not initiative.revoked then bsw/jbe@19: ui.link{ bsw/jbe@19: attr = { class = "action" }, bsw/jbe@19: content = function() bsw/jbe@19: ui.image{ static = "icons/16/user_add.png" } bsw/jbe@19: slot.put(_"Invite initiator") bsw/jbe@19: end, bsw/jbe@19: module = "initiative", bsw/jbe@19: view = "add_initiator", bsw/jbe@19: params = { initiative_id = initiative.id } bsw/jbe@19: } bsw/jbe@19: if initiator_count > 1 then bsw/jbe@19: ui.link{ bsw/jbe@19: content = function() bsw/jbe@19: ui.image{ static = "icons/16/user_delete.png" } bsw/jbe@19: slot.put(_"Remove initiator") bsw/jbe@19: end, bsw/jbe@19: module = "initiative", bsw/jbe@19: view = "remove_initiator", bsw/jbe@19: params = { initiative_id = initiative.id } bsw/jbe@19: } bsw/jbe@19: end bsw/jbe@19: end bsw/jbe@19: if initiator and initiator.accepted == false then bsw/jbe@19: ui.link{ bsw/jbe@19: image = { static = "icons/16/user_delete.png" }, bsw/jbe@19: text = _"Cancel refuse of invitation", bsw/jbe@19: module = "initiative", bsw/jbe@19: action = "remove_initiator", bsw/jbe@19: params = { bsw/jbe@19: initiative_id = initiative.id, bsw/jbe@19: member_id = app.session.member.id bsw/jbe@19: }, bsw/jbe@19: routing = { bsw/jbe@19: ok = { bsw/jbe@19: mode = "redirect", bsw/jbe@19: module = "initiative", bsw/jbe@19: view = "show", bsw/jbe@19: id = initiative.id bsw/jbe@19: } bsw/jbe@19: } bsw/jbe@19: } bsw/jbe@19: end bsw/jbe@19: bsw/jbe@19: execute.view{ bsw/jbe@19: module = "member", bsw/jbe@19: view = "_list", bsw/jbe@19: params = { bsw/jbe@19: members_selector = initiators_members_selector, bsw/jbe@19: initiator = initiator bsw/jbe@19: } bsw/jbe@19: }