{% load i18n %} {% if messages %}
<div class="oh-wrapper">
  {% for message in messages %}
  <div class="oh-alert-container">
    <div class="oh-alert oh-alert--animated {{message.tags}}">
      {{ message }}
    </div>
  </div>
  {% endfor %}
  <script>
    setTimeout(function () {
      $(".oh-modal__close").click();
    }, 1000);
  </script>
</div>
{% endif %} {% if form.errors %}
<!-- form errors  -->
<div class="oh-wrapper">
  <div class="oh-alert-container">
    {% for error in form.non_field_errors %}
    <div class="oh-alert oh-alert--animated oh-alert--danger">{{ error }}</div>
    {% endfor %}
  </div>
</div>
{% endif %}

<div class="oh-modal__dialog-header">
  <span class="oh-modal__dialog-title" id="createModalTitle">
    {% trans "Add Comment" %}{{pd.target}}
  </span>
  <button
    class="oh-modal__close"
    aria-label="Close"
    hx-get="{% url url %}?{{pd}}"
    hx-target="#{{target}}"
  >
    <ion-icon name="close-outline"></ion-icon>
  </button>
</div>
<form
  hx-post="{% url 'leave-request-add-comment' request_id %}?{{pd}}"
  hx-target="#requestCommentFormModal"
  hx-encoding="multipart/form-data"
>
  {% csrf_token %}
  <div class="oh-modal__dialog-body pb-0">{{form.as_p}}</div>
  <div class="oh-modal__dialog-footer">
    <button
      type="submit"
      class="oh-btn oh-btn--secondary mt-2 mr-0 oh-btn--w-100-resp"
    >
      {% trans "Save" %}
    </button>
  </div>
</form>
