From 8d3972ffa7e4922aaa71c8432341aaf1f832643a Mon Sep 17 00:00:00 2001 From: SirineMhedhbi <31127782+SirineMhedhbi@users.noreply.github.com> Date: Wed, 6 Dec 2023 23:45:20 +0100 Subject: [PATCH] Fix: the account creation page content (#401) * Fix locales EN and FR with a bunch of changes (#391) * Fixing fr and en locales (step 1) * Fixing fr and en locales (step 2) * Fixing fr and en locales (step 3) * change the display of errors text * fix changes of texts on lost password page * change the register text in account page * update the orchid error text --------- Co-authored-by: Clement Jonquet Co-authored-by: Syphax bouazzouni --- app/controllers/users_controller.rb | 4 ++-- app/views/login/lost_password.html.haml | 2 +- app/views/login/lost_password_success.html.haml | 2 +- app/views/users/new.html.haml | 2 +- app/views/users/show.html.haml | 2 +- config/locales/en.yml | 2 -- config/locales/fr.yml | 1 - 7 files changed, 6 insertions(+), 9 deletions(-) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 86d9a2e6a..dc6c75bdb 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -227,7 +227,7 @@ def validate(params) end end if ((!params[:orcidId].match(/^\d{4}+(-\d{4})+$/)) || (params[:orcidId].length != 19)) && !(params[:orcidId].nil? || params[:orcidId].length < 1) - errors << "Please enter a valide orcid id" + errors << "Please enter a valid ORCID." end if params[:username].nil? || params[:username].length < 1 || !params[:username].match(/^[a-zA-Z0-9]([._-](?![._-])|[a-zA-Z0-9]){3,18}[a-zA-Z0-9]$/) @@ -251,7 +251,7 @@ def validate_update(params) errors << "Last name field is required" end if params[:orcidId].present? && ((!params[:orcidId].match(/^\d{4}-\d{4}-\d{4}-\d{4}$/)) || (params[:orcidId].length != 19)) - errors << "Please enter a valide orcide id" + errors << "Please enter a valid ORCID." end if !params[:password].eql?(params[:password_confirmation]) errors << "Your Password and Password Confirmation do not match" diff --git a/app/views/login/lost_password.html.haml b/app/views/login/lost_password.html.haml index 953fb9121..49d75bb51 100644 --- a/app/views/login/lost_password.html.haml +++ b/app/views/login/lost_password.html.haml @@ -9,7 +9,7 @@ Recover password %hr#lost-password-title-line/ %div - %p.lost-password-description Enter the email associated with your account and we will send an email with instructions to reset your password + %p.lost-password-description Enter the email address associated with your account and we will send an email with instructions to reset your password. %p.lost-password-input-title Email = text_field 'user', :email,class: "lost-password-input", placeholder: "Enter the email" %input.lost-password-button{:type => "submit", :value => "Send instructions"}/ diff --git a/app/views/login/lost_password_success.html.haml b/app/views/login/lost_password_success.html.haml index 92d3057ec..9866efa9c 100644 --- a/app/views/login/lost_password_success.html.haml +++ b/app/views/login/lost_password_success.html.haml @@ -1 +1 @@ -= render(CardMessageComponent.new(message: "A password reset email has been sent to your email, please follow the instructions in the email to reset your password.", button_text: "Back home", type:"success")) += render(CardMessageComponent.new(message: "A password reset email has been sent to your email address, please follow the instructions to reset your password.", button_text: "Back home", type:"success")) diff --git a/app/views/users/new.html.haml b/app/views/users/new.html.haml index e74647652..e6d6bc8bc 100644 --- a/app/views/users/new.html.haml +++ b/app/views/users/new.html.haml @@ -5,5 +5,5 @@ = t('register.account_errors') %ul - for error in @errors - %li= error + %li= error.is_a?(Array) ? error.last : error = render :partial => 'form', :locals => {:f => f} diff --git a/app/views/users/show.html.haml b/app/views/users/show.html.haml index 27ace67c2..f47328998 100644 --- a/app/views/users/show.html.haml +++ b/app/views/users/show.html.haml @@ -37,7 +37,7 @@ .account-page-card-container .account-page-card-sub-container %h4.account-page-card-title Mailing List Subscription - %p.account-page-card-desc= "#{portal_name} announcements email list" + %p.account-page-card-desc="Register to the #{portal_name} announcements mailing list." - subscribed = false - if subscribed %a.account-page-subscribe-button{:href =>"mailto:#{$ANNOUNCE_SERVICE_HOST}?Subject=unsubscribe%20#{$ANNOUNCE_LIST}"} diff --git a/config/locales/en.yml b/config/locales/en.yml index 0c781d383..8d96a929e 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -203,8 +203,6 @@ en: about_us: About Us projects: D2KAB team: Team - - login: enter_email: Enter your username enter_password: Enter your password diff --git a/config/locales/fr.yml b/config/locales/fr.yml index b08afe772..13897d9b4 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -205,7 +205,6 @@ fr: about_us: À propos de nous projects: D2KAB team: Équipe - login: enter_email: Saisissez votre nom d'utilisateur