diff --git a/app/assets/images/pictograms/email-sync-outline.svg b/app/assets/images/pictograms/email-sync-outline.svg new file mode 100644 index 0000000..52441df --- /dev/null +++ b/app/assets/images/pictograms/email-sync-outline.svg @@ -0,0 +1 @@ + diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css index 3be1e46..5ea608e 100644 --- a/app/assets/stylesheets/application.css +++ b/app/assets/stylesheets/application.css @@ -61,7 +61,12 @@ input[type=checkbox]:checked { height: 2.1rem; margin: 0.5rem 0; } -.application-menu a, +.application-menu .image-button { + float: right; + margin-left: 0.8rem; +} + +.image-button, input[type=submit] { align-items: center; border: 1px solid; @@ -71,21 +76,19 @@ input[type=submit] { color: #a0a0a0; display: flex; fill: #a0a0a0; - float: right; font-size: 0.8rem; font-weight: bold; - margin-left: 0.8rem; padding: 0.4rem; text-decoration: none; } -.application-menu a svg { +.image-button svg { height: 1.3rem; padding-right: 0.4rem; width: 1.3rem; } -.application-menu a.active, -.application-menu a:hover, -.application-menu a:hover:focus-visible, +.image-button.active, +.image-button:hover, +.image-button:hover:focus-visible, input[type=submit]:hover, input[type=submit]:hover:focus-visible { background-color: #009ade; @@ -94,14 +97,18 @@ input[type=submit]:hover:focus-visible { cursor: pointer; fill: white; } -.application-menu a:focus-visible, +.image-button:focus-visible, input[type=submit]:focus-visible { background-color: #f3f3f3; } -.application-menu a.active:focus-visible { +.image-button.active:focus-visible { background-color: #006c9b; border-color: #006c9b; } +.image-button.centered { + margin: 0 auto; + width: fit-content; +} .flashes { height: 2.1rem; @@ -172,6 +179,6 @@ form em { form input[type=submit] { float: none; font-size: 1rem; - margin: 1.5rem auto; + margin: 1.5rem auto 0 auto; padding: 0.75rem; } diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index c8da15d..345632b 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -38,11 +38,11 @@ module ApplicationHelper form_for(record, **options, &-> (f) { f.table_form_for(&block) }) end - def image_link_to(name, image = nil, options = nil, html_options = nil) + def image_link_to(name, image = nil, options = nil, html_options = {}) return "" if html_options.delete(:unless_current) && (url_for(options) == request.path) name = svg_tag("pictograms/#{image}.svg#icon") + name if image - link_to name, options, html_options + link_to name, options, html_options.merge!(class: "image-button") { |k, v1, v2| "#{v1} #{v2}" } end def svg_tag(source, options = {}) diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 1950cf5..1ebd78f 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -18,8 +18,6 @@ <% else %> <%= image_link_to t(:register), "account-plus-outline", new_user_registration_path, unless_current: true %> - <%= image_link_to t(:recover_password), "lock-reset", new_user_password_path, - unless_current: true %> <%= image_link_to t(:sign_in), "login", new_user_session_path, unless_current: true %> <% end %> diff --git a/app/views/users/registrations/new.html.erb b/app/views/users/registrations/new.html.erb index db3dd50..1936da6 100644 --- a/app/views/users/registrations/new.html.erb +++ b/app/views/users/registrations/new.html.erb @@ -10,3 +10,6 @@ <%= f.submit t(:register) %> <% end %> +<%= content_tag :p, t(:or), style: "text-align: center;" %> +<%= image_link_to t(:resend_confirmation), "email-sync-outline", new_user_confirmation_path, + class: "centered" %> diff --git a/app/views/users/sessions/new.html.erb b/app/views/users/sessions/new.html.erb index a45a74b..ca84aa5 100644 --- a/app/views/users/sessions/new.html.erb +++ b/app/views/users/sessions/new.html.erb @@ -8,3 +8,5 @@ <%= f.submit t(:sign_in) %> <% end %> +<%= content_tag :p, t(:or), style: "text-align: center;" %> +<%= image_link_to t(:recover_password), "lock-reset", new_user_password_path, class: "centered" %> diff --git a/config/locales/en.yml b/config/locales/en.yml index cc40e65..883c165 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -11,7 +11,9 @@ en: sessions: new: remember_me: Remember me + or: or register: Register sign_in: Sign in sign_out: Sign out recover_password: Recover password + resend_confirmation: Resend confirmation diff --git a/test/system/users_test.rb b/test/system/users_test.rb index 477e1de..8ab29d5 100644 --- a/test/system/users_test.rb +++ b/test/system/users_test.rb @@ -49,21 +49,4 @@ class UsersTest < ApplicationSystemTestCase assert_text t('devise.confirmations.confirmed') assert User.last.confirmed? end - - #test "visiting the index" do - # visit users_url - # assert_selector "h1", text: "Users" - #end - - #test "should create user" do - # visit users_url - # click_on "New user" - - # fill_in "Email", with: @user.email - # fill_in "Status", with: @user.status - # click_on "Create User" - - # assert_text "User was successfully created" - # click_on "Back" - #end end