Merge pull request #2575 from consul/no-budgets
Display message in budget's index when there are no budgets
This commit is contained in:
@@ -65,6 +65,7 @@ module BudgetsHelper
|
||||
end
|
||||
|
||||
def current_budget_map_locations
|
||||
return unless current_budget.present?
|
||||
MapLocation.where(investment_id: current_budget.investments).map { |l| l.json_data }
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
<% provide :title do %><%= t('budgets.index.title') %><% end %>
|
||||
<% provide :title do %><%= t("budgets.index.title") %><% end %>
|
||||
<% content_for :canonical do %>
|
||||
<%= render "shared/canonical", href: budgets_url %>
|
||||
<% end %>
|
||||
|
||||
<div id="budget_heading" class="expanded budget no-margin-top">
|
||||
<% if current_budget.present? %>
|
||||
<div id="budget_heading" class="expanded budget no-margin-top">
|
||||
<div class="row" data-equalizer data-equalizer-on="medium">
|
||||
<div class="small-12 medium-9 column padding" data-equalizer-watch>
|
||||
|
||||
@@ -55,9 +56,9 @@
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="budget_info" class="budget-info">
|
||||
<div id="budget_info" class="budget-info">
|
||||
<div class="row margin-top">
|
||||
<div class="small-12 column">
|
||||
|
||||
@@ -151,8 +152,26 @@
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
<% else %>
|
||||
<div class="expanded budget no-margin-top margin-bottom">
|
||||
<div class="row">
|
||||
<div class="small-12 medium-9 column padding">
|
||||
<h1><%= t("budgets.index.title") %></h1>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="small-12 column">
|
||||
<div class="callout primary">
|
||||
<%= t("budgets.index.empty_budgets") %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div class="row">
|
||||
<div class="small-12 column">
|
||||
<div id="section_help" class="margin" data-magellan-target="section_help">
|
||||
<p class="lead">
|
||||
@@ -166,5 +185,4 @@
|
||||
<p><%= t("budgets.index.section_footer.help_text_4") %></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -41,6 +41,7 @@ en:
|
||||
finished: Finished budget
|
||||
index:
|
||||
title: Participatory budgets
|
||||
empty_budgets: There are no budgets.
|
||||
section_header:
|
||||
icon_alt: Participatory budgets icon
|
||||
title: Participatory budgets
|
||||
|
||||
@@ -41,6 +41,7 @@ es:
|
||||
finished: Resultados
|
||||
index:
|
||||
title: Presupuestos participativos
|
||||
empty_budgets: No hay presupuestos participativos.
|
||||
section_header:
|
||||
icon_alt: Icono de Presupuestos participativos
|
||||
title: Presupuestos participativos
|
||||
|
||||
@@ -117,6 +117,13 @@ feature 'Budgets' do
|
||||
end
|
||||
end
|
||||
|
||||
scenario "No budgets" do
|
||||
Budget.destroy_all
|
||||
|
||||
visit budgets_path
|
||||
|
||||
expect(page).to have_content "There are no budgets"
|
||||
end
|
||||
end
|
||||
|
||||
scenario 'Index shows only published phases' do
|
||||
|
||||
Reference in New Issue
Block a user