diff --git a/app/assets/stylesheets/admin/budget_phases/form.scss b/app/assets/stylesheets/admin/budget_phases/form.scss new file mode 100644 index 000000000..8e9be056f --- /dev/null +++ b/app/assets/stylesheets/admin/budget_phases/form.scss @@ -0,0 +1,25 @@ +.admin .budget-phases-form { + + fieldset { + margin-top: $line-height; + + > * { + @include grid-column; + } + + > .date-field { + + @include breakpoint(medium) { + width: 50%; + } + + @include breakpoint(large) { + width: 25%; + } + + &:last-child { + float: left; + } + } + } +} diff --git a/app/views/admin/budget_phases/_form.html.erb b/app/views/admin/budget_phases/_form.html.erb index 845a404d9..6e24790fb 100644 --- a/app/views/admin/budget_phases/_form.html.erb +++ b/app/views/admin/budget_phases/_form.html.erb @@ -1,43 +1,45 @@ <%= render "shared/globalize_locales", resource: @phase %> -<%= translatable_form_for [:admin, @phase.budget, @phase] do |f| %> +<%= translatable_form_for [:admin, @phase.budget, @phase], html: { class: "budget-phases-form" } do |f| %> <%= render "shared/errors", resource: @phase %> -
-
+
+ + <%= t("admin.budget_phases.edit.duration") %> + + +

+ <%= t("admin.budget_phases.edit.duration_description") %> +

+ +
<%= f.date_field :starts_at, id: "start_date" %>
-
+ +
<%= f.date_field :ends_at, id: "end_date" %>
+
+ +
+ <%= f.check_box :enabled %> + + + <%= t("admin.budget_phases.edit.enabled_help_text") %> +
-
- <%= f.translatable_fields do |translations_form| %> -
- <%= translations_form.text_area :description, - maxlength: Budget::Phase::DESCRIPTION_MAX_LENGTH, - class: "html-area", - hint: t("admin.budget_phases.edit.description_help_text") %> -
- <% end %> -
- -
-
- <%= f.check_box :enabled %> - - - <%= t("admin.budget_phases.edit.enabled_help_text") %> - + <%= f.translatable_fields do |translations_form| %> +
+ <%= translations_form.text_area :description, + maxlength: Budget::Phase::DESCRIPTION_MAX_LENGTH, + class: "html-area", + hint: t("admin.budget_phases.edit.description_help_text") %>
-
+ <% end %> -
-
- <%= f.submit t("admin.budget_phases.edit.save_changes"), class: "button success expanded" %> -
+
+ <%= f.submit t("admin.budget_phases.edit.save_changes"), class: "button success" %>
- <% end %> diff --git a/app/views/admin/budget_phases/edit.html.erb b/app/views/admin/budget_phases/edit.html.erb index da7b08e21..452c11f96 100644 --- a/app/views/admin/budget_phases/edit.html.erb +++ b/app/views/admin/budget_phases/edit.html.erb @@ -1,9 +1,5 @@ <%= back_link_to edit_admin_budget_path(@phase.budget) %> -
-
-

<%= t("admin.budgets.edit.title") %> - <%= @phase.name %>

-
-
+

<%= t("admin.budgets.edit.title") %> - <%= @phase.name %>

<%= render "/admin/budget_phases/form" %> diff --git a/config/locales/en/admin.yml b/config/locales/en/admin.yml index 1db16f4da..64437f83c 100644 --- a/config/locales/en/admin.yml +++ b/config/locales/en/admin.yml @@ -174,6 +174,8 @@ en: budget_phases: edit: description_help_text: This text will appear in the header when the phase is active + duration: "Phase's duration" + duration_description: "The period of time this phase will be active." enabled_help_text: This phase will be public in the budget's phases timeline, as well as active for any other purpose save_changes: Save changes index: diff --git a/config/locales/es/admin.yml b/config/locales/es/admin.yml index ebdf2f8d2..7eb81bd86 100644 --- a/config/locales/es/admin.yml +++ b/config/locales/es/admin.yml @@ -174,6 +174,8 @@ es: budget_phases: edit: description_help_text: Este texto aparecerá en la cabecera cuando la fase esté activa + duration: "Duración de la fase" + duration_description: "El período de tiempo que esta fase estará activa." enabled_help_text: Esta fase será pública en el calendario de fases del presupuesto y estará activa para otros propósitos save_changes: Guardar cambios index: