{% load crispy_forms_tags %}
<form hx-post="{% url 'atlas:case_create_resource_inline' pk=case.pk %}"
      hx-encoding="multipart/form-data"
      hx-target="#case-resources-list"
      hx-swap="innerHTML"
      class="bg-dark p-3 rounded border border-secondary text-white my-3">
  {% csrf_token %}
  <h5>Create New Resource</h5>
  {{ form|crispy }}
  <div class="form-check mb-3">
    <input type="checkbox" name="pre_review" class="form-check-input" id="id_pre_review">
    <label class="form-check-label" for="id_pre_review">Pre-review (show before case is taken)</label>
  </div>
  <div class="d-flex gap-2">
    <button type="submit" class="btn btn-sm btn-success">Save and Attach</button>
    <button type="button" class="btn btn-sm btn-outline-secondary"
            hx-get="{% url 'atlas:resource_search_panel' %}?case_id={{ case.pk }}"
            hx-target="#resource-search-panel-placeholder"
            hx-swap="innerHTML">Cancel</button>
  </div>
</form>
