{% load comment %}

<form action="{% url comments.create_comment %}" method="post" class="comment">
  {% ifequal app "comment" %}
    <input type="hidden" name="previous_page" value="{{ previous_page }}">
  {% else %}
    <input type="hidden" name="previous_page" value="{{ current_page }}">
  {% endifequal %}
  {% for field in form %}
    {% if field.is_hidden %}
      {{ field }}
    {% else %}
      {{ field.errors }}
      <p {% if field.errors %}class="error"{% endif %}>
         {{ field }}
      </p>
    {% endif %}
  {% endfor %}
  <p class="submit last">
    <input type="submit" name="post" class="submit-post" value="{% translate "Post" %}">
    {% ifequal app "comment" %}
      <a href="{{ previous_page }}">{% translate "Cancel" %}</a>
    {% endifequal %}
  </p>
</form>