Files
grecia/app/components/management/account/edit_password_manually_component.html.erb
Javi Martín 573f0e62cc Use a button to show/hide password in the management area
When using a link, people using screen readers might think they're going
to a new page where the password is going to be shown. With a button,
they get a better idea about what to expect.

Furthermore, with a button, we can use the `aria-pressed` attribute to
indicate whether the password is currently being shown.
2025-04-02 15:58:11 +02:00

28 lines
1.1 KiB
Plaintext

<% provide :main_class, "management-account-edit-password-manually" %>
<h2 class="not-print"><%= t("management.account.menu.reset_password_manually") %></h2>
<%= form_for user, url: change_password_management_account_path do |f| %>
<%= f.label :password %>
<p class="help-text"><%= t("management.account.edit.password.print_help") %></p>
<div class="small-12 medium-6">
<div class="input-group">
<%= f.password_field :password, class: "input-group-field", label: false, value: nil %>
<span class="input-group-label">
<button type="button" class="show-password" aria-pressed="false">
<span class="icon-eye"></span>
<span class="show-for-sr"><%= t("management.account.edit.password.show") %></span>
</button>
</span>
</div>
<%= link_to t("management.account.edit.password.random"),
"#",
class: "generate-random-value float-right",
data: { "password-complexity": User.password_complexity } %>
</div>
<%= f.submit t("management.account.edit.password.save"), class: "button success" %>
<% end %>