# HG changeset patch # User bsw # Date 1360346038 -3600 # Node ID dfc7b75189ed2b7bf08ac8ab3b78dc297a18d281 # Parent 2141aef04ad7a5863bb537cea399e8f9485b6a97 Use "admitted" flag as primary sort key for initiatives diff -r 2141aef04ad7 -r dfc7b75189ed app/main/event/_list.lua --- a/app/main/event/_list.lua Thu Feb 07 23:48:50 2013 +0100 +++ b/app/main/event/_list.lua Fri Feb 08 18:53:58 2013 +0100 @@ -166,7 +166,7 @@ if not event.initiative_id then local initiatives_selector = Initiative:new_selector() :add_where{ "initiative.issue_id = ?", event.issue_id } - :add_order_by("initiative.rank, initiative.harmonic_weight DESC NULLS LAST, id") + :add_order_by("initiative.admitted DESC, initiative.rank, initiative.harmonic_weight DESC NULLS LAST, id") execute.view{ module = "initiative", view = "_list", params = { issue = event.issue, initiatives_selector = initiatives_selector, diff -r 2141aef04ad7 -r dfc7b75189ed model/issue.lua --- a/model/issue.lua Thu Feb 07 23:48:50 2013 +0100 +++ b/model/issue.lua Fri Feb 08 18:53:58 2013 +0100 @@ -37,7 +37,7 @@ that_key = 'issue_id', ref = 'initiatives', back_ref = 'issue', - default_order = 'initiative.rank, initiative.harmonic_weight DESC NULLS LAST, id' + default_order = 'initiative.admitted DESC, initiative.rank, initiative.harmonic_weight DESC NULLS LAST, id' } Issue:add_reference{