{% extends "comments/base.html" %}
{% load i18n comments %}

{% block title %}{% trans "Preview your comment" %}{% endblock %}

{% block content %}
  <form action="{% comment_form_target %}" method="post">
    {% csrf_token %}

    {% if next %}
      <div><input type="hidden" name="next" value="{{ next }}" /></div>
    {% endif %}

    {% if form.errors %}
      <h1>
        {% blocktrans count counter=form.errors|length %}Please correct the error below{% plural %}Please correct the errors below{% endblocktrans %}
      </h1>
    {% else %}
      <h1>{% trans "Preview your comment" %}</h1>
      <blockquote>{{ comment|linebreaks }}</blockquote>
      <p class="muted">
        {% trans "Post your comment or make changes below." %}
      </p>
    {% endif %}

    {% for field in form %}
      {% if field.is_hidden %}
        <div>{{ field }}</div>
      {% else %}
        <div class="field"{% if field.name == "honeypot" %} style="display:none;"{% endif %}>
          {{ field.label_tag }}
          {{ field }}
          {% if field.errors %}{{ field.errors }}{% endif %}
        </div>
      {% endif %}
    {% endfor %}

    <div class="actions">
      <input type="submit" name="submit" class="btn btn-primary" value="{% trans 'Post' %}" />
      <input type="submit" name="preview" class="btn" value="{% trans 'Preview' %}" />
    </div>
  </form>
{% endblock %}
