bookwyrm/bookwyrm/templates/notifications/items/layout.html

68 lines
2.7 KiB
HTML
Raw Normal View History

2022-01-18 20:28:59 +00:00
{% load notification_page_tags %}
{% load humanize %}
2021-10-02 14:58:20 +00:00
{% related_status notification as related_status %}
{% get_related_users notification as related_users %}
{% with related_user_count=notification.related_users.count %}
2022-01-11 19:04:56 +00:00
<div class="notification {% if notification.id in unread %}has-background-primary{% endif %}">
<div class="columns is-mobile {% if notification.id in unread %}has-text-white{% else %}has-text-more-muted{% endif %}">
2022-01-11 19:04:56 +00:00
<div class="column is-narrow is-size-3">
<a class="icon" href="{% block primary_link %}{% endblock %}">
{% block icon %}{% endblock %}
</a>
2021-10-02 14:58:20 +00:00
</div>
2021-10-02 14:58:20 +00:00
<div class="column is-clipped">
{% if related_user_count > 1 %}
<div class="block">
<ul class="is-flex">
{% for user in related_users %}
<li class="mr-2">
<a href="{{ user.local_path }}">
{% include 'snippets/avatar.html' with user=user %}
</a>
</li>
{% endfor %}
</ul>
</div>
{% endif %}
<div class="block content">
2022-07-07 02:16:14 +00:00
{% if related_user_count == 1 %}
{% with user=related_users.0 %}
2022-07-07 02:16:14 +00:00
{% spaceless %}
<a href="{{ user.local_path }}" class="mr-2">
{% include 'snippets/avatar.html' with user=user %}
</a>
{% endspaceless %}
{% endwith %}
2022-07-07 02:16:14 +00:00
{% endif %}
{% with related_user=related_users.0.display_name %}
{% with related_user_link=related_users.0.local_path %}
{% with related_user_moved_to=related_users.0.moved_to %}
{% with related_user_username=related_users.0.username %}
2022-07-07 02:16:14 +00:00
{% with second_user=related_users.1.display_name %}
{% with second_user_link=related_users.1.local_path %}
{% with other_user_count=related_user_count|add:"-1" %}
{% with other_user_display_count=other_user_count|intcomma %}
{% block description %}{% endblock %}
{% endwith %}
{% endwith %}
{% endwith %}
{% endwith %}
{% endwith %}
{% endwith %}
{% endwith %}
{% endwith %}
2021-10-02 14:58:20 +00:00
</div>
2021-10-02 14:58:20 +00:00
{% if related_status %}
<div class="block">
{% block preview %}{% endblock %}
</div>
{% endif %}
</div>
</div>
</div>
{% endwith %}