can add investments to ballot

This commit is contained in:
rgarcia
2016-09-05 19:29:53 +02:00
parent 53d53ea9fb
commit 9839d7afd0
22 changed files with 881 additions and 17 deletions

View File

@@ -0,0 +1,94 @@
<div class="row ballot">
<%= render 'shared/back_link' %>
<h1 class="text-center"><%= t("budgets.ballots.show.title") %></h1>
<div class="small-12 medium-8 column small-centered text-center">
<h2>
<%= t("budgets.ballots.show.voted_html",
count: @ballot.investments.count) %>
</h2>
<% if @ballot.geozone.present? && district_wide_amount_spent(@ballot) > 0 %>
<%= social_share_button_tag("#{t('budgets.ballots.show.social_share',
amount: format_price(district_wide_amount_spent(@ballot)),
geozone: @ballot.geozone.name)} #{setting['twitter_hashtag']}",
url: participatory_budget_url) %>
<% end %>
<h3>
<%= t("budgets.ballots.show.remaining_city_html",
amount_city: format_price(@ballot.amount_available(nil))) %>
</h3>
<% if @ballot.geozone.present? %>
<h3>
<%= t("budgets.ballots.show.remaining_district_html",
amount_district: format_price(@ballot.amount_available(@ballot.geozone)),
geozone: @ballot.geozone.name) %>
</h3>
<% end %>
<p>
<small>
<%= t("budgets.ballots.show.voted_info_html") %>
</small>
</p>
</div>
<hr>
<div class="margin-top">
<div id="city_wide" class="small-12 medium-6 column">
<h3 class="subtitle">
<%= t("budgets.ballots.show.city_wide") %>
</h3>
<% if @ballot.investments.by_geozone(nil).count > 0 %>
<h4 class="amount-spent text-right">
<%= t("budgets.ballots.show.amount_spent") %>
<span><%= format_price(city_wide_amount_spent(@ballot)) %></span>
</h4>
<% else %>
<p>
<%= t("budgets.ballots.show.zero") %><br>
<%= link_to t("budgets.ballots.show.city_link"),
investments_path(geozone: 'all'),
data: { no_turbolink: true } %>
</p>
<% end %>
<ul class="ballot-list">
<%= render partial: 'budgets/ballots/investment',
collection: @ballot.investments.no_heading %>
</ul>
</div>
<div id="district_wide" class="small-12 medium-6 column">
<h3 class="subtitle">
<%= t("budgets.ballots.show.district_wide") %>
<span>
<% if @ballot.geozone.present? %>
(<%= @ballot.geozone.name %>)
<% end %>
</span>
</h3>
<% if @ballot.geozone.present? %>
<h4 class="amount-spent text-right">
<%= t("budgets.ballots.show.amount_spent") %>
<span><%= format_price(district_wide_amount_spent(@ballot)) %></span>
</h4>
<% else %>
<p>
<%= t("budgets.ballots.show.zero") %><br>
<%= link_to t("budgets.ballots.show.districts_link"), select_district_path %>
</p>
<% end %>
<ul class="ballot-list">
<%= render partial: 'budgets/ballots/investment',
collection: @ballot.investments.with_heading %>
</ul>
</div>
</div>
</div>