{% extends "django_comments_tree/base.html" %}
{% load i18n %}
{% load comments_tree %}

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

{% block content %}
<div class="container">
    <div class="mb-4">
        <h3 class="text-center">{% trans "Preview your comment" %}</h3>
        <hr/>
    </div>
    <p class="lead text-center">
        {% trans "Preview of your comment for:" %}<br/>
        <a href="{{ form.target_object.get_absolute_url }}">{{ form.target_object }}</a>
    </p>
    <div class="row">
        <div class="col-md-12">
            <hr/>
            {% if not comment %}
            <em>{% trans "Empty comment." %}</em>
            {% else %}
            <div class="media">
                {{ form.cleaned_data.email|tree_comment_gravatar }}
                <div class="media-body">
                    <div class="comment pb-3">
                        <h6 class="mb-1 small">
                            {% now "N j, Y, P" %}&nbsp;-&nbsp;
                            {% if form.cleaned_data.url %}
                            <a href="{{ form.cleaned_data.url }}" target="_new">{% endif %}
                                {{ form.cleaned_data.name }}
                                {% if form.cleaned_data.url %}</a>{% endif %}
                        </h6>
                        <p>{{ comment }}</p>
                    </div>
                </div>
            </div>
            {% endif %}
            <div class="card mt-4 mb-5">
                <div class="card-body">
                    <h4 class="card-title text-center pb-3">{% trans "Post your comment" %}</h4>
                    {% include "comments/form.html" %}
                </div>
            </div>
        </div>
    </div>
</div>
{% endblock %}
