[openstreetmap/openstreetmap-website] Password fields with show/hide functionality (PR #4951)

Emin Kocan notifications at github.com
Fri Jul 5 08:46:53 UTC 2024


### Implementation Details

This PR introduces functionality that allows users to toggle the visibility of password fields in signup and login forms. This enhancement improves both usability and accessibility.

### Changes Made

1. **Add `password_field_with_toggle` partial**
   - Integrated a reusable Ruby component that can be utilized within both login and signup forms.

2. **Add Show/Hide JavaScript Helpers**
   - Implemented JavaScript functionality to toggle the visibility of password fields using the `addTogglePasswordEventListener` function.

### Screenshots

<img width="745" alt="Screenshot 2024-07-04 at 23 41 05" src="https://github.com/kcne/openstreetmap-website/assets/76796906/729abc15-8ce2-4197-a202-c66e7bf7f4c1">

You can view, comment on, or merge this pull request online at:

  https://github.com/openstreetmap/openstreetmap-website/pull/4951

-- Commit Summary --

  * integrate password field view/hide functionalities

-- File Changes --

    A app/assets/images/eye-slash.svg (5)
    A app/assets/images/eye.svg (4)
    M app/assets/javascripts/login.js (3)
    A app/assets/javascripts/signup.js (4)
    A app/assets/javascripts/toggle_password.js (16)
    M app/views/sessions/new.html.erb (3)
    A app/views/shared/_password_field_with_toggle.html.erb (20)
    M app/views/users/new.html.erb (7)
    M config/locales/en.yml (2)

-- Patch Links --

https://github.com/openstreetmap/openstreetmap-website/pull/4951.patch
https://github.com/openstreetmap/openstreetmap-website/pull/4951.diff

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/4951
You are receiving this because you are subscribed to this thread.

Message ID: <openstreetmap/openstreetmap-website/pull/4951 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20240705/f7d15aac/attachment.htm>


More information about the rails-dev mailing list