Move phases and actions out of the budget form

Having links in the middle of a form distracts users from the task of
filling in the form, and following a link before submitting the form
will mean whatever has been filled in is lost.

And the budgets form is already very long and hard to fill in. Having
the phases table in the middle of it made it even harder. And, since
we're planning to add the option to manage groups and headings from the
same page, it's better to have a dedicated page for the form.
This commit is contained in:
Javi Martín
2021-08-23 01:00:05 +02:00
parent 8aa6f29d6b
commit 349dbb74d7
22 changed files with 158 additions and 73 deletions

View File

@@ -15,7 +15,6 @@ class Admin::BudgetsController < Admin::BaseController
end
def show
render :edit
end
def edit
@@ -23,7 +22,7 @@ class Admin::BudgetsController < Admin::BaseController
def publish
@budget.publish!
redirect_to edit_admin_budget_path(@budget), notice: t("admin.budgets.publish.notice")
redirect_to admin_budget_path(@budget), notice: t("admin.budgets.publish.notice")
end
def calculate_winners
@@ -38,7 +37,7 @@ class Admin::BudgetsController < Admin::BaseController
def update
if @budget.update(budget_params)
redirect_to admin_budgets_path, notice: t("admin.budgets.update.notice")
redirect_to admin_budget_path(@budget), notice: t("admin.budgets.update.notice")
else
render :edit
end