# HG changeset patch # User bsw # Date 1340142133 -7200 # Node ID e7baf2713987c9db0864f0883a732421b6d3ab4e # Parent b8e72db6dd0dd892cc219bc8a83351d8c08884f4 Make direct delegation to initiator work again diff -r b8e72db6dd0d -r e7baf2713987 app/main/delegation/show.lua --- a/app/main/delegation/show.lua Tue Jun 19 23:37:20 2012 +0200 +++ b/app/main/delegation/show.lua Tue Jun 19 23:42:13 2012 +0200 @@ -169,16 +169,11 @@ } end - -- add saved members + -- add current trustee if current_trustee_id then records[#records+1] = {id="_", name= "--- " .. _"Current trustee" .. " ---"} records[#records+1] = { id = current_trustee_id, name = current_trustee_name } end - -- add saved members - records[#records+1] = {id="_", name= "--- " .. _"Saved contacts" .. " ---"} - for i, record in ipairs(contact_members) do - records[#records+1] = record - end -- add initiative authors if initiative then records[#records+1] = {id="_", name= "--- " .. _"Initiators" .. " ---"} @@ -186,6 +181,11 @@ records[#records+1] = record.member end end + -- add saved members + records[#records+1] = {id="_", name= "--- " .. _"Saved contacts" .. " ---"} + for i, record in ipairs(contact_members) do + records[#records+1] = record + end disabled_records = {} disabled_records["_"] = true diff -r b8e72db6dd0d -r e7baf2713987 app/main/initiative/_show.lua --- a/app/main/initiative/_show.lua Tue Jun 19 23:37:20 2012 +0200 +++ b/app/main/initiative/_show.lua Tue Jun 19 23:42:13 2012 +0200 @@ -19,7 +19,8 @@ view = "_show", params = { issue = initiative.issue, - initiative_limit = 3 + initiative_limit = 3, + for_initiative = initiative } } end) diff -r b8e72db6dd0d -r e7baf2713987 app/main/issue/_show.lua --- a/app/main/issue/_show.lua Tue Jun 19 23:37:20 2012 +0200 +++ b/app/main/issue/_show.lua Tue Jun 19 23:42:13 2012 +0200 @@ -1,6 +1,8 @@ local issue = param.get("issue", "table") local initiative_limit = param.get("initiative_limit", atom.integer) local for_listing = param.get("for_listing", atom.boolean) +local for_initiative = param.get("for_initiative", "table") +local for_initiative_id = for_initiative and for_initiative.id or nil local direct_voter if app.session.member_id then @@ -133,9 +135,9 @@ if not issue.closed and app.session.member_id and app.session.member:has_voting_right_for_unit_id(issue.area.unit_id) then if issue.member_info.own_delegation_scope ~= "issue" then - links[#links+1] = { text = _"Delegate issue", module = "delegation", view = "show", params = { issue_id = issue.id } } + links[#links+1] = { text = _"Delegate issue", module = "delegation", view = "show", params = { issue_id = issue.id, initiative_id = for_initiative_id } } else - links[#links+1] = { text = _"Change issue delegation", module = "delegation", view = "show", params = { issue_id = issue.id } } + links[#links+1] = { text = _"Change issue delegation", module = "delegation", view = "show", params = { issue_id = issue.id, initiative_id = for_initiative_id } } end end