{% load i18n mezzanine_tags %}

<div class="module" id="comments-module">
    <h2>{% trans "Recent Comments" %}</h2>
    {% if settings.COMMENTS_DISQUS_SHORTNAME %}
    <script src="http://{{ settings.COMMENTS_DISQUS_SHORTNAME }}.disqus.com/recent_comments_widget.js?num_items={{ settings.COMMENTS_NUM_LATEST }}&hide_avatars=0&avatar_size=32&excerpt_length=200"></script>
    {% else %}
    <ul>
        {% for comment in comments %}
        <li>
            <a href="mailto:{{ comment.email }}">
                <img src="{% gravatar_url comment.email %}">
                {{ comment.user_name }}
            </a>
            <span>{{ comment.intro }}</span>
            <p>
                <a href="{{ comment.content_object.get_absolute_url }}">
                    {{ comment.content_object }}
                </a>
                &middot;
                <a href="{{ comment.get_absolute_url }}">
                    {% blocktrans with sometime=comment.submit_date|timesince %}{{ sometime }} ago{% endblocktrans %}
                </a>
            </p>
        </li>
        {% endfor %}
    </ul>
    {% endif %}
</div>
