{% extends "base.html" %}

{% load mezzanine_tags rating_tags future %}

{% block meta_title %}{{ title|default:"Home" }}{% endblock %}
{% block title %}{{ title }}{% endblock %}

{% block main %}

{% for link in object_list %}
<div class="link-item clearfix">
    {% if not profile_user %}{% rating_for link %}{% endif %}
    <div class="link-detail{% if link.rating_sum < 0 %} link-negative{% endif %}">
        <h2>
            <a href="{{ link.link }}">{{ link.title }}</a>
            <span class="domain">({{ link.domain }})</span>
        </h2>
        by <a class="profile" href="{% url "profile" link.user.username %}">{{ link.user.profile }}</a>
        {{ link.publish_date|timesince }} ago |
        <a class="comments" href="{{ link.get_absolute_url }}">{{ link.comments_count }} comment{{ link.comments_count|pluralize }} </a>
    </div>
</div>
{% empty %}
<p>{{ no_data }}</p>
{% endfor %}

{% pagination_for object_list "page" "pjax" %}

{% endblock %}
