osunyorg/admin

View on GitHub
app/views/devise/passwords/edit.html.erb

Summary

Maintainability
Test Coverage
<%= content_for :title, t('.title') %>
<% @small_content = true %>

<h1 class="h4 mb-4"><%= t(".change_your_password") %></h1>
<%= simple_form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put }) do |f| %>
  <%= f.error_notification %>
  <%= f.input :reset_password_token, as: :hidden %>
  <%= f.full_error :reset_password_token %>
  <%= f.input :password,
              as: :password_with_hints,
              label: t(".new_password"),
              required: true,
              autofocus: true,
              allow_password_uncloaking: true,
              validators: {
                length: Devise.password_length.first,
                uppercase_char: true,
                lowercase_char: true,
                numeric_char: true,
                special_char: Rails.application.config.allowed_special_chars
              },
              input_html: { autocomplete: "new-password" } %>
  <%= f.input :password_confirmation,
              as: :password_with_sync,
              label: t(".confirm_new_password"),
              required: true,
              allow_password_uncloaking: true,
              compare_with_field: :password,
              input_html: { autocomplete: "new-password" } %>
  <%= f.button :submit, t(".change_my_password"), class: 'btn btn-primary' %>
<% end %>