{% comment %}
A single Bookmark as the contents of a Bootstrap media object.

Expects:
 * bookmark, a Bookmark object.
 * perms - The Django perms object.
 * view - 'list' (a generic list), 'day' or 'detail'.

{% endcomment %}


<div class="media-body">
    <h2 class="{% if view == 'detail' %}h4{% else %}h6{% endif %} mb-0 pinboard-bookmark-title"><a href="{{ bookmark.url }}">{{ bookmark.title }}</a></h2>
    {% if bookmark.description %}
        <p class="{% if view == 'detail' %}lead{% else %}mb-0{% endif %} pinboard-bookmark-description">
            {{ bookmark.description }}
        </p>
    {% endif %}

    {% if bookmark.tags.all|length %}
        <ul class="{% if view != 'detail' %}mb-0 {% endif %}list-inline pinboard-bookmark-tags">
            {% for tag in bookmark.tags.all %}
                <li class="list-inline-item pinboard-bookmark-tag">
                    <a class="label label-pill label-primary" href="{% url 'pinboard:tag_detail' slug=tag.slug %}">
                        {% if view != 'detail' %}
                            <small>{{ tag.name }}</small>
                        {% else %}
                            {{ tag.name }}
                        {% endif %}
                    </a>
                </li>
            {% endfor %}
        </ul>
    {% endif %}

    <p class="mb-0 text-muted pinboard-bookmark-about">
        {% if view != 'detail' %}<small>{% endif %}
            By <a href="{{ bookmark.account.get_absolute_url }}">{{ bookmark.account.username }}</a> •

            {% load ditto_core %}
            Posted at
            {% if view == 'day' %}
                {% display_time bookmark.post_time False %}
            {% else %}
                {% display_time bookmark.post_time True %}
            {% endif %}

            {% if view != 'detail' %}
                • <a href="{{ bookmark.get_absolute_url }}" title="See only this bookmark">#</a>
            {% endif %}
            {% if perms.pinboard.can_change_bookmark %}
                • <a href="{% url 'admin:pinboard_bookmark_change' bookmark.id %}">Edit</a>
            {% endif %}
        {% if view != 'detail' %}</small>{% endif %}
    </p>
</div> <!-- .media-body -->

