Replace helper function by decorator methods

This commit is contained in:
kikito
2016-12-05 17:28:30 +01:00
parent 09539028a2
commit 703cc72953
8 changed files with 24 additions and 15 deletions

View File

@@ -28,7 +28,7 @@
<h4 class="amount-spent text-right">
<%= t("budgets.ballots.show.amount_spent") %>
<span>
<%= format_price(@budget, @ballot.amount_spent(@ballot.heading_for_group(group).id)) %>
<%= @budget.formatted_amount(@ballot.amount_spent(@ballot.heading_for_group(group).id))) %>
</span>
</h4>
<% else %>
@@ -47,9 +47,9 @@
<h4>
<%= t("budgets.ballots.show.remaining",
amount_city: format_price(@budget, @ballot.amount_available(@ballot.heading_for_group(group)))).html_safe %>
amount_city: @budget.formatted_amount(@ballot.amount_available(@ballot.heading_for_group(group))))).html_safe %>
</h4>
</div>
<% end %>
</div>
</div>
</div>

View File

@@ -1,6 +1,6 @@
<li id="<%= dom_id(investment) %>">
<%= link_to investment.title, budget_investment_path(@budget, investment) %>
<span><%= format_price(@budget, investment.price) %></span>
<span><%= investment.formatted_price %></span>
<% if @budget.balloting? %>
<%= link_to budget_ballot_line_path(@budget, id: investment.id),

View File

@@ -1,6 +1,6 @@
<li id="<%= dom_id(investment) %>_sidebar">
<%= investment.title %>
<span><%= format_price(@budget, investment.price) %></span>
<span><%= investment.formatted_price %></span>
<% if @budget.balloting? %>
<%= link_to budget_ballot_line_url(id: investment.id,

View File

@@ -1,5 +1,5 @@
<span class="total-amount">
<%= format_price(@budget, @budget.heading_price(@heading)) %>
<%= @budget.formatted_heading_price(@heading) %>
</span>
<div class="progress" role="progressbar" tabindex="0"
@@ -18,10 +18,10 @@
<%= progress_bar_width(@budget.heading_price(@heading),
@ballot.amount_spent(@heading.id)) %>">
<p id="amount-spent" class="progress-meter-text spent-amount-text">
<%= format_price(@budget, @ballot.amount_spent(@heading.id)) %>
<%= @budget.format_amount(@ballot.amount_spent(@heading.id)) %>
<span id="amount-available" class="amount-available">
<%= t("spending_proposals.index.available") %>
<span><%= format_price(@budget, @ballot.amount_available(@heading)) %></span>
<span><%= @budget.format_amount(@ballot.amount_available(@heading)) %></span>
</span>
</p>
</span>

View File

@@ -13,7 +13,7 @@
<em>
<%= t("budget.investments.index.sidebar.voted_html",
count: @ballot.investments.by_heading(@heading.id).count,
amount_spent: format_price(@budget, @ballot.amount_spent(@heading))) %>
amount_spent: @budget.format_amount(@ballot.amount_spent(@heading))) %>
</em>
</p>
<% else %>