diff --git a/app/views/layouts/_new_header.haml b/app/views/layouts/_new_header.haml index 8bba0a619..87e1b7aa0 100644 --- a/app/views/layouts/_new_header.haml +++ b/app/views/layouts/_new_header.haml @@ -20,7 +20,7 @@ - else - root_profile_link, root_profile_libelle = root_path_info_for_profile(nav_bar_profile) = link_to root_profile_link, class: 'header-logo justify-center', title: root_profile_libelle do - = image_tag 'marianne.png', alt: 'Liberté, égalité, fraternité', width: '65', height: 56, loading: 'lazy' + = image_tag HEADER_LOGO_SRC, alt: HEADER_LOGO_ALT, width: HEADER_LOGO_WIDTH, height: HEADER_LOGO_HEIGHT, loading: 'lazy' %span.big.site-title> = APPLICATION_NAME %span.small.site-title> diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index 8383106fe..55ba66a6c 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -9,9 +9,9 @@ %title = content_for?(:title) ? "#{yield(:title)} · #{APPLICATION_NAME}" : APPLICATION_NAME - = favicon_link_tag(image_url("favicons/16x16.png"), type: "image/png", sizes: "16x16") - = favicon_link_tag(image_url("favicons/32x32.png"), type: "image/png", sizes: "32x32") - = favicon_link_tag(image_url("favicons/96x96.png"), type: "image/png", sizes: "96x96") + = favicon_link_tag(image_url("#{FAVICON_16PX_SRC}"), type: "image/png", sizes: "16x16") + = favicon_link_tag(image_url("#{FAVICON_32PX_SRC}"), type: "image/png", sizes: "32x32") + = favicon_link_tag(image_url("#{FAVICON_96PX_SRC}"), type: "image/png", sizes: "96x96") - packs = ['application', 'track', administrateur_signed_in? ? 'track-admin' : nil].compact = javascript_packs_with_chunks_tag *packs, defer: true diff --git a/app/views/layouts/application_old.html.haml b/app/views/layouts/application_old.html.haml index 1857a849d..dd6ee1301 100644 --- a/app/views/layouts/application_old.html.haml +++ b/app/views/layouts/application_old.html.haml @@ -5,9 +5,9 @@ = t('dynamics.page_title') %meta{ 'http-equiv' => "X-UA-Compatible", :content => "IE=edge" } - = favicon_link_tag(image_url("favicons/16x16.png"), type: "image/png", sizes: "16x16") - = favicon_link_tag(image_url("favicons/32x32.png"), type: "image/png", sizes: "32x32") - = favicon_link_tag(image_url("favicons/96x96.png"), type: "image/png", sizes: "96x96") + = favicon_link_tag(image_url("#{FAVICON_16PX_SRC}"), type: "image/png", sizes: "16x16") + = favicon_link_tag(image_url("#{FAVICON_32PX_SRC}"), type: "image/png", sizes: "32x32") + = favicon_link_tag(image_url("#{FAVICON_96PX_SRC}"), type: "image/png", sizes: "96x96") = stylesheet_link_tag 'application', media: 'all' = stylesheet_link_tag 'print', media: 'print' diff --git a/app/views/layouts/mailers/layout.html.erb b/app/views/layouts/mailers/layout.html.erb index def0c22e4..564a96ee3 100644 --- a/app/views/layouts/mailers/layout.html.erb +++ b/app/views/layouts/mailers/layout.html.erb @@ -50,7 +50,7 @@
- Logo <%= " src="<%= image_url('mailer/instructeur_mailer/logo.png') %>" style="max-width=600px; padding=30px 0; display=inline !important; vertical-align=bottom; border=0; height=auto; outline=none; text-decoration=none; -ms-interpolation-mode=bicubic;" /> + Logo <%= " src="<%= image_url("#{MAILER_LOGO_SRC}") %>" style="max-width=600px; padding=30px 0; display=inline !important; vertical-align=bottom; border=0; height=auto; outline=none; text-decoration=none; -ms-interpolation-mode=bicubic;" />
diff --git a/app/views/layouts/print.html.haml b/app/views/layouts/print.html.haml index 332c6430a..7ab8d72d3 100644 --- a/app/views/layouts/print.html.haml +++ b/app/views/layouts/print.html.haml @@ -8,9 +8,9 @@ %title = t("dynamics.page_title") - = favicon_link_tag(image_url("favicons/16x16.png"), type: "image/png", sizes: "16x16") - = favicon_link_tag(image_url("favicons/32x32.png"), type: "image/png", sizes: "32x32") - = favicon_link_tag(image_url("favicons/96x96.png"), type: "image/png", sizes: "96x96") + = favicon_link_tag(image_url("#{FAVICON_16PX_SRC}"), type: "image/png", sizes: "16x16") + = favicon_link_tag(image_url("#{FAVICON_32PX_SRC}"), type: "image/png", sizes: "32x32") + = favicon_link_tag(image_url("#{FAVICON_96PX_SRC}"), type: "image/png", sizes: "96x96") = stylesheet_link_tag "new_design/print", media: "all" diff --git a/config/env.example.optional b/config/env.example.optional index 819aebf47..96e4e6956 100644 --- a/config/env.example.optional +++ b/config/env.example.optional @@ -27,5 +27,19 @@ APPLICATION_BASE_URL="https://www.demarches-simplifiees.fr" # Personnalisation d'instance - Page externe "Disponibilité" (status page) # STATUS_PAGE_URL="" +# Personnalisation d'instance - Favicons ---> à placer dans "app/assets/images" +# FAVICON_16PX_SRC="favicons/16x16.png" +# FAVICON_32PX_SRC="favicons/32x32.png" +# FAVICON_96PX_SRC="favicons/96x96.png" + +# Personnalisation d'instance - Logo de l'application ---> à placer dans "app/assets/images" +# HEADER_LOGO_SRC="marianne.png" +# HEADER_LOGO_ALT="" +# HEADER_LOGO_WIDTH="65" +# HEADER_LOGO_HEIGHT="56" + +# Personnalisation d'instance - Logo dans l'entête des emails ---> à placer dans "app/assets/images" +# MAILER_LOGO_SRC="mailer/instructeur_mailer/logo.png" + # Personnalisation d'instance - fichier utilisé pour poser un filigrane sur les pièces d'identité # WATERMARK_FILE="" diff --git a/config/initializers/images.rb b/config/initializers/images.rb new file mode 100644 index 000000000..d8415c742 --- /dev/null +++ b/config/initializers/images.rb @@ -0,0 +1,13 @@ +# Favicons +FAVICON_16PX_SRC = ENV.fetch("FAVICON_16PX_SRC", "favicons/16x16.png") +FAVICON_32PX_SRC = ENV.fetch("FAVICON_32PX_SRC", "favicons/32x32.png") +FAVICON_96PX_SRC = ENV.fetch("FAVICON_96PX_SRC", "favicons/96x96.png") + +# Header logo +HEADER_LOGO_SRC = ENV.fetch("HEADER_LOGO_SRC", "marianne.png") +HEADER_LOGO_ALT = ENV.fetch("HEADER_LOGO_ALT", "Liberté, égalité, fraternité") +HEADER_LOGO_WIDTH = ENV.fetch("HEADER_LOGO_WIDTH", "65") +HEADER_LOGO_HEIGHT = ENV.fetch("HEADER_LOGO_HEIGHT", "56") + +# Mailer logo +MAILER_LOGO_SRC = ENV.fetch("MAILER_LOGO_SRC", "mailer/instructeur_mailer/logo.png")