summaryrefslogtreecommitdiff
path: root/design/templates/comments/form.html
blob: f8bb18d3ccc91ff2f1de29633b5e17d866adf3eb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
{% load comments i18n crispy_forms_tags fluent_comments_tags %}{% load url from future %}

{% if not form.target_object|comments_are_open %}
    <p>{% trans "Comments are closed." %}</p>
{% else %}
    <form action="{% comment_form_target %}" method="post" class="js-comments-form comments-form form-horizontal"
          data-ajax-action="{% url 'comments-post-comment-ajax' %}">{% csrf_token %}
      {% if next %}<div><input type="hidden" name="next" value="{{ next }}" /></div>{% endif %}

      {{ form|crispy }}

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