<form action="{% url 'post_comment' %}" method="POST">
  {% csrf_token %}
  {{ comment_form.content_type }}
  {{ comment_form.object_pk }}
  {{ comment_form.timestamp }}
  {{ comment_form.security_hash }}

  <input type="hidden" name="next" value="{{ next }}">
  <input type="hidden" name="reply_to" value="0"></input>

  <fieldset class="form-group {% if comment_form.comment.errors %}has-error{% endif %}">
    {% if comment_form.comment.errors %}
      <div class="alert alert-danger" role="alert">
        <span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span>
        <span class="sr-only">Erreur :</span>
          {{ comment_form.comment.errors | striptags }}
      </div>
    {% endif %}
    <textarea class="form-control input-sm"
      name="{{ comment_form.comment.name }}"
      id="id_{{ comment_form.comment.name }}"
      placeholder="Ajouter mon commentaire..."></textarea>
  </fieldset>
  <input class="btn btn-block btn-sm btn-primary" type="submit" name="post" class="submit-post" value="Commenter">

  {% comment %}
  {#
  <input id="reply-to-field" type="hidden" name="reply_to" value="0"></input>
  <input type="hidden" name="next" value="{% url 'annotation_detail' collection_name image_guid annotation_guid %}">
  <h4> Commenter ({{user.username}}) </h4>
  <div class="reply-to-container">
    <label id="form-reply-to-label" class="control-label reply-to-label" for="id_{{ comment_form.comment.name }}">En réponse à : </label>
    <div class="alert alert-info reply-to-alert">
       <p class="reply-to-content comment-content"></p>
       <hr class="comment-separator">
       <div class="reply-to-subtext comment-subtext"></div>
       <div class="reply-to-label-list comment-metacategories"></div>
    </div>
    <a class="btn btn-default btn-sm reply-to-cancel">Annuler et répondre sur le fil principal</a><br><br>
  </div>
  <fieldset class="form-group {% if comment_form.comment.errors %}has-error{% endif %}">
    {% if comment_form.comment.errors %}
      <div class="alert alert-danger" role="alert">
        <span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span>
        <span class="sr-only">Erreur :</span>
          {{ comment_form.comment.errors | striptags }}
      </div>
    {% endif %}
    <textarea class="form-control"
      name="{{ comment_form.comment.name }}"
      id="id_{{ comment_form.comment.name }}" ></textarea>
  </fieldset>
  <fieldset class="form-group {% if comment_form.metacategories.errors %}has-error{% endif %}">
    <div class="input-group">
      {% for metacategory in comment_form.metacategories %}
        <label class="checkbox-inline" for="{{metacategory.id_for_label}}">
            {{ metacategory.tag }} {{metacategory.choice_label}}
        </label>
      {% endfor %}
    </div>
  </fieldset>
  <p class="submit">
    <input class="btn btn-default" type="submit" name="post" class="submit-post" value="Publier"/>
  </p>
  #}
  {% endcomment %}
</form>
