{% import 'macro/accordion.html' as accordion %}

{{ accordion.header('Set purchase locations danger zone', 'purchase-location-danger', 'admin', expanded=true, danger=true, class='text-end') }}
<form action="{{ url_for('admin_purchase_location.do_delete', id=purchase_location.fields.id) }}" method="post">
  {% if purchase_location_error %}<div class="alert alert-danger text-start" role="alert"><strong>Error:</strong> {{ purchase_location_error }}.</div>{% endif %}
  <div class="alert alert-danger text-center" role="alert">You are about to <strong>delete a set purchase location</strong>. This action is irreversible.</div>
  <div class="row row-cols-lg-auto g-3 align-items-center">
    <div class="col-12 flex-grow-1">
      <div class="input-group">
        <div class="input-group-text">Name</div>
        <input type="text" class="form-control" value="{{ purchase_location.fields.name }}" disabled>
      </div>
    </div>
  </div>
  <hr class="border-bottom">
  <a class="btn btn-danger" href="{{ url_for('admin.admin', open_purchase_location=true) }}" role="button"><i class="ri-arrow-left-long-line"></i> Back to the admin</a>
  <button type="submit" class="btn btn-danger"><i class="ri-delete-bin-2-line"></i> Delete <strong>the set purchase location</strong></button>
</form>
{{ accordion.footer() }}
