{% extends "django_comments_xtd/base.html" %}
{% load i18n %}
{% load comments_xtd %}

{% 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">
        <div class="mr-3">
          {{ form.cleaned_data.email|xtd_comment_gravatar }}
        </div>
        <div class="media-body">
          <div class="comment pb-3">
            <h6 class="mb-1 small d-flex">
              <div class="mr-auto">
                {% now "N j, Y, P" %}&nbsp;-&nbsp;
                {% if form.cleaned_data.url %}
                <a href="{{ form.cleaned_data.url }}" target="_new">
                  {{ form.cleaned_data.name }}
                </a>
                {% else %}
                  {{ form.cleaned_data.name }}
                {% endif %}
              </div>
            </h6>
            <div class="content">{{ comment }}</div>
          </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 %}
