diff --git a/app/assets/stylesheets/new_design/auth.scss b/app/assets/stylesheets/new_design/auth.scss index 2ad56545b..4aae42a3d 100644 --- a/app/assets/stylesheets/new_design/auth.scss +++ b/app/assets/stylesheets/new_design/auth.scss @@ -111,3 +111,11 @@ $auth-breakpoint: $two-columns-breakpoint; } } } + +.identity-form { + @media (max-width: $two-columns-breakpoint) { + input[type=submit] { + margin-bottom: 2 * $default-padding; + } + } +} diff --git a/app/assets/stylesheets/new_design/common.scss b/app/assets/stylesheets/new_design/common.scss index e98f7270c..bc18e7ff0 100644 --- a/app/assets/stylesheets/new_design/common.scss +++ b/app/assets/stylesheets/new_design/common.scss @@ -23,6 +23,16 @@ h1 { font-weight: bold; } +h2 { + font-size: 30px; + margin-bottom: 15px; + border-bottom: 1px solid $border-grey; +} + +strong { + font-weight: bold; +} + a { color: $blue; } diff --git a/app/assets/stylesheets/new_design/forms.scss b/app/assets/stylesheets/new_design/forms.scss index 866c98c14..b60b2ba5e 100644 --- a/app/assets/stylesheets/new_design/forms.scss +++ b/app/assets/stylesheets/new_design/forms.scss @@ -254,9 +254,11 @@ .send-wrapper { text-align: right; + margin-top: 2 * $default-padding; + margin-bottom: 2 * $default-padding; - .send { - margin-bottom: $default-padding; + .button { + margin-bottom: 0; } } diff --git a/app/assets/stylesheets/new_design/new_footer.scss b/app/assets/stylesheets/new_design/new_footer.scss index 91aa8fe19..35966b2a4 100644 --- a/app/assets/stylesheets/new_design/new_footer.scss +++ b/app/assets/stylesheets/new_design/new_footer.scss @@ -4,13 +4,21 @@ @import "placeholders"; footer { - @include vertical-padding(72px); background-color: $light-grey; border-top: 1px solid $border-grey; bottom: 0; width: 100%; } +.landing-footer { + @include vertical-padding(72px); +} + +.dossier-footer { + @include vertical-padding(48px); + line-height: 24px; +} + .footer-columns { @extend %horizontal-list; justify-content: flex-start; @@ -36,6 +44,12 @@ footer { margin: 0; } +.footer-header { + font-size: 14px; + font-weight: bold; + margin-bottom: 10px; +} + .footer-link { margin-bottom: 14px; @@ -79,3 +93,10 @@ footer { text-decoration: none; } } + +.footer-bottom-line { + margin-top: 30px; + margin-bottom: -30px; + text-align: center; + font-size: small; +} diff --git a/app/views/layouts/new_application.html.haml b/app/views/layouts/new_application.html.haml index daa786536..affb3ad19 100644 --- a/app/views/layouts/new_application.html.haml +++ b/app/views/layouts/new_application.html.haml @@ -30,8 +30,8 @@ = render partial: "layouts/flash_messages" = yield - - if content_for?(:display_footer) - = render partial: "layouts/new_footer" + - if content_for?(:footer) + = content_for(:footer) = render partial: "layouts/mailjet_newsletter" = javascript_include_tag "new_design/application", "data-turbolinks-eval": false diff --git a/app/views/new_administrateur/services/_form.html.haml b/app/views/new_administrateur/services/_form.html.haml index 6654678a9..3b03240cf 100644 --- a/app/views/new_administrateur/services/_form.html.haml +++ b/app/views/new_administrateur/services/_form.html.haml @@ -16,6 +16,10 @@ = f.select :type_organisme, Service.type_organismes.keys.map { |key| [ I18n.t("type_organisme.#{key}"), key] } + %h2 Informations de contact + + %p.explication Ces informations seront visibles par les utilisateurs du formulaire. + = f.label :email do Courriel %span.mandatory * diff --git a/app/views/new_user/dossiers/_footer.html.haml b/app/views/new_user/dossiers/_footer.html.haml new file mode 100644 index 000000000..59d04ecb0 --- /dev/null +++ b/app/views/new_user/dossiers/_footer.html.haml @@ -0,0 +1,39 @@ +%footer.dossier-footer + .container + %ul.footer-columns + + - service = dossier.procedure.service + - if service.present? + %li.footer-column + %h3.footer-header Cette démarche est gérée par : + %p + = service.nom + %br + = service.organisme + %br + = string_to_html(service.adresse) + + %li.footer-column + %h3.footer-header Poser une question sur votre dossier : + %p + - if dossier.brouillon? + Par email : + = link_to service.email, "mailto:#{service.email}" + - else + Directement + = link_to "par la messagerie", users_dossier_recapitulatif_path(dossier) + %p + Par téléphone : + %a{ href: "tel:#{service.telephone}" }= service.telephone + + %p + Horaires : #{ service.horaires.sub(/\S/, &:downcase) } + + .footer-bottom-line + = link_to "Accessibilité", accessibilite_index_path, :class => "footer-link" + – + = link_to "CGU", CGU_URL, :class => "footer-link", :target => "_blank", rel: "noopener noreferrer" + – + = link_to "Mentions légales", MENTIONS_LEGALES_URL, :class => "footer-link", :target => "_blank", rel: "noopener noreferrer" + – + = link_to "Contact technique", "mailto:#{CONTACT_EMAIL}", :class => "footer-link" diff --git a/app/views/new_user/dossiers/identite.html.haml b/app/views/new_user/dossiers/identite.html.haml index 6847dc8f6..5e5aa4349 100644 --- a/app/views/new_user/dossiers/identite.html.haml +++ b/app/views/new_user/dossiers/identite.html.haml @@ -1,3 +1,6 @@ +- content_for :footer do + = render partial: "new_user/dossiers/footer", locals: { dossier: @dossier } + .two-columns .columns-container .column.preview @@ -11,7 +14,7 @@ .procedure-description = h string_to_html(@dossier.procedure.description) - .column + .column.identity-form = form_for @dossier.individual, url: update_identite_dossier_path(@dossier), html: { class: "form" } do |f| %h1 Données d'identité diff --git a/app/views/new_user/dossiers/modifier.html.haml b/app/views/new_user/dossiers/modifier.html.haml index 41ee58623..169aca13c 100644 --- a/app/views/new_user/dossiers/modifier.html.haml +++ b/app/views/new_user/dossiers/modifier.html.haml @@ -1,3 +1,6 @@ +- content_for :footer do + = render partial: "new_user/dossiers/footer", locals: { dossier: @dossier } + .dossier-edit .dossier-header .container diff --git a/app/views/layouts/_new_footer.html.haml b/app/views/root/_footer.html.haml similarity index 98% rename from app/views/layouts/_new_footer.html.haml rename to app/views/root/_footer.html.haml index 33ed6d2cc..7e73ff8b5 100644 --- a/app/views/layouts/_new_footer.html.haml +++ b/app/views/root/_footer.html.haml @@ -1,6 +1,7 @@ -%footer +%footer.landing-footer .container %ul.footer-columns + %li.footer-column %ul.footer-logos %li.footer-text diff --git a/app/views/root/landing.html.haml b/app/views/root/landing.html.haml index 38bed2226..00f53092a 100644 --- a/app/views/root/landing.html.haml +++ b/app/views/root/landing.html.haml @@ -1,4 +1,5 @@ -- content_for(:display_footer, true) +- content_for :footer do + = render partial: "root/footer" .landing .landing-panel.hero-panel diff --git a/spec/factories/dossier.rb b/spec/factories/dossier.rb index a491b48b8..a41fed27b 100644 --- a/spec/factories/dossier.rb +++ b/spec/factories/dossier.rb @@ -18,9 +18,15 @@ FactoryBot.define do end end + trait :with_service do + after(:build) do |dossier, _evaluator| + dossier.procedure.service = create(:service) + end + end + trait :for_individual do after(:build) do |dossier, _evaluator| - dossier.individual = create :individual + dossier.individual = create(:individual) dossier.save end end diff --git a/spec/factories/procedure.rb b/spec/factories/procedure.rb index b24fb1563..7d93b2eac 100644 --- a/spec/factories/procedure.rb +++ b/spec/factories/procedure.rb @@ -20,6 +20,12 @@ FactoryBot.define do end end + trait :with_service do + after(:build) do |procedure, _evaluator| + procedure.service = create(:service) + end + end + trait :with_api_carto do after(:build) do |procedure, _evaluator| procedure.module_api_carto.use_api_carto = true diff --git a/spec/views/new_user/dossiers/_footer.html.haml_spec.rb b/spec/views/new_user/dossiers/_footer.html.haml_spec.rb new file mode 100644 index 000000000..d840c876e --- /dev/null +++ b/spec/views/new_user/dossiers/_footer.html.haml_spec.rb @@ -0,0 +1,30 @@ +describe 'new_user/dossiers/_footer.html.haml', type: :view do + let(:service) { create(:service) } + let(:dossier) { + dossier = create(:dossier) + dossier.procedure.service = service + return dossier + } + + subject { render 'new_user/dossiers/footer.html.haml', dossier: dossier } + + it "affiche les informations de contact" do + expect(subject).to have_text(service.nom) + expect(subject).to have_text(service.organisme) + expect(subject).to have_text(service.telephone) + end + + it "affiche les liens usuels requis" do + expect(subject).to have_link("Accessibilité") + expect(subject).to have_link("CGU") + expect(subject).to have_link("Mentions légales") + end + + context "quand le dossier n'a pas de service associé" do + let(:service) { nil } + + it { is_expected.to have_selector("footer") } + it { is_expected.to have_link("Accessibilité") } + it { is_expected.not_to have_text('téléphone') } + end +end diff --git a/spec/views/new_user/dossiers/identite.html.haml_spec.rb b/spec/views/new_user/dossiers/identite.html.haml_spec.rb new file mode 100644 index 000000000..4eaa8c4ea --- /dev/null +++ b/spec/views/new_user/dossiers/identite.html.haml_spec.rb @@ -0,0 +1,25 @@ +require 'spec_helper' + +describe 'new_user/dossiers/identite.html.haml', type: :view do + let(:dossier) { create(:dossier, :with_entreprise, :with_service, state: 'brouillon', procedure: create(:procedure, :with_api_carto, :with_two_type_de_piece_justificative, for_individual: true)) } + let(:footer) { view.content_for(:footer) } + + before do + sign_in dossier.user + assign(:dossier, dossier) + end + + context 'test de composition de la page' do + before do + render + end + + it 'affiche les informations de la procédure' do + expect(rendered).to have_text(dossier.procedure.libelle) + end + + it 'prépare le footer' do + expect(footer).to have_selector('footer') + end + end +end diff --git a/spec/views/new_user/dossiers/modifier.html.haml_spec.rb b/spec/views/new_user/dossiers/modifier.html.haml_spec.rb new file mode 100644 index 000000000..d6ee1e0e4 --- /dev/null +++ b/spec/views/new_user/dossiers/modifier.html.haml_spec.rb @@ -0,0 +1,29 @@ +require 'spec_helper' + +describe 'new_user/dossiers/modifier.html.haml', type: :view do + let(:dossier) { create(:dossier, :with_entreprise, :with_service, state: 'brouillon', procedure: create(:procedure, :with_api_carto, :with_two_type_de_piece_justificative, for_individual: true)) } + let(:footer) { view.content_for(:footer) } + + before do + sign_in dossier.user + assign(:dossier, dossier) + end + + context 'test de composition de la page' do + before do + render + end + + it 'affiche le libellé de la procédure' do + expect(rendered).to have_text(dossier.procedure.libelle) + end + + it 'affiche les boutons de validation' do + expect(rendered).to have_selector('.send-wrapper') + end + + it 'prépare le footer' do + expect(footer).to have_selector('footer') + end + end +end