{% load django_bootstrap5 %}
{% load community_buttons %}
{% load community_utils %}
<div class="card mb-4" {% if form.instance %}id="agendaForm-{{ form.instance.object_name }}-{{ form.instance.id }}" data-prefix="{{ form.prefix }}"{% endif %}>
  <div class="card-header">
    <div class="col">
      {% bootstrap_field form.title %}
    </div>
  </div>

  <div class="card-body">
    {% bootstrap_field form.id %}
    {% bootstrap_form_errors form %}
    <div class="form-row">
      <div class="col col-12 col-md-6">
        {% bootstrap_field form.start layout="horizontal" %}
      </div>
      <div class="col col-12 col-md-6">
        {% bootstrap_field form.duration layout="horizontal" %}
      </div>
    </div>
    <div class="form-row">
      <div class="col col-12">
        {% bootstrap_field form.presentation_type layout="horizontal" %}
      </div>
    </div>
  </div>

  {% if form.instance.id %}
    <div class="card-footer d-flex justify-content-end">
      {% if form.instance.can_be_deleted %}
        <button
         type="button"
         class="btn btn-link text-muted"
         id="btn-remove-{{ form.instance|object_id }}"
         onclick="removeEvent('{{ form.instance|object_id }}')"
         title="Remove this event">
          <i class="far fa-trash-alt"></i>
        </button>
      {% endif %}
      {% details_button form.instance %}
      {% edit_button form.instance None button_class="btn-sm btn-primary" button_text="More options" %}
    </div>
  {% endif %}
</div>
