liquid_feedback_frontend
changeset 339:f8481330f4c2
Route user back to initiative after set/remove interest or delegation
author | bsw |
---|---|
date | Tue Feb 28 18:59:11 2012 +0100 (2012-02-28) |
parents | 79d8e2d35021 |
children | 65561f115d26 |
files | app/main/delegation/new.lua app/main/interest/_show_box.lua app/main/issue/_show_head.lua |
line diff
1.1 --- a/app/main/delegation/new.lua Tue Feb 28 18:58:29 2012 +0100 1.2 +++ b/app/main/delegation/new.lua Tue Feb 28 18:59:11 2012 +0100 1.3 @@ -75,9 +75,9 @@ 1.4 routing = { 1.5 default = { 1.6 mode = "redirect", 1.7 - module = area and "area" or issue and "issue" or "unit", 1.8 + module = area and "area" or initiative and "initiative" or issue and "issue" or "unit", 1.9 view = "show", 1.10 - id = area and area.id or issue and issue.id or unit.id 1.11 + id = area and area.id or initiative and initiative.id or issue and issue.id or unit.id 1.12 } 1.13 }, 1.14 content = function()
2.1 --- a/app/main/interest/_show_box.lua Tue Feb 28 18:58:29 2012 +0100 2.2 +++ b/app/main/interest/_show_box.lua Tue Feb 28 18:59:11 2012 +0100 2.3 @@ -1,5 +1,6 @@ 2.4 2.5 local issue = param.get("issue", "table") 2.6 +local initiative = param.get("initiative", "table") 2.7 2.8 local interest = Interest:by_pk(issue.id, app.session.member.id) 2.9 local membership = Membership:by_pk(issue.area_id, app.session.member_id) 2.10 @@ -29,7 +30,7 @@ 2.11 module = "interest", 2.12 action = "update", 2.13 params = { issue_id = issue.id, delete = true }, 2.14 - routing = { default = { mode = "redirect", module = "issue", view = "show", id = issue.id } } 2.15 + routing = { default = { mode = "redirect", module = initiative and "initiative" or "issue", view = "show", id = initiative and initiative.id or issue.id } } 2.16 } 2.17 end 2.18 end 2.19 @@ -42,7 +43,7 @@ 2.20 module = "interest", 2.21 action = "update", 2.22 params = { issue_id = issue.id }, 2.23 - routing = { default = { mode = "redirect", module = "issue", view = "show", id = issue.id } } 2.24 + routing = { default = { mode = "redirect", module = initiative and "initiative" or "issue", view = "show", id = initiative and initiative.id or issue.id } } 2.25 } 2.26 end 2.27 end
3.1 --- a/app/main/issue/_show_head.lua Tue Feb 28 18:58:29 2012 +0100 3.2 +++ b/app/main/issue/_show_head.lua Tue Feb 28 18:59:11 2012 +0100 3.3 @@ -90,7 +90,7 @@ 3.4 execute.view{ 3.5 module = "interest", 3.6 view = "_show_box", 3.7 - params = { issue = issue } 3.8 + params = { issue = issue, initiative = initiative } 3.9 } 3.10 3.11 if not issue.closed then