diff --git a/app/assets/stylesheets/layout.scss b/app/assets/stylesheets/layout.scss index 86af0edae..277fff637 100644 --- a/app/assets/stylesheets/layout.scss +++ b/app/assets/stylesheets/layout.scss @@ -69,6 +69,7 @@ main { &.budget-investment-new, &.debate-new, + &.proposal-new, &.sdg-goals-index, &.sdg-goal-show { @include grid-column-gutter; diff --git a/app/assets/stylesheets/participation.scss b/app/assets/stylesheets/participation.scss index d498bb70f..4f4c6c54c 100644 --- a/app/assets/stylesheets/participation.scss +++ b/app/assets/stylesheets/participation.scss @@ -244,19 +244,6 @@ // 02. New participation // --------------------- -.proposal-new { - - .icon-proposals { - font-size: rem-calc(50); - line-height: $line-height; - opacity: 0.5; - } - - .icon-proposals { - color: $proposals; - } -} - .recommendations { list-style-type: none; margin-left: 0; @@ -273,13 +260,6 @@ } } -.proposal-new { - - .recommendations li::before { - color: $proposals; - } -} - .budget-investment-new, .proposal-new, .proposal-edit, diff --git a/app/assets/stylesheets/proposals/form.scss b/app/assets/stylesheets/proposals/form.scss index b666de98e..a3a8bf538 100644 --- a/app/assets/stylesheets/proposals/form.scss +++ b/app/assets/stylesheets/proposals/form.scss @@ -1,9 +1,3 @@ .proposal-form { - - .globalize-languages, - .translatable-fields { - @include grid-row-nest; - @include grid-column-gutter; - } + @extend %public-form; } - diff --git a/app/assets/stylesheets/proposals/new.scss b/app/assets/stylesheets/proposals/new.scss new file mode 100644 index 000000000..50e9aa694 --- /dev/null +++ b/app/assets/stylesheets/proposals/new.scss @@ -0,0 +1,15 @@ +.proposal-new { + @extend %public-form-header; + + header h1 { + @include has-fa-icon(lightbulb, regular, after); + } + + aside { + margin-top: $line-height; + } + + .recommendations li::before { + color: $proposals; + } +} diff --git a/app/components/proposals/form_component.html.erb b/app/components/proposals/form_component.html.erb index 3831a6f5c..f1af97081 100644 --- a/app/components/proposals/form_component.html.erb +++ b/app/components/proposals/form_component.html.erb @@ -1,106 +1,114 @@ <%= translatable_form_for(proposal, url: url, html: { class: "proposal-form" }) do |f| %> <%= render "shared/errors", resource: proposal %> - <%= render "shared/globalize_locales", resource: proposal %> +
+ <%= t("shared.required") %> - <%= f.translatable_fields do |translations_form| %> -
- <%= translations_form.text_field :title, - maxlength: Proposal.title_max_length, - data: suggest_data(proposal) %> -
-
+ <%= render "shared/globalize_locales", resource: proposal %> -
- <%= translations_form.text_area :summary, - rows: 4, maxlength: 200, - hint: t("proposals.form.proposal_summary_note") %> -
+ <%= f.translatable_fields do |translations_form| %> +
+ <%= translations_form.text_field :title, + maxlength: Proposal.title_max_length, + data: suggest_data(proposal) %> +
+
-
- <%= translations_form.text_area :description, - maxlength: Proposal.description_max_length, - class: "html-area" %> -
- <% end %> +
+ <%= translations_form.text_area :summary, + rows: 4, maxlength: 200, + hint: t("proposals.form.proposal_summary_note") %> +
+ +
+ <%= translations_form.text_area :description, + maxlength: Proposal.description_max_length, + class: "html-area" %> +
+ <% end %> +
<%= f.invisible_captcha :subtitle %> -
- <%= f.text_field :video_url, hint: t("proposals.form.proposal_video_url_note") %> -
+
+ <%= t("shared.optional") %> - <% if feature?(:allow_images) %> -
- <%= render "images/nested_image", imageable: proposal, f: f %> -
- <% end %> - - <% if feature?(:allow_attached_documents) %> -
- <%= render "documents/nested_documents", documentable: proposal, f: f %> -
- <% end %> - -
- <%= f.select :geozone_id, geozone_select_options, - include_blank: t("geozones.none") %> -
- - <% if feature?(:map) %>
- <%= render "map_locations/form_fields", - form: f, - map_location: proposal.map_location || MapLocation.new, - label: t("proposals.form.map_location"), - help: t("proposals.form.map_location_instructions"), - remove_marker_label: t("proposals.form.map_remove_marker"), - parent_class: "proposal", - i18n_namespace: "proposals" %> -
- <% end %> - -
- <%= f.label :tag_list, t("proposals.form.tags_label") %> -

<%= t("proposals.form.tags_instructions") %>

- -
- <%= f.label :category_tag_list, t("proposals.form.tag_category_label") %> - <% categories.each do |tag| %> - <%= tag.name %> - <% end %> + <%= f.text_field :video_url, hint: t("proposals.form.proposal_video_url_note") %>
-
- <%= f.text_field :tag_list, value: proposal.tag_list.to_s, - label: false, - placeholder: t("proposals.form.tags_placeholder"), - class: "js-tag-list tag-autocomplete", - aria: { describedby: "tag-list-help-text" }, - data: { js_url: suggest_tags_path } %> -
- - <% if current_user.unverified? %> -
- <%= f.text_field :responsible_name, - hint: t("proposals.form.proposal_responsible_name_note") %> -
- <% end %> - - <%= render SDG::RelatedListSelectorComponent.new(f) %> - -
- <% if proposal.new_record? %> - <%= 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") - ) %> + <% if feature?(:allow_images) %> +
+ <%= render "images/nested_image", imageable: proposal, f: f %> +
<% end %> -
+ + <% if feature?(:allow_attached_documents) %> +
+ <%= render "documents/nested_documents", documentable: proposal, f: f %> +
+ <% end %> + +
+ <%= f.select :geozone_id, geozone_select_options, + include_blank: t("geozones.none") %> +
+ + <% if feature?(:map) %> +
+ <%= render "map_locations/form_fields", + form: f, + map_location: proposal.map_location || MapLocation.new, + label: t("proposals.form.map_location"), + help: t("proposals.form.map_location_instructions"), + remove_marker_label: t("proposals.form.map_remove_marker"), + parent_class: "proposal", + i18n_namespace: "proposals" %> +
+ <% end %> + +
+ <%= f.label :tag_list, t("proposals.form.tags_label") %> +

<%= t("proposals.form.tags_instructions") %>

+ +
+ <%= f.label :category_tag_list, t("proposals.form.tag_category_label") %> + <% categories.each do |tag| %> + <%= tag.name %> + <% end %> +
+ +
+ <%= f.text_field :tag_list, value: proposal.tag_list.to_s, + label: false, + placeholder: t("proposals.form.tags_placeholder"), + class: "js-tag-list tag-autocomplete", + aria: { describedby: "tag-list-help-text" }, + data: { js_url: suggest_tags_path } %> +
+ + <% if current_user.unverified? %> +
+ <%= f.text_field :responsible_name, + hint: t("proposals.form.proposal_responsible_name_note") %> +
+ <% end %> + + <%= render SDG::RelatedListSelectorComponent.new(f) %> +
+ <% if proposal.new_record? %> +
+ <%= 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(class: "button", value: t("proposals.#{action_name}.form.submit_button")) %>
<% end %> diff --git a/app/components/proposals/new_component.html.erb b/app/components/proposals/new_component.html.erb index 51e567cb9..986f230dd 100644 --- a/app/components/proposals/new_component.html.erb +++ b/app/components/proposals/new_component.html.erb @@ -1,25 +1,21 @@ -
+
+ <%= back_link_to proposals_path, t("proposals.index.section_header.title") %> -
- <%= back_link_to %> + <%= header do %> + <%= link_to help_path(anchor: "proposals"), title: t("shared.target_blank"), target: "_blank" do %> + <%= t("proposals.new.more_info") %> + <% end %> + <% end %> -

<%= t("proposals.new.start_new") %>

-
- <%= link_to help_path(anchor: "proposals"), title: t("shared.target_blank"), target: "_blank" do %> - <%= t("proposals.new.more_info") %> - <% end %> -
- - <%= render Proposals::FormComponent.new(proposal, url: proposals_path) %> -
- -
- +
-
+ + + <%= render Proposals::FormComponent.new(proposal, url: proposals_path) %> + diff --git a/app/components/proposals/new_component.rb b/app/components/proposals/new_component.rb index 3b3c85d97..05dbc81c1 100644 --- a/app/components/proposals/new_component.rb +++ b/app/components/proposals/new_component.rb @@ -1,7 +1,12 @@ class Proposals::NewComponent < ApplicationComponent + include Header attr_reader :proposal def initialize(proposal) @proposal = proposal end + + def title + t("proposals.new.start_new") + end end