From c578c1f701bd5a4407701001ac784da67f1b3eb4 Mon Sep 17 00:00:00 2001
From: pabois <pierreandre.boissinot@noesya.coop>
Date: Mon, 23 Oct 2023 16:51:00 +0200
Subject: [PATCH] Neutralize and send correct site title

---
 app/views/devise/registrations/new.html.erb | 2 +-
 app/views/devise/sessions/new.html.erb      | 2 +-
 config/locales/devise.en.yml                | 4 ++--
 config/locales/devise.fr.yml                | 4 ++--
 4 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/app/views/devise/registrations/new.html.erb b/app/views/devise/registrations/new.html.erb
index e0840a6cb..0617c8886 100644
--- a/app/views/devise/registrations/new.html.erb
+++ b/app/views/devise/registrations/new.html.erb
@@ -1,4 +1,4 @@
-<%= content_for :title, t('.title') %>
+<%= content_for :title, t('.title', title: current_extranet.present? ? current_extranet.name : 'Osuny') %>
 
 <h2 class="mb-4"><%= t(".sign_up") %></h2>
 
diff --git a/app/views/devise/sessions/new.html.erb b/app/views/devise/sessions/new.html.erb
index b88f05d8d..afd0b0b68 100644
--- a/app/views/devise/sessions/new.html.erb
+++ b/app/views/devise/sessions/new.html.erb
@@ -1,4 +1,4 @@
-<%= content_for :title, t('.title') %>
+<%= content_for :title, t('.title', title: current_extranet.present? ? current_extranet.name : 'Osuny') %>
 
 <div class="row">
   <div class="col-md-6 mb-5">
diff --git a/config/locales/devise.en.yml b/config/locales/devise.en.yml
index a6530d7da..e623f762d 100644
--- a/config/locales/devise.en.yml
+++ b/config/locales/devise.en.yml
@@ -12,10 +12,10 @@ en:
       edit:
         title: Account edition
       new: 
-        title: Register on Osuny
+        title: "Register - %{title}"
     sessions:
       new:
-        title: Welcome to Osuny
+        title: "Welcome - %{title}"
     two_factor_authentication:
       max_login_attempts_reached:
         title: Maximul login attemps reached
diff --git a/config/locales/devise.fr.yml b/config/locales/devise.fr.yml
index 8682c0c11..193656edf 100644
--- a/config/locales/devise.fr.yml
+++ b/config/locales/devise.fr.yml
@@ -12,10 +12,10 @@ fr:
       edit:
         title: Modification de votre compte
       new: 
-        title: Inscription sur Osuny
+        title: "Inscription - %{title}"
     sessions:
       new:
-        title: Bienvenue sur Osuny
+        title: "Bienvenue - %{title}"
     two_factor_authentication:
       max_login_attempts_reached:
         title: Maximum d'essais atteint
-- 
GitLab