diff --git a/app/controllers/budgets_controller.rb b/app/controllers/budgets_controller.rb index 385734121..6d3b5e154 100644 --- a/app/controllers/budgets_controller.rb +++ b/app/controllers/budgets_controller.rb @@ -14,7 +14,7 @@ class BudgetsController < ApplicationController end def index - @budgets = @budgets.order(created_at: :desc) + @finished_budgets = @budgets.finished.order(created_at: :desc) @budget = current_budget @budgets_coordinates = current_budget_map_locations end diff --git a/app/views/budgets/index.html.erb b/app/views/budgets/index.html.erb index 99571e70a..c343b6f39 100644 --- a/app/views/budgets/index.html.erb +++ b/app/views/budgets/index.html.erb @@ -108,44 +108,46 @@ -
-
- + <% if @finished_budgets.present? %> +
+
+ -
- <% @budgets.each do |budget| %> - <% if budget_published?(budget) %> -
-
-
-
-
-

<%= budget.name %>

+
+ <% @finished_budgets.each do |budget| %> + <% if budget_published?(budget) %> +
+
+
+
+
+

<%= budget.name %>

+
-
-
-
- <%= link_to t("budgets.index.see_results"), - budget_results_path(budget.id), - class: "button expanded" %> +
+
+ <%= link_to t("budgets.index.see_results"), + budget_results_path(budget.id), + class: "button expanded" %> +
-
+ <% end %> <% end %> - <% end %> +
-
+ <% end %>