Manage the render of the price field on admin budget headings

Avoid displaying the price in admin budget headings section
and avoid fill the field 'price' in admin budget headings form
when the budget has been checked with hide_money field.
This commit is contained in:
decabeza
2022-02-02 13:19:08 +01:00
committed by taitus
parent 80e64590b7
commit 9fb5019f0f
6 changed files with 38 additions and 3 deletions

View File

@@ -4,7 +4,9 @@
<thead>
<tr>
<th><%= Budget::Heading.human_attribute_name(:name) %></th>
<th><%= Budget::Heading.human_attribute_name(:price) %></th>
<% if budget.show_money? %>
<th class="text-center"><%= Budget::Heading.human_attribute_name(:price) %></th>
<% end %>
<% if budget.approval_voting? %>
<th><%= Budget::Heading.human_attribute_name(:max_ballot_lines) %></th>
<% end %>
@@ -15,7 +17,9 @@
<% headings.each do |heading| %>
<tr id="<%= dom_id(heading) %>" class="heading">
<td><%= heading.name %></td>
<td><%= budget.formatted_heading_price(heading) %></td>
<% if budget.show_money? %>
<td><%= budget.formatted_heading_price(heading) %></td>
<% end %>
<% if budget.approval_voting? %>
<td><%= heading.max_ballot_lines %></td>
<% end %>