# HG changeset patch # User bsw # Date 1330451951 -3600 # Node ID f8481330f4c259e9efc0c194775ec1741351a208 # Parent 79d8e2d3502175a9bf63d7ccc1db059560efeeed Route user back to initiative after set/remove interest or delegation diff -r 79d8e2d35021 -r f8481330f4c2 app/main/delegation/new.lua --- a/app/main/delegation/new.lua Tue Feb 28 18:58:29 2012 +0100 +++ b/app/main/delegation/new.lua Tue Feb 28 18:59:11 2012 +0100 @@ -75,9 +75,9 @@ routing = { default = { mode = "redirect", - module = area and "area" or issue and "issue" or "unit", + module = area and "area" or initiative and "initiative" or issue and "issue" or "unit", view = "show", - id = area and area.id or issue and issue.id or unit.id + id = area and area.id or initiative and initiative.id or issue and issue.id or unit.id } }, content = function() diff -r 79d8e2d35021 -r f8481330f4c2 app/main/interest/_show_box.lua --- a/app/main/interest/_show_box.lua Tue Feb 28 18:58:29 2012 +0100 +++ b/app/main/interest/_show_box.lua Tue Feb 28 18:59:11 2012 +0100 @@ -1,5 +1,6 @@ local issue = param.get("issue", "table") +local initiative = param.get("initiative", "table") local interest = Interest:by_pk(issue.id, app.session.member.id) local membership = Membership:by_pk(issue.area_id, app.session.member_id) @@ -29,7 +30,7 @@ module = "interest", action = "update", params = { issue_id = issue.id, delete = true }, - routing = { default = { mode = "redirect", module = "issue", view = "show", id = issue.id } } + routing = { default = { mode = "redirect", module = initiative and "initiative" or "issue", view = "show", id = initiative and initiative.id or issue.id } } } end end @@ -42,7 +43,7 @@ module = "interest", action = "update", params = { issue_id = issue.id }, - routing = { default = { mode = "redirect", module = "issue", view = "show", id = issue.id } } + routing = { default = { mode = "redirect", module = initiative and "initiative" or "issue", view = "show", id = initiative and initiative.id or issue.id } } } end end diff -r 79d8e2d35021 -r f8481330f4c2 app/main/issue/_show_head.lua --- a/app/main/issue/_show_head.lua Tue Feb 28 18:58:29 2012 +0100 +++ b/app/main/issue/_show_head.lua Tue Feb 28 18:59:11 2012 +0100 @@ -90,7 +90,7 @@ execute.view{ module = "interest", view = "_show_box", - params = { issue = issue } + params = { issue = issue, initiative = initiative } } if not issue.closed then