diff --git a/app/views/admin/budgets/index.html.erb b/app/views/admin/budgets/index.html.erb index b93a65103..f90baac51 100644 --- a/app/views/admin/budgets/index.html.erb +++ b/app/views/admin/budgets/index.html.erb @@ -6,41 +6,47 @@ <%= render 'shared/filter_subnav', i18n_namespace: "admin.budgets.index" %> -

<%= page_entries_info @budgets %>

+<% if @budgets.any? %> +

<%= page_entries_info @budgets %>

- - - - - - - - - - - - <% @budgets.each do |budget| %> - - - - - - +
<%= t("admin.budgets.index.table_name") %><%= t("admin.budgets.index.table_phase") %><%= t("admin.budgets.index.table_investments") %><%= t("admin.budgets.index.table_edit_groups") %><%= t("admin.budgets.index.table_edit_budget") %>
- <%= budget.name %> - - <%= t("budgets.phase.#{budget.phase}") %> - - <%= link_to t("admin.budgets.index.budget_investments"), - admin_budget_budget_investments_path(budget_id: budget.id), - class: "button hollow medium" %> - - <%= link_to t("admin.budgets.index.edit_groups"), admin_budget_path(budget) %> - - <%= link_to t("admin.budgets.index.edit_budget"), edit_admin_budget_path(budget) %> -
+ + + + + + + - <% end %> - -
<%= t("admin.budgets.index.table_name") %><%= t("admin.budgets.index.table_phase") %><%= t("admin.budgets.index.table_investments") %><%= t("admin.budgets.index.table_edit_groups") %><%= t("admin.budgets.index.table_edit_budget") %>
+ + + <% @budgets.each do |budget| %> + + + <%= budget.name %> + + + <%= t("budgets.phase.#{budget.phase}") %> + + + <%= link_to t("admin.budgets.index.budget_investments"), + admin_budget_budget_investments_path(budget_id: budget.id), + class: "button hollow medium" %> + + + <%= link_to t("admin.budgets.index.edit_groups"), admin_budget_path(budget) %> + + + <%= link_to t("admin.budgets.index.edit_budget"), edit_admin_budget_path(budget) %> + + + <% end %> + + -<%= paginate @budgets %> + <%= paginate @budgets %> +<% else %> +
+ <%= t("admin.budgets.index.no_budgets") %> +
+<% end %> diff --git a/config/locales/en/admin.yml b/config/locales/en/admin.yml index c1f940981..94578ceb8 100644 --- a/config/locales/en/admin.yml +++ b/config/locales/en/admin.yml @@ -87,6 +87,7 @@ en: table_edit_budget: Edit edit_groups: Edit headings groups edit_budget: Edit budget + no_budgets: "There are no open budgets." create: notice: New participatory budget created successfully! update: diff --git a/config/locales/es/admin.yml b/config/locales/es/admin.yml index ecc100c1d..059131eb7 100644 --- a/config/locales/es/admin.yml +++ b/config/locales/es/admin.yml @@ -87,6 +87,7 @@ es: table_edit_budget: Editar edit_groups: Editar grupos de partidas edit_budget: Editar presupuesto + no_budgets: "No hay presupuestos abiertos." create: notice: '¡Presupuestos participativos creados con éxito!' update: diff --git a/spec/features/admin/budgets_spec.rb b/spec/features/admin/budgets_spec.rb index 9872a9d27..dbad0494d 100644 --- a/spec/features/admin/budgets_spec.rb +++ b/spec/features/admin/budgets_spec.rb @@ -25,6 +25,12 @@ feature 'Admin budgets' do context 'Index' do + scenario 'Displaying no open budgets text' do + visit admin_budgets_path + + expect(page).to have_content("There are no open budgets.") + end + scenario 'Displaying budgets' do budget = create(:budget) visit admin_budgets_path @@ -119,7 +125,7 @@ feature 'Admin budgets' do click_link 'Delete budget' expect(page).to have_content('Budget deleted successfully') - expect(page).to have_content('budgets cannot be found') + expect(page).to have_content('There are no open budgets.') end scenario 'Try to destroy a budget with investments' do