diff --git a/app/assets/stylesheets/budgets/investments/form.scss b/app/assets/stylesheets/budgets/investments/form.scss index de48941b5..6d84a466d 100644 --- a/app/assets/stylesheets/budgets/investments/form.scss +++ b/app/assets/stylesheets/budgets/investments/form.scss @@ -1,5 +1,34 @@ .budget-investment-form { + .required-fields { + @include full-width-background($adjust-padding: true); + background: $light; + margin-bottom: $line-height; + padding-top: $line-height; + } + + > fieldset > legend { + float: left; + font-size: rem-calc(36); + font-weight: bold; + margin-bottom: $line-height; + text-transform: uppercase; + + + * { + clear: left; + } + } + + select { + min-height: $line-height * 2; + + @include breakpoint(medium) { + &:not(.js-add-language):not(.js-select-language) { + width: 50%; + } + } + } + .globalize-languages, .translatable-fields { @include grid-row-nest; @@ -13,6 +42,21 @@ [type="submit"] { @include regular-button; - width: 100%; + font-size: map-get($button-sizes, large); + margin-top: $line-height; + } + + .actions { + border: 6px solid $border; + border-radius: rem-calc(12); + margin-left: auto; + margin-right: auto; + margin-top: $line-height * 2; + padding: $line-height * 2 $line-height; + text-align: center; + + @include breakpoint(medium) { + width: 75%; + } } } diff --git a/app/assets/stylesheets/budgets/investments/new.scss b/app/assets/stylesheets/budgets/investments/new.scss index bda89bd63..f13325fbf 100644 --- a/app/assets/stylesheets/budgets/investments/new.scss +++ b/app/assets/stylesheets/budgets/investments/new.scss @@ -1,19 +1,27 @@ .budget-investment-new { $border-width: 4px; + @include grid-column-gutter; - > * { - @include grid-column-gutter; + > :first-child:not(.print-info) { + @include full-width-background($adjust-padding: true); + background: $light; + margin-top: -$line-height; + padding-top: $line-height; + } + + h1 { + margin-bottom: 0; } header { @include has-fa-icon(building, regular, after); align-items: center; + background-color: $body-background; border: $border-width solid; color: $brand-secondary; border-bottom-right-radius: rem-calc(12); border-top-right-radius: rem-calc(12); display: flex; - margin-bottom: $line-height * 2; margin-top: $line-height * 2; @include breakpoint(large) { @@ -38,7 +46,6 @@ display: flex; flex: 1; font-size: rem-calc(36); - margin-bottom: 0; padding: $line-height * 2 0; @include breakpoint(large) { diff --git a/app/assets/stylesheets/layout.scss b/app/assets/stylesheets/layout.scss index 85778926f..ec9aef363 100644 --- a/app/assets/stylesheets/layout.scss +++ b/app/assets/stylesheets/layout.scss @@ -1074,7 +1074,6 @@ form { .checkbox, .radio { - display: inline-block; font-weight: normal; line-height: $line-height; vertical-align: middle; diff --git a/app/components/budgets/investments/form_component.html.erb b/app/components/budgets/investments/form_component.html.erb index d1261be91..34283dbd8 100644 --- a/app/components/budgets/investments/form_component.html.erb +++ b/app/components/budgets/investments/form_component.html.erb @@ -2,100 +2,108 @@ <%= render "shared/errors", resource: investment %> - <% unless budget.single_heading? %> -
- <%= f.select :heading_id, budget_heading_select_options(budget), { include_blank: true } %> -
- <% end %> +
+ <%= t("shared.required") %> -
- <%= render "shared/globalize_locales", resource: investment %> -
- - <%= f.translatable_fields do |translations_form| %> -
- <%= translations_form.text_field :title, - maxlength: Budget::Investment.title_max_length, - data: suggest_data(investment) %> -
-
+ <% unless budget.single_heading? %> +
+ <%= f.select :heading_id, budget_heading_select_options(budget), { include_blank: true } %> +
+ <% end %>
- <%= translations_form.text_area :description, - maxlength: Budget::Investment.description_max_length, - class: "html-area" %> + <%= render "shared/globalize_locales", resource: investment %>
- <% end %> + + <%= f.translatable_fields do |translations_form| %> +
+ <%= translations_form.text_field :title, + maxlength: Budget::Investment.title_max_length, + data: suggest_data(investment) %> +
+
+ +
+ <%= translations_form.text_area :description, + maxlength: Budget::Investment.description_max_length, + class: "html-area" %> +
+ <% end %> +
<%= f.invisible_captcha :subtitle %> - <% if feature?(:allow_images) %> -
- <%= render "images/nested_image", imageable: investment, f: f %> -
- <% end %> +
+ <%= t("shared.optional") %> - <% if feature?(:allow_attached_documents) %> -
- <%= render "documents/nested_documents", documentable: investment, f: f %> -
- <% end %> + <% if feature?(:allow_images) %> +
+ <%= render "images/nested_image", imageable: investment, f: f %> +
+ <% end %> + + <% if feature?(:allow_attached_documents) %> +
+ <%= render "documents/nested_documents", documentable: investment, f: f %> +
+ <% end %> + + <% if feature?(:map) %> +
+ <%= render "map_locations/form_fields", + form: f, + map_location: investment.map_location || MapLocation.new, + label: t("budgets.investments.form.map_location"), + help: t("budgets.investments.form.map_location_instructions"), + remove_marker_label: t("budgets.investments.form.map_remove_marker"), + parent_class: "budget_investment", + i18n_namespace: "budgets.investments" %> +
+ <% end %> - <% if feature?(:map) %>
- <%= render "map_locations/form_fields", - form: f, - map_location: investment.map_location || MapLocation.new, - label: t("budgets.investments.form.map_location"), - help: t("budgets.investments.form.map_location_instructions"), - remove_marker_label: t("budgets.investments.form.map_remove_marker"), - parent_class: "budget_investment", - i18n_namespace: "budgets.investments" %> -
- <% end %> - -
- <%= f.text_field :location %> -
- -
- <%= f.text_field :organization_name %> -
- -
- <%= f.label :tag_list, t("budgets.investments.form.tags_label") %> -

<%= t("budgets.investments.form.tags_instructions") %>

- -
- <%= f.label :category_tag_list, t("budgets.investments.form.tag_category_label") %> - <% categories.each do |tag| %> - <%= tag.name %> - <% end %> + <%= f.text_field :location %>
-
- <%= f.text_field :tag_list, value: investment.tag_list.to_s, - label: false, - placeholder: t("budgets.investments.form.tags_placeholder"), - aria: { describedby: "tags-list-help-text" }, - class: "js-tag-list tag-autocomplete", - data: { js_url: suggest_tags_path } %> -
- - <%= render SDG::RelatedListSelectorComponent.new(f) %> - - <% unless current_user.manager? || investment.persisted? %>
- <%= f.check_box :terms_of_service, - title: t("form.accept_terms_title"), - label: t("form.accept_terms", - policy: link_to(t("form.policy"), "/privacy", target: "blank"), - conditions: link_to(t("form.conditions"), "/conditions", target: "blank") - ) %> + <%= f.text_field :organization_name %>
- <% end %> -
+
+ <%= f.label :tag_list, t("budgets.investments.form.tags_label") %> +

<%= t("budgets.investments.form.tags_instructions") %>

+ +
+ <%= f.label :category_tag_list, t("budgets.investments.form.tag_category_label") %> + <% categories.each do |tag| %> + <%= tag.name %> + <% end %> +
+ +
+ <%= f.text_field :tag_list, value: investment.tag_list.to_s, + label: false, + placeholder: t("budgets.investments.form.tags_placeholder"), + aria: { describedby: "tags-list-help-text" }, + class: "js-tag-list tag-autocomplete", + data: { js_url: suggest_tags_path } %> +
+ + <%= render SDG::RelatedListSelectorComponent.new(f) %> +
+ +
+ <% unless current_user.manager? || investment.persisted? %> +
+ <%= f.check_box :terms_of_service, + title: t("form.accept_terms_title"), + label: t("form.accept_terms", + policy: link_to(t("form.policy"), "/privacy", target: "blank"), + conditions: link_to(t("form.conditions"), "/conditions", target: "blank") + ) %> +
+ <% end %> + <%= f.submit %>
<% end %> diff --git a/app/views/management/budgets/investments/new.html.erb b/app/views/management/budgets/investments/new.html.erb index d8fa9048c..d2b280606 100644 --- a/app/views/management/budgets/investments/new.html.erb +++ b/app/views/management/budgets/investments/new.html.erb @@ -1,6 +1,6 @@
-
+ diff --git a/config/locales/en/general.yml b/config/locales/en/general.yml index a58e5e6ba..d0d1ff500 100644 --- a/config/locales/en/general.yml +++ b/config/locales/en/general.yml @@ -774,6 +774,8 @@ en: zero: "0 languages in use" one: "1 language in use" other: "%{count} languages in use" + optional: "Optional" + required: "Required" social: facebook: "%{org} Facebook" twitter: "%{org} Twitter" diff --git a/config/locales/es/general.yml b/config/locales/es/general.yml index 81a903d8c..aa8b4b8ee 100644 --- a/config/locales/es/general.yml +++ b/config/locales/es/general.yml @@ -774,6 +774,8 @@ es: zero: "0 idiomas en uso" one: "1 idioma en uso" other: "%{count} idiomas en uso" + optional: "Opcional" + required: "Obligatorio" social: facebook: "Facebook de %{org}" twitter: "Twitter de %{org}"