Skip to content

Commit

Permalink
Add the budget display
Browse files Browse the repository at this point in the history
  • Loading branch information
ahukkanen committed Feb 8, 2024
1 parent 6db4b05 commit ab04a81
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 5 deletions.
2 changes: 2 additions & 0 deletions app/cells/decidim/budgets/project_l/data.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
#<%= model.id %>
</div>

<%= render :data_budget %>

<div class="card__info__item">
<%= creation_date_status %>
</div>
Expand Down
6 changes: 1 addition & 5 deletions app/cells/decidim/budgets/project_m/data.erb
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,7 @@

<% if model.budget_amount > 0 || votes_visible? %>
<div class="card__info">
<% if model.budget_amount > 0 %>
<div class="card__info__item">
<%= budget_to_currency model.budget_amount %>
</div>
<% end %>
<%= render :data_budget %>

<% if votes_visible? %>
<div class="card__info__item">
Expand Down
9 changes: 9 additions & 0 deletions app/cells/decidim/budgets/project_m/data_budget.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<% if model.budget_amount > 0 %>
<div class="card__info__item">
<% if model.budget_amount_min.present? && model.budget_amount_min > 0 %>
<%= number_to_delimited(model.budget_amount_min) %>
&ndash;
<% end %>
<%= budget_to_currency(model.budget_amount) %>
</div>
<% end %>
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ module BudgetingPipeline
module ProjectsHelperExtensions
extend ActiveSupport::Concern

include ActiveSupport::NumberHelper
include Decidim::BudgetingPipeline::TextUtilities
include Decidim::MapHelper

Expand Down
9 changes: 9 additions & 0 deletions app/views/decidim/budgets/projects/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,15 @@ edit_link(
<div class="resource__info">
<div class="resource__info__item"><%= translated_attribute(project.budget.title) %></div>
<div class="resource__info__item">#<%= project.id %></div>
<% if project.budget_amount > 0 %>
<div class="resource__info__item">
<% if project.budget_amount_min.present? && project.budget_amount_min > 0 %>
<%= number_to_delimited(project.budget_amount_min) %>
&ndash;
<% end %>
<%= budget_to_currency(project.budget_amount) %>
</div>
<% end %>
<div class="resource__info__item"><%= l(project.created_at.to_date, format: :decidim_short) %></div>
<% if project.category.present? %>
<div class="resource__info__item">
Expand Down

0 comments on commit ab04a81

Please sign in to comment.