From 6b14420ffae5b3d712601686ad2c659cabef6c23 Mon Sep 17 00:00:00 2001 From: Pierre de La Morinerie Date: Thu, 15 Apr 2021 17:37:23 +0200 Subject: [PATCH] sign_in: improve "Forgot password?" appearance on mobile --- app/assets/stylesheets/flex.scss | 4 ++++ app/views/users/sessions/new.html.haml | 2 +- config/locales/fr.yml | 4 ++-- spec/features/users/managing_password_spec.rb | 4 ++-- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/app/assets/stylesheets/flex.scss b/app/assets/stylesheets/flex.scss index 1a04cdda3..fc1cc0780 100644 --- a/app/assets/stylesheets/flex.scss +++ b/app/assets/stylesheets/flex.scss @@ -45,3 +45,7 @@ .flex-grow { flex-grow: 1; } + +.flex-no-shrink { + flex-shrink: 0; +} diff --git a/app/views/users/sessions/new.html.haml b/app/views/users/sessions/new.html.haml index fdd4de5d8..9ae063a8b 100644 --- a/app/views/users/sessions/new.html.haml +++ b/app/views/users/sessions/new.html.haml @@ -14,7 +14,7 @@ = f.password_field :password, autocomplete: 'current-password' .auth-options - %div + .flex-no-shrink = f.check_box :remember_me = f.label :remember_me, t('views.sessions.new.remember_me'), class: 'remember-me' diff --git a/config/locales/fr.yml b/config/locales/fr.yml index 275d95b56..a0d23f0ba 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -41,7 +41,7 @@ fr: email: Email (nom@site.com) password: Mot de passe (%{min_length} caractères minimum) remember_me: Se souvenir de moi - reset_password: Mot de passe oublié ? + reset_password: Mot de passe oublié ? connection: Se connecter are_you_new: Vous êtes nouveau sur %{app_name} ? find_procedure: Trouvez votre démarche @@ -185,4 +185,4 @@ fr: draft: zero: Brouillon one: Brouillon - other: Brouillons \ No newline at end of file + other: Brouillons diff --git a/spec/features/users/managing_password_spec.rb b/spec/features/users/managing_password_spec.rb index 5118c21f8..bbe89c7d6 100644 --- a/spec/features/users/managing_password_spec.rb +++ b/spec/features/users/managing_password_spec.rb @@ -6,7 +6,7 @@ feature 'Managing password:' do scenario 'a simple user can reset their password' do visit root_path click_on 'Connexion' - click_on 'Mot de passe oublié ?' + click_on 'Mot de passe oublié ?' expect(page).to have_current_path(new_user_password_path) fill_in 'Email', with: user.email @@ -33,7 +33,7 @@ feature 'Managing password:' do scenario 'an admin can reset their password' do visit root_path click_on 'Connexion' - click_on 'Mot de passe oublié ?' + click_on 'Mot de passe oublié ?' expect(page).to have_current_path(new_user_password_path) fill_in 'Email', with: user.email