<%= errors_summary_for directory %>

<%= bootstrap_form_with model: model, local: true do |form| %>
  <%= form.text_field :name %>
  <%= form.select :category, Directory.categories.keys, {}, class: "form-control custom-select" %>
  <% if policy(@directory).can_view_permissions_settings? %>
    <%= form.form_group :permissions, label: { text: "Access Permissions:" }, help: t(".permissions_help") do %>
      <% if Current.user.manager?(Current.account) %>
        <%= form.radio_button :permissions, "Everyone", label: "Everyone" %>
        <%= form.radio_button :permissions, "Account Managers & Project Managers", label: "Account Managers & Project Managers" %>
      <% elsif Current.user.account_manager?(Current.account) %>
        <%= form.radio_button :permissions, "Everyone", label: "Everyone" %>
        <%= form.radio_button :permissions, "Account Managers & Project Managers", label: "Account Managers & Project Managers" %>
        <%= form.radio_button :permissions, "Account Managers Only", label: "Account Managers Only" %>
      <% end %>
    <% end %>
  <% end %>
  <div class="pt-3">
    <%= form.submit class: class_string("btn btn-block", ["btn-success", "btn-primary"] => directory.new_record?), data: { disable_with: t("shared.disable_with") } %>
  </div>
<% end %>
