Changes suggested in the PR made

This commit is contained in:
iagirre
2018-01-10 13:13:05 +01:00
parent f7e96067b0
commit f0724ce13a
5 changed files with 19 additions and 25 deletions

View File

@@ -1,5 +1 @@
<% if @errors %>
$("#heading-<%=@heading.id%> div#error_explanation").replaceWith("<%= j render("admin/budget_headings/errors", errors: @errors) %>");
<% else %>
$("#heading-<%=@heading.id%>").html("<td colspan='4'><%= j render("admin/budgets/heading", group: @budget_group, budget: @budget, heading: @heading) %></td>");
<% end %>
$("#<%= dom_id(@budget_group) %>").html('<%= j render("admin/budgets/group", group: @budget_group, headings: @budget_group.headings) %>');

View File

@@ -12,16 +12,16 @@
<%= link_to t("admin.actions.edit"),
edit_admin_budget_budget_group_budget_heading_path(budget_id: group.budget.id, budget_group_id: group.id, id: heading.id),
class: "button hollow",
remote: true%>
remote: true %>
<%= link_to t("admin.budget_investments.index.title"),
admin_budget_budget_investments_path(budget_id: group.budget.id, heading_id: heading.id),
class: "button hollow"%>
class: "button hollow" %>
<% if heading.can_be_deleted? %>
<%= link_to t('admin.administrators.administrator.delete'),
#admin_budget_budget_group_budget_headings_path(group.budget.id, group.id),
[:admin, group.budget, group, heading],
method: :delete,
class: "button hollow alert"%>
class: "button hollow alert" %>
<% end %>
</td>
</tr>
</tr>

View File

@@ -1,4 +1,5 @@
<%= form_for [:admin, budget, group, heading], remote: true do |f| %>
<%= render 'shared/errors', resource: heading %>
<label><%= t("admin.budgets.form.heading") %></label>
<%= f.text_field :name,
label: false,
@@ -25,6 +26,4 @@
</div>
<%= f.submit t("admin.budgets.form.save_heading"), class: "button success" %>
<div id="error_explanation"></div>
<% end %>
<% end %>