Adapt phases step to single and multiple budget mode

Co-Authored-By: decabeza <alberto@decabeza.es>
This commit is contained in:
Julian Herrero
2020-03-15 06:51:52 +01:00
committed by Javi Martín
parent e3510fc29d
commit 4c6de86a72
6 changed files with 81 additions and 1 deletions

View File

@@ -4,6 +4,8 @@
<%= render "shared/errors", resource: phase %>
<%= render Admin::BudgetsWizard::ModelFieldComponent.new %>
<fieldset>
<legend aria-describedby="phase_duration_description">
<%= t("admin.budget_phases.edit.duration") %>

View File

@@ -31,6 +31,7 @@
<td>
<%= render Admin::TableActionsComponent.new(phase,
actions: [:edit],
edit_path: edit_path(phase),
edit_text: t("admin.budgets.edit.edit_phase")
) %>
</td>

View File

@@ -37,4 +37,10 @@ class Admin::BudgetPhases::PhasesComponent < ApplicationComponent
tag.span t("shared.no"), class: "budget-phase-disabled"
end
end
def edit_path(phase)
if helpers.respond_to?(:single_heading?) && helpers.single_heading?
edit_admin_budgets_wizard_budget_budget_phase_path(budget, phase, helpers.url_params)
end
end
end