<div data-hook="admin_user_form_fields">
  <%= f.field_container :email do %>
    <%= f.label :email, t(:email) %><br />
    <%= f.email_field :email %>
    <%= error_message_on :user, :email %>
  <% end %>

  <%= f.field_container :password do %>
    <%= f.label :password, t(:password) %><br />
    <%= f.password_field :password %>
    <%= f.error_message_on :password %>
  <% end %>

  <%= f.field_container :password do %>
    <%= f.label :password_confirmation, t(:confirm_password) %><br />
    <%= f.password_field :password_confirmation %>
    <%= f.error_message_on :password_confirmation %>
  <% end %>
</div>


<% if @user.respond_to?(:roles) %>
  <div data-hook="admin_user_form_roles">
    <p>
      <%= label_tag nil, t(:roles) %><br />
      <% @roles.each do |role| %>
        <label class="sub">
          <%= check_box_tag "user[role][#{role.name}]", 1, @user.has_role?(role.name) %>
          <%= role.name %>
        </label> &nbsp;
      <% end %>
    </p>
  </div>
<% end %>
