{% load gravatar %}
<ul class="list-unstyled">
  {% for comment in comment_list %}
  <li class="media ml-2 mt-1">
    <img class="mr-3 rounded-circle img-fluid avatar" src="{% gravatar_url comment.user.email 50 %}" alt="{{ comment.user.email }}">
    <div class="media-body">
      <small class="mt-0 mb-1">
        {{ comment.user.first_name }} {{ comment.user.last_name }}
        {% if not object %}
        about <a href="{{ comment.content_object.get_absolute_url }}">{{ comment.content_object.name }}</a>
        {% endif %}
        on {{ comment.submit_date|date }}
        {% if comment.user == user or user.is_superuser %}
          <a href="{% url 'comment-delete' comment.id %}" class="btn btn-sm btn-danger float-right">✖</a>
        {% endif %}
      </small>
      <p class="mr-1">{{ comment.comment|truncatewords:30 }}</p>
    </div>
  </li>
  {% empty %}
  <p>No comments yet.</p>
  {% endfor %}
</ul>
