diff --git a/app/assets/stylesheets/new_design/help_dropdown.scss b/app/assets/stylesheets/new_design/help_dropdown.scss
index 01d8bd70c..d0f0d66d4 100644
--- a/app/assets/stylesheets/new_design/help_dropdown.scss
+++ b/app/assets/stylesheets/new_design/help_dropdown.scss
@@ -11,7 +11,7 @@
}
}
-h4.help-dropdown-title {
+.help-dropdown-title {
font-size: 16px;
color: $blue;
}
diff --git a/app/assets/stylesheets/new_design/new_footer.scss b/app/assets/stylesheets/new_design/new_footer.scss
index 092ee442b..7694d8d34 100644
--- a/app/assets/stylesheets/new_design/new_footer.scss
+++ b/app/assets/stylesheets/new_design/new_footer.scss
@@ -113,3 +113,19 @@ footer {
margin-bottom: 0;
}
}
+
+.footer-site-links {
+ li {
+ display: inline;
+
+
+ &::before {
+ content: "-";
+ margin: $default-spacer;
+ }
+
+ &:first-child::before {
+ content: none;
+ }
+ }
+}
diff --git a/app/assets/stylesheets/new_design/title.scss b/app/assets/stylesheets/new_design/title.scss
new file mode 100644
index 000000000..d02120e2f
--- /dev/null
+++ b/app/assets/stylesheets/new_design/title.scss
@@ -0,0 +1,12 @@
+@import "constants";
+
+.huge-title {
+ text-align: center;
+ margin-bottom: 20px;
+ font-size: 35px;
+ font-weight: bold;
+
+ @media (max-width: $two-columns-breakpoint) {
+ font-size: 25px;
+ }
+}
diff --git a/app/helpers/string_to_html_helper.rb b/app/helpers/string_to_html_helper.rb
index 76a595699..1bdb188f0 100644
--- a/app/helpers/string_to_html_helper.rb
+++ b/app/helpers/string_to_html_helper.rb
@@ -1,6 +1,6 @@
module StringToHtmlHelper
- def string_to_html(str)
- html_formatted = simple_format(str)
+ def string_to_html(str, wrapper_tag = 'p')
+ html_formatted = simple_format(str, {}, { wrapper_tag: wrapper_tag })
with_links = html_formatted.gsub(URI.regexp, '\0')
sanitize(with_links, attributes: ['target', 'rel', 'href'])
end
diff --git a/app/mailers/application_mailer.rb b/app/mailers/application_mailer.rb
index 3504f1a7a..b444548f4 100644
--- a/app/mailers/application_mailer.rb
+++ b/app/mailers/application_mailer.rb
@@ -3,6 +3,11 @@ class ApplicationMailer < ActionMailer::Base
default from: "demarches-simplifiees.fr <#{CONTACT_EMAIL}>"
layout 'mailer'
+ # Don’t retry to send a message if the server rejects the recipient address
+ rescue_from Net::SMTPSyntaxError do |_error|
+ message.perform_deliveries = false
+ end
+
# Attach the procedure logo to the email (if any).
# Returns the attachment url.
def attach_logo(procedure)
diff --git a/app/views/commencer/show.html.haml b/app/views/commencer/show.html.haml
index ee3564f92..661b2b4d2 100644
--- a/app/views/commencer/show.html.haml
+++ b/app/views/commencer/show.html.haml
@@ -2,7 +2,7 @@
.commencer.form
- if !user_signed_in?
- %h1 Commencer la démarche
+ %h2.huge-title Commencer la démarche
= link_to commencer_sign_up_path(path: @procedure.path), class: ['button large expand primary'] do
Créer un compte
%span.optional-on-small-screens
@@ -20,7 +20,7 @@
- elsif drafts.count == 1 && not_drafts.count == 0
- dossier = drafts.first
- %h1 Vous avez déjà commencé à remplir un dossier
+ %h2.huge-title Vous avez déjà commencé à remplir un dossier
%p
Il y a #{time_ago_in_words(dossier.created_at)},
vous avez commencé à remplir un dossier sur la démarche « #{dossier.procedure.libelle} ».
@@ -29,7 +29,7 @@
- elsif not_drafts.count == 1
- dossier = not_drafts.first
- %h1 Vous avez déjà déposé un dossier
+ %h2.huge-title Vous avez déjà déposé un dossier
%p
Il y a #{time_ago_in_words(dossier.en_construction_at)},
vous avez déposé un dossier sur la démarche « #{dossier.procedure.libelle} ».
@@ -37,6 +37,6 @@
= link_to 'Commencer un nouveau dossier', url_for_new_dossier(@procedure), class: ['button large expand']
- else
- %h1 Vous avez déjà des dossiers pour cette démarche
+ %h2.huge-title Vous avez déjà des dossiers pour cette démarche
= link_to 'Voir mes dossiers en cours', dossiers_path, class: ['button large expand primary']
= link_to 'Commencer un nouveau dossier', url_for_new_dossier(@procedure), class: ['button large expand']
diff --git a/app/views/layouts/_new_header.haml b/app/views/layouts/_new_header.haml
index 440a01b4a..7eae51026 100644
--- a/app/views/layouts/_new_header.haml
+++ b/app/views/layouts/_new_header.haml
@@ -3,7 +3,7 @@
- dossier = controller.try(:dossier_for_help)
- procedure = controller.try(:procedure_for_help)
-.new-header{ class: current_page?(root_path) ? nil : "new-header-with-border" }
+%header.new-header{ class: current_page?(root_path) ? nil : "new-header-with-border" }
.header-inner-content
.flex.align-center
diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml
index 7178d975f..8eb3e4004 100644
--- a/app/views/layouts/application.html.haml
+++ b/app/views/layouts/application.html.haml
@@ -33,8 +33,9 @@
Env Test
= render partial: "layouts/new_header"
- = render partial: "layouts/flash_messages"
- = content_for?(:content) ? yield(:content) : yield
+ %main
+ = render partial: "layouts/flash_messages"
+ = content_for?(:content) ? yield(:content) : yield
- if content_for?(:footer)
= content_for(:footer)
diff --git a/app/views/layouts/commencer/_no_procedure.html.haml b/app/views/layouts/commencer/_no_procedure.html.haml
index 34c054883..15a7c59a6 100644
--- a/app/views/layouts/commencer/_no_procedure.html.haml
+++ b/app/views/layouts/commencer/_no_procedure.html.haml
@@ -1,5 +1,5 @@
.no-procedure
- = image_tag "landing/hero/dematerialiser.svg", class: "paperless-logo"
+ = image_tag "landing/hero/dematerialiser.svg", class: "paperless-logo", alt: "moins de papier"
.baseline.center
%h3 Un outil simple
%p
diff --git a/app/views/root/_footer.html.haml b/app/views/root/_footer.html.haml
index ac7462fec..7a49639b8 100644
--- a/app/views/root/_footer.html.haml
+++ b/app/views/root/_footer.html.haml
@@ -6,22 +6,22 @@
%ul.footer-logos
%li.footer-text
Un service fourni par la
- = link_to "DINSIC", "http://www.modernisation.gouv.fr/"
+ = link_to "DINUM", "http://www.modernisation.gouv.fr/", title: "Direction Interministérielle au Numérique"
%br
et incubé par
- = link_to "beta.gouv.fr", "https://beta.gouv.fr"
+ = link_to "beta.gouv.fr", "https://beta.gouv.fr", title: "le site de Beta.gouv.fr"
%li
- = link_to "http://www.modernisation.gouv.fr/" do
+ = link_to "http://www.modernisation.gouv.fr/", title: "DINUM" do
%span.footer-logo.footer-logo-dinsic{ role: 'img', 'aria-label': 'DINSIC' }
- = link_to "https://beta.gouv.fr" do
+ = link_to "https://beta.gouv.fr", title: "le site de Beta.gouv.fr" do
%span.footer-logo.footer-logo-beta-gouv-fr{ role: 'img', 'aria-label': 'beta.gouv.fr' }
%li.footer-column
%ul.footer-links
%li.footer-link
- = link_to "Newsletter", "https://my.sendinblue.com/users/subscribe/js_id/3s2q1/id/1", :class => "footer-link", :target => "_blank", rel: "noopener"
+ = link_to "Newsletter", "https://my.sendinblue.com/users/subscribe/js_id/3s2q1/id/1", :title => "Notre newsletter", :class => "footer-link", :target => "_blank", rel: "noopener"
%li.footer-link
- = link_to "Nouveautés", "https://github.com/betagouv/demarches-simplifiees.fr/releases", :class => "footer-link"
+ = link_to "Nouveautés", "https://github.com/betagouv/demarches-simplifiees.fr/releases", :class => "footer-link", :title => "Nos nouveautés"
%li.footer-link
= link_to "Statistiques", stats_path, :class => "footer-link", data: { turbolinks: false } # Turbolinks disabled for Chartkick. See Issue #350
%li.footer-link
diff --git a/app/views/root/landing.html.haml b/app/views/root/landing.html.haml
index 72bd6b341..3c72e717c 100644
--- a/app/views/root/landing.html.haml
+++ b/app/views/root/landing.html.haml
@@ -14,13 +14,13 @@
%em.hero-tagline-em en ligne
.hero-illustration
- %img{ :src => image_url("landing/hero/dematerialiser.svg"), alt: "" }
+ %img{ :src => image_url("landing/hero/dematerialiser.svg"), alt: "dématérialisez" }
.landing-panel.usagers-panel
.container
.role-panel-wrapper
.role-panel-30.role-usagers-image
- %img.role-image{ :src => image_url("landing/roles/usagers.svg"), alt: "" }
+ %img.role-image{ :src => image_url("landing/roles/usagers.svg"), alt: "usager" }
.role-panel-70
%h1.role-panel-title Vous souhaitez effectuer une demande auprès d'une administration ?
diff --git a/app/views/shared/_procedure_description.html.haml b/app/views/shared/_procedure_description.html.haml
index 52d7b9460..03713ae51 100644
--- a/app/views/shared/_procedure_description.html.haml
+++ b/app/views/shared/_procedure_description.html.haml
@@ -1,8 +1,8 @@
.procedure-logos
- = image_tag procedure.logo_url
+ = image_tag procedure.logo_url, alt: "logo #{procedure.libelle}"
- if procedure.euro_flag
= image_tag("flag_of_europe.svg", id: 'euro_flag', class: (!procedure.euro_flag ? "hidden" : ""))
-%h2.procedure-title
+%h1.procedure-title
= procedure.libelle
.procedure-description
.procedure-description-body.read-more-enabled.read-more-collapsed
diff --git a/app/views/shared/help/dropdown_items/_email_item.html.haml b/app/views/shared/help/dropdown_items/_email_item.html.haml
index e921003e5..d409ab875 100644
--- a/app/views/shared/help/dropdown_items/_email_item.html.haml
+++ b/app/views/shared/help/dropdown_items/_email_item.html.haml
@@ -2,5 +2,5 @@
= mail_to CONTACT_EMAIL do
%span.icon.mail
.dropdown-description
- %h4.help-dropdown-title Contact technique
+ %span.help-dropdown-title Contact technique
%p Envoyez nous un message à #{CONTACT_EMAIL}.
diff --git a/app/views/shared/help/dropdown_items/_faq_item.html.haml b/app/views/shared/help/dropdown_items/_faq_item.html.haml
index 86f82348b..fd48bb56d 100644
--- a/app/views/shared/help/dropdown_items/_faq_item.html.haml
+++ b/app/views/shared/help/dropdown_items/_faq_item.html.haml
@@ -2,5 +2,5 @@
= link_to FAQ_URL, target: "_blank", rel: "noopener" do
%span.icon.help
.dropdown-description
- %h4.help-dropdown-title Un problème avec le site ?
+ %span.help-dropdown-title Un problème avec le site ?
%p Trouvez votre réponse dans l’aide en ligne.
diff --git a/app/views/shared/help/dropdown_items/_messagerie_item.html.haml b/app/views/shared/help/dropdown_items/_messagerie_item.html.haml
index 2e25a78c8..94d31143d 100644
--- a/app/views/shared/help/dropdown_items/_messagerie_item.html.haml
+++ b/app/views/shared/help/dropdown_items/_messagerie_item.html.haml
@@ -2,5 +2,5 @@
= link_to messagerie_dossier_path(dossier) do
%span.icon.mail
.dropdown-description
- %h4.help-dropdown-title= title
+ %span.help-dropdown-title= title
%p Envoyez directement un message à l’instructeur.
diff --git a/app/views/shared/help/dropdown_items/_service_item.html.haml b/app/views/shared/help/dropdown_items/_service_item.html.haml
index af8624549..c57a0bada 100644
--- a/app/views/shared/help/dropdown_items/_service_item.html.haml
+++ b/app/views/shared/help/dropdown_items/_service_item.html.haml
@@ -1,7 +1,7 @@
%li.help-dropdown-service
%span.icon.person
.dropdown-description
- %h4.help-dropdown-title= title
+ %span.help-dropdown-title= title
.help-dropdown-service-action
%p Contactez directement l’administration :
%p.help-dropdown-service-item
diff --git a/app/views/users/_general_footer_row.html.haml b/app/views/users/_general_footer_row.html.haml
index 8d994718e..987c199e4 100644
--- a/app/views/users/_general_footer_row.html.haml
+++ b/app/views/users/_general_footer_row.html.haml
@@ -1,11 +1,7 @@
-= link_to "Accessibilité", accessibilite_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 'Documentation', DOC_URL
-–
-= contact_link "Contact technique", class: "footer-link", dossier_id: dossier&.id
-–
-= link_to 'Aide', FAQ_URL
+%ul.footer-row.footer-bottom-line.footer-site-links
+ %li>= link_to "Accessibilité", accessibilite_path
+ %li>= link_to "CGU", CGU_URL, target: "_blank", rel: "noopener noreferrer"
+ %li>= link_to "Mentions légales", MENTIONS_LEGALES_URL, target: "_blank", rel: "noopener noreferrer"
+ %li>= link_to 'Documentation', DOC_URL
+ %li>= contact_link "Contact technique", dossier_id: dossier&.id
+ %li>= link_to 'Aide', FAQ_URL
diff --git a/app/views/users/_procedure_footer.html.haml b/app/views/users/_procedure_footer.html.haml
index 458c6ed00..1286ea584 100644
--- a/app/views/users/_procedure_footer.html.haml
+++ b/app/views/users/_procedure_footer.html.haml
@@ -2,19 +2,19 @@
.container
- service = procedure.service
- if service.present?
- %ul.footer-row.footer-columns
- %li.footer-column
- %h3.footer-header Cette démarche est gérée par :
- %p
+ .footer-row.footer-columns
+ %ul.footer-column
+ %p.footer-header Cette démarche est gérée par :
+ %li
= service.nom
%br
= service.organisme
%br
- = string_to_html(service.adresse)
+ = string_to_html(service.adresse, wrapper_tag = 'span')
- %li.footer-column
- %h3.footer-header Poser une question sur votre dossier :
- %p
+ %ul.footer-column
+ %p.footer-header Poser une question sur votre dossier :
+ %li
- if dossier.present? && dossier.messagerie_available?
Directement
= link_to "par la messagerie", messagerie_dossier_path(dossier)
@@ -22,21 +22,21 @@
Par email :
= link_to service.email, "mailto:#{service.email}"
- %p
+ %li
Par téléphone :
%a{ href: "tel:#{service.telephone}" }= service.telephone
- %p
+ %li
- horaires = "Horaires : #{formatted_horaires(service.horaires)}"
- = simple_format(horaires)
+ = simple_format(horaires, {}, wrapper_tag: 'span')
- politiques = politiques_conservation_de_donnees(procedure)
- if politiques.present?
- %li.footer-column
- %h3.footer-header Conservation des données :
+ %ul.footer-column
+ %p.footer-header Conservation des données :
- politiques.each do |politique|
- %p= politique
+ %li= politique
+
+ = render partial: 'users/general_footer_row', locals: { dossier: dossier }
- .footer-row.footer-bottom-line
- = render partial: 'users/general_footer_row', locals: { dossier: dossier }
diff --git a/app/views/users/dossiers/_index_footer.html.haml b/app/views/users/dossiers/_index_footer.html.haml
index 935c93bbc..16f9f1273 100644
--- a/app/views/users/dossiers/_index_footer.html.haml
+++ b/app/views/users/dossiers/_index_footer.html.haml
@@ -1,4 +1,3 @@
%footer.procedure-footer
.container
- .footer-row.footer-bottom-line
- = render partial: "users/general_footer_row", locals: { dossier: nil }
+ = render partial: "users/general_footer_row", locals: { dossier: nil }
diff --git a/app/views/users/sessions/new.html.haml b/app/views/users/sessions/new.html.haml
index e92e681e2..5cdd40be4 100644
--- a/app/views/users/sessions/new.html.haml
+++ b/app/views/users/sessions/new.html.haml
@@ -3,7 +3,7 @@
.auth-form.sign-in-form
= form_for User.new, url: user_session_path, html: { class: "form" } do |f|
- %h1 Connectez-vous
+ %h2.huge-title Connectez-vous
= f.label :email, "Email"
= f.text_field :email, autofocus: true
diff --git a/spec/mailers/application_mailer_spec.rb b/spec/mailers/application_mailer_spec.rb
new file mode 100644
index 000000000..9cfa295f9
--- /dev/null
+++ b/spec/mailers/application_mailer_spec.rb
@@ -0,0 +1,20 @@
+RSpec.describe ApplicationMailer, type: :mailer do
+ describe 'dealing with invalid emails' do
+ let(:dossier) { create(:dossier, procedure: build(:simple_procedure)) }
+ subject { DossierMailer.notify_new_draft(dossier) }
+
+ describe 'invalid emails are not sent' do
+ before do
+ allow_any_instance_of(DossierMailer)
+ .to receive(:notify_new_draft)
+ .and_raise(Net::SMTPSyntaxError)
+ end
+
+ it { expect(subject.message).to be_an_instance_of(ActionMailer::Base::NullMail) }
+ end
+
+ describe 'valid emails are sent' do
+ it { expect(subject.message).not_to be_an_instance_of(ActionMailer::Base::NullMail) }
+ end
+ end
+end