Change the order in which votes are displayed to be in the order they were selected by the voter

Note that the `budget` parameter was added to the `delete_path` method
so it works in the tests; on production, it worked because this
component is only rendered on pages which already have the `budget`
parameter.

Co-authored-by: Javi Martín <javim@elretirao.net>
This commit is contained in:
CoslaJohn
2024-03-28 09:51:33 +00:00
committed by Javi Martín
parent 05a6021938
commit c4d8c92ae2
7 changed files with 87 additions and 5 deletions

View File

@@ -28,6 +28,6 @@ class Budgets::Ballot::BallotComponent < ApplicationComponent
end
def group_investments(group)
ballot.investments.by_group(group.id)
ballot.investments.by_group(group.id).sort_by_ballot_lines
end
end

View File

@@ -18,6 +18,6 @@ class Budgets::Ballot::InvestmentForSidebarComponent < Budgets::Ballot::Investme
end
def delete_path
budget_ballot_line_path(id: investment.id, investments_ids: investment_ids)
budget_ballot_line_path(budget, id: investment.id, investments_ids: investment_ids)
end
end

View File

@@ -20,6 +20,6 @@ class Budgets::Investments::MyBallotComponent < ApplicationComponent
end
def investments
ballot.investments.by_heading(heading.id)
ballot.investments.by_heading(heading.id).sort_by_ballot_lines
end
end