{% extends "spirit/_base.html" %}

{% load spirit_tags i18n %}

{% block title %}{% trans "Comment history" %}{% endblock %}

{% block content %}

  {# todo: add nav bar #}

  <h1 class="headline">{% trans "Comment history" %}</h1>

  <div class="comments">

    {% for c in comments %}
      <div class="comment">

        <div class="comment-media">
          <div class="comment-img">
            <img class="comment-avatar" src="{% get_gravatar_url user=c.comment_fk.user size=50 %}" />
          </div>

          <div class="comment-body">
            <div class="comment-info">

              <div class="comment-username">
                <a href="{{ c.comment_fk.user.st.get_absolute_url }}">{{ c.comment_fk.user.st.nickname }}</a>
              </div>

              <ul class="comment-date">
                <li title="{{ c.date }}">{{ c.date|shortnaturaltime }}</li>
              </ul>

            </div>

            <div class="comment-text">
              {{ c.comment_html|safe }}
            </div>
          </div>
        </div>

      </div>
    {% endfor %}

  </div>

  {% render_paginator comments %}

  <script>

    document.addEventListener('DOMContentLoaded', function() {
      hljs.initHighlightingOnLoad();
      stModules.commentDiff(document.querySelectorAll('.comment-text'));
    });

  </script>

{% endblock %}
