{% extends 'notifications/items/layout.html' %}

{% load i18n %}
{% load utilities %}

{% block primary_link %}{% spaceless %}
    {{ notification.related_status.local_path }}
{% endspaceless %}{% endblock %}

{% block icon %}
<span class="icon icon-heart"></span>
{% endblock %}

{% block description %}
    {% with related_status.book|book_title as book_title %}
    {% with related_status.local_path as related_path %}

    {% if related_status.status_type == 'Review' %}
        {% if other_user_count == 0 %}

        {% blocktrans trimmed %}
        <a href="{{ related_user_link }}">{{ related_user }}</a> liked your <a href="{{ related_path }}">review of <em>{{ book_title }}</em></a>
        {% endblocktrans %}

        {% elif other_user_count == 1 %}

        {% blocktrans trimmed %}
        <a href="{{ related_user_link }}">{{ related_user }}</a>
        and
        <a href="{{ second_user_link }}">{{ second_user }}</a>
        liked your <a href="{{ related_path }}">review of <em>{{ book_title }}</em></a>
        {% endblocktrans %}

        {% else %}

        {% blocktrans trimmed %}
        <a href="{{ related_user_link }}">{{ related_user }}</a> and {{ other_user_display_count }} others liked your <a href="{{ related_path }}">review of <em>{{ book_title }}</em></a>
        {% endblocktrans %}

        {% endif %}
    {% elif related_status.status_type == 'Comment' %}
        {% if other_user_count == 0 %}

        {% blocktrans trimmed %}
        <a href="{{ related_user_link }}">{{ related_user }}</a> liked your <a href="{{ related_path }}">comment on <em>{{ book_title }}</em></a>
        {% endblocktrans %}

        {% elif other_user_count == 1 %}

        {% blocktrans trimmed %}
        <a href="{{ related_user_link }}">{{ related_user }}</a>
        and
        <a href="{{ second_user_link }}">{{ second_user }}</a>
        liked your <a href="{{ related_path }}">comment on <em>{{ book_title }}</em></a>
        {% endblocktrans %}

        {% else %}

        {% blocktrans trimmed %}
        <a href="{{ related_user_link }}">{{ related_user }}</a> and {{ other_user_display_count }} others liked your <a href="{{ related_path }}">comment on <em>{{ book_title }}</em></a>
        {% endblocktrans %}

        {% endif %}
    {% elif related_status.status_type == 'Quotation' %}
        {% if other_user_count == 0 %}

        {% blocktrans trimmed %}
        <a href="{{ related_user_link }}">{{ related_user }}</a> liked your <a href="{{ related_path }}">quote from <em>{{ book_title }}</em></a>
        {% endblocktrans %}

        {% elif other_user_count == 1 %}

        {% blocktrans trimmed %}
        <a href="{{ related_user_link }}">{{ related_user }}</a>
        and
        <a href="{{ second_user_link }}">{{ second_user }}</a>
        liked your <a href="{{ related_path }}">quote from <em>{{ book_title }}</em></a>
        {% endblocktrans %}

        {% else %}

        {% blocktrans trimmed %}
        <a href="{{ related_user_link }}">{{ related_user }}</a> and {{ other_user_display_count }} others liked your <a href="{{ related_path }}">quote from <em>{{ book_title }}</em></a>
        {% endblocktrans %}

        {% endif %}
    {% else %}
        {% if other_user_count == 0 %}

        {% blocktrans trimmed %}
        <a href="{{ related_user_link }}">{{ related_user }}</a> liked your <a href="{{ related_path }}">status</a>
        {% endblocktrans %}

        {% elif other_user_count == 1 %}

        {% blocktrans trimmed %}
        <a href="{{ related_user_link }}">{{ related_user }}</a>
        and
        <a href="{{ second_user_link }}">{{ second_user }}</a>
        liked your <a href="{{ related_path }}">status</a>
        {% endblocktrans %}

        {% else %}

        {% blocktrans trimmed %}
        <a href="{{ related_user_link }}">{{ related_user }}</a> and {{ other_user_display_count }} others liked your <a href="{{ related_path }}">status</a>
        {% endblocktrans %}

        {% endif %}

    {% endif %}

    {% endwith %}
    {% endwith %}
{% endblock %}


{% block preview %}
<div class="notification py-2 {% if notification.id in unread %}is-primary is-light{% else %}has-background-body has-text-muted{% endif %}">
    <div class="columns">
        <div class="column is-clipped">
            {% include 'notifications/items/status_preview.html' with status=related_status %}
        </div>
        <div class="column is-narrow has-text-muted">
            {{ related_status.published_date|timesince }}
            {% include 'snippets/privacy-icons.html' with item=related_status %}
        </div>
    </div>
</div>
{% endblock %}
