<%= errors_summary_for user %> <%= bootstrap_form_with model: [:admin, user], local: true, html: { autocorrect: :off, autocapitalize: :none, autocomplete: :off, spellcheck: false } do |form| %> <%= form.email_field :email %> <%# autocomplete: 'new-password' prevent the existing password value from showing up %> <%= form.password_field :password, autocomplete: "new-password" %> <% if user.new_record? %> <%= form.collection_select :account_id, accounts, :id, :name, { prompt: "Select an Account", required: true }, class: "form-control custom-select" %> <%= form.select :role, options_for_role_select, {}, class: "form-control custom-select" %> <% end %>
<%= form.check_box :admin, label: "Admin User" %>
<%= fa_icon :warning, text: "This option grants access to the Admin dashboard. This should only be for trusted BiG employees." %>
<%= link_to t("shared.cancel"), [:admin, :users], class: "col-3 text-reset" %>
<%= form.button class: class_string("btn btn-block", ["btn-success", "btn-primary"] => user.new_record?), data: { disable_with: t("shared.disable_with") } %>
<% end %>