From c95cd68fbd4921c1553ce960bdbd97dd299af8b2 Mon Sep 17 00:00:00 2001
From: Arnaud Levy <contact@arnaudlevy.com>
Date: Wed, 8 Mar 2023 10:09:38 +0100
Subject: [PATCH] clean

---
 app/views/extranet/contacts/search/_form.html.erb | 4 ++--
 app/views/extranet/contacts/search/index.html.erb | 2 +-
 app/views/extranet/home/index.html.erb            | 9 +--------
 config/locales/extranet/en.yml                    | 6 ++++++
 config/locales/extranet/fr.yml                    | 6 ++++++
 5 files changed, 16 insertions(+), 11 deletions(-)

diff --git a/app/views/extranet/contacts/search/_form.html.erb b/app/views/extranet/contacts/search/_form.html.erb
index 0eb7b704b..23b976e7d 100644
--- a/app/views/extranet/contacts/search/_form.html.erb
+++ b/app/views/extranet/contacts/search/_form.html.erb
@@ -2,13 +2,13 @@
   <div class="row g-3">
     <div class="col">
       <input  class="form-control form-control-lg" 
-              placeholder="Entrez votre recherche ici"
+              placeholder="<%= t 'extranet.contacts.search.placeholder' %>"
               type="text"
               name="term"
               value="<%= @term %>">
     </div>
     <div class="col-auto">
-      <input type="submit" name="commit" value="Chercher" class="btn btn-primary btn-lg">
+      <input type="submit" value="<%= t 'extranet.contacts.search.submit' %>" class="btn btn-primary btn-lg">
     </div>
   </div>
 <% end %>
diff --git a/app/views/extranet/contacts/search/index.html.erb b/app/views/extranet/contacts/search/index.html.erb
index cb6efd0a7..1a7be25b4 100644
--- a/app/views/extranet/contacts/search/index.html.erb
+++ b/app/views/extranet/contacts/search/index.html.erb
@@ -1,4 +1,4 @@
-<% content_for :title, "Recherche de “#{@term}”" %>
+<% content_for :title, t('extranet.contacts.search.title') %>
 
 <%= render 'extranet/contacts/search/form' %>
 
diff --git a/app/views/extranet/home/index.html.erb b/app/views/extranet/home/index.html.erb
index c57895292..21e858b99 100644
--- a/app/views/extranet/home/index.html.erb
+++ b/app/views/extranet/home/index.html.erb
@@ -4,14 +4,7 @@
     <% if current_extranet.home_sentence.present? %>
       <%= current_extranet.home_sentence.html_safe %>
     <% else %>
-      <%# TODO i18n %>
-      Bienvenue sur l’extranet <%= current_context %>. 
-      Retrouvez les <%= link_to University::Person::Alumnus.model_name.human(count: 2).downcase, alumni_university_persons_path %>, 
-      <% if current_extranet.should_show_years? %>
-      recherchez par <%= link_to Education::AcademicYear.model_name.human(count: 2).downcase, alumni_education_academic_years_path %>, 
-      <% end %>
-      explorez les <%= link_to Education::Cohort.model_name.human(count: 2).downcase, alumni_education_cohorts_path %>,
-      découvrez les <%= link_to University::Organization.model_name.human(count: 2).downcase, alumni_university_organizations_path %>.
+      <%= t 'extranet.home.welcome' %>
     <% end %>
   </h1>
 <% end %>
diff --git a/config/locales/extranet/en.yml b/config/locales/extranet/en.yml
index b8f4c467c..c23f2e0be 100644
--- a/config/locales/extranet/en.yml
+++ b/config/locales/extranet/en.yml
@@ -7,6 +7,11 @@ en:
       edit_personal_data: Edit profile
       updated: Updated
       logout: Log out
+    contacts:
+      search:
+        title: Search
+        placeholder: Type your search here
+        submit: Search
     data: Data
     errors:
       email_not_allowed: is not authorized to access this extranet.
@@ -18,6 +23,7 @@ en:
     home:
       recent_cohorts: Recent cohorts
       recent_experiences: Recent experiences
+      welcome: Welcome!
     menu: Menu
     organization:
       experiences: Alumni in this organization (%{count})
diff --git a/config/locales/extranet/fr.yml b/config/locales/extranet/fr.yml
index 5efd360d0..df7df1cca 100644
--- a/config/locales/extranet/fr.yml
+++ b/config/locales/extranet/fr.yml
@@ -7,6 +7,11 @@ fr:
       edit_personal_data: Modifier mon profil
       updated: Mise à jour effectuée
       logout: Déconnexion
+    contacts:
+      search:
+        title: Recherche
+        placeholder: Entrez votre recherche ici
+        submit: Chercher
     data: Informations
     errors:
       email_not_allowed: n'est pas autorisé à accéder à cet extranet.
@@ -18,6 +23,7 @@ fr:
     home:
       recent_cohorts: Promotions récentes
       recent_experiences: Mouvements récents
+      welcome: Bienvenue !
     menu: Menu
     organization:
       experiences: Alumni dans cette organisation (%{count})
-- 
GitLab