diff --git a/app/models/user/with_person.rb b/app/models/user/with_person.rb index e69619dc27abf3aba891223fea4ba8fcd5376fb1..0b6a4a000c386beb42461c34793b0375a121d29b 100644 --- a/app/models/user/with_person.rb +++ b/app/models/user/with_person.rb @@ -13,12 +13,10 @@ module User::WithPerson protected def find_or_create_person - person = university.people.where(email: email).first_or_initialize do |person| - person.first_name = first_name - person.last_name = last_name - person.slug = person.to_s.parameterize - person.phone_mobile = mobile_phone - end + person = university.people.where(email: email).first || university.people.new + person.first_name = first_name + person.last_name = last_name + person.slug = person.to_s.parameterize person.user = self person.save end @@ -26,9 +24,7 @@ module User::WithPerson def sync_person person.first_name = first_name person.last_name = last_name - person.email = email person.slug = person.to_s.parameterize - person.phone_mobile = mobile_phone person.picture.purge if picture_infos.present? && person.picture&.attached? person.save end diff --git a/app/views/admin/university/people/_form.html.erb b/app/views/admin/university/people/_form.html.erb index 0f1b6dfafe193277a3d91416d95d98a65f2d964e..e2db4f3ec89079232afc56a774fe398a299251e4 100644 --- a/app/views/admin/university/people/_form.html.erb +++ b/app/views/admin/university/people/_form.html.erb @@ -28,7 +28,7 @@ </div> </div> <%= f.input :description_short %> - <%= f.input :biography, + <%= f.input :biography, as: :summernote, input_html: { data: { 'summernote-config' => 'mini-list' } @@ -42,6 +42,7 @@ </h5> </div> <div class="card-body"> + <p><em><%= t("university.person.personal_data_warning") %></em></p> <div class="row"> <div class="col-md-6"> <%= f.input :email %> diff --git a/config/locales/en.yml b/config/locales/en.yml index 0cf9842d299178708e7f6b625950ca57fa0ae0bf..95c347b9d4d3b4a493dc83d4ec1b7b9694ff867f 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -265,7 +265,7 @@ en: iso_code: ISO 639-1 code (cf <a href="https://fr.wikipedia.org/wiki/Liste_des_codes_ISO_639-1" target="_blank">WikiPedia</a>) name: Name in the language (= "Français", "Deutsch", ...) user: - mobile_phone: "International format (+XX). By filling this field, you accept to receive your two-factor authentication codes via SMS." + mobile_phone: "International format (+XX). This number remains private. By filling this field, you accept to receive your two-factor authentication codes via SMS." include_blanks: defaults: language: "Select a language" diff --git a/config/locales/fr.yml b/config/locales/fr.yml index e2565933432d4afc848faded28c1b4983f61a23b..9ffb1b8cbdc713758bdc7b8bc32a5845a46fc531 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -265,7 +265,7 @@ fr: iso_code: Code ISO 639-1 (cf <a href="https://fr.wikipedia.org/wiki/Liste_des_codes_ISO_639-1" target="_blank">WikiPedia</a>) name: Nom dans la langue (= "Français", "Deutsch", ...) user: - mobile_phone: "Format international (+XX). En renseignant ce champ, vous acceptez de recevoir vos codes de double authentification par SMS." + mobile_phone: "Format international (+XX). Ce numéro reste privé. En renseignant ce champ, vous acceptez de recevoir vos codes de double authentification par SMS." include_blanks: defaults: language: "Sélectionnez une langue" diff --git a/config/locales/university/en.yml b/config/locales/university/en.yml index 0bd503f0f4a889685fe8a9b6cabf145e1eef3c32..9660c466a78a12a13c8c13c7bcc5747ae9dedc92 100644 --- a/config/locales/university/en.yml +++ b/config/locales/university/en.yml @@ -191,6 +191,7 @@ en: no_organization_hint_html: "If the organization is not in the list, you can <a href=\"%{url}\">create it</a>" no_organization_hint_no_access_html: "If the organization is not in the list, you should ask to create it" period: Period - taught_programs: Taught programs + personal_data_warning: Warning! The information provided below can be publicly visible on the websites and the extranets about you. + taught_programs: Taught programs sso: SSO sso_key: SSO Key diff --git a/config/locales/university/fr.yml b/config/locales/university/fr.yml index 86b1c678b9ad83906711dec9977125e0c9fcd672..50d45dc5145c22bd2fedc956a99c57a2816cff37 100644 --- a/config/locales/university/fr.yml +++ b/config/locales/university/fr.yml @@ -191,6 +191,7 @@ fr: no_organization_hint_html: "Si l'entreprise n'apparait pas dans la liste, vous pouvez la <a href=\"%{url}\">créer</a>" no_organization_hint_no_access_html: "Si l'entreprise n'apparait pas dans la liste, il faut demander à la créer" period: Période + personal_data_warning: Attention ! Les informations renseignées ici sont susceptibles d'être visibles publiquement sur les sites web et les extranets vous concernant. taught_programs: Formations enseignées sso: SSO sso_key: Clé sur le SSO