Adds report templates

This commit is contained in:
Mouse Reeve 2021-10-02 09:50:48 -07:00
parent df8f67895c
commit 8f56ad9e99
10 changed files with 283 additions and 3 deletions

View file

@ -0,0 +1,35 @@
{% extends 'notifications/item_layout.html' %}
{% load i18n %}
{% load utilities %}
{% block icon %}
<span class="icon icon-plus"></span>
{% endblock %}
{% block description %}
{% with book_path=notification.related_list_item.book.local_path %}
{% with book_title=notification.related_list_item.book|book_title %}
{% with list_path=notification.related_list_item.book_list.local_path %}
{% with list_name=notification.related_list_item.book_list.name %}
{% if notification.related_list_item.approved %}
{% blocktrans trimmed %}
added <em><a href="{{ book_path }}">{{ book_title }}</a></em> to your list "<a href="{{ list_path }}">{{ list_name }}</a>"
{% endblocktrans %}
{% else %}
{% blocktrans trimmed %}
suggested adding <em><a href="{{ book_path }}">{{ book_title }}</a></em> to your list "<a href="{{ list_path }}/curate">{{ list_name }}</a>"
{% endblocktrans %}
{% endif %}
{% endwith %}
{% endwith %}
{% endwith %}
{% endwith %}
{% endblock %}

View file

@ -0,0 +1,57 @@
{% extends 'notifications/item_layout.html' %}
{% load i18n %}
{% load utilities %}
{% block icon %}
<span class="icon icon-boost"></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' %}
{% blocktrans trimmed %}
boosted your <a href="{{ related_path }}">review of <em>{{ book_title }}</em></a>
{% endblocktrans %}
{% elif related_status.status_type == 'Comment' %}
{% blocktrans trimmed %}
boosted your <a href="{{ related_path }}">comment on<em>{{ book_title }}</em></a>
{% endblocktrans %}
{% elif related_status.status_type == 'Quotation' %}
{% blocktrans trimmed %}
boosted your <a href="{{ related_path }}">quote from <em>{{ book_title }}</em></a>
{% endblocktrans %}
{% else %}
{% blocktrans trimmed %}
boosted your <a href="{{ related_path }}">status</a>
{% endblocktrans %}
{% endif %}
{% endwith %}
{% endwith %}
{% endblock %}
{% block preview %}
<div class="notification py-2 {% if notification.id in unread %}is-primary is-light{% else %}has-background-white has-text-grey-dark{% endif %}">
<div class="columns">
<div class="column is-clipped">
{% include 'snippets/status_preview.html' with status=related_status %}
</div>
<div class="column is-narrow has-grey-dark">
{{ related_status.published_date|timesince }}
{% include 'snippets/privacy-icons.html' with item=related_status %}
</div>
</div>
</div>
{% endblock %}

View file

@ -0,0 +1,57 @@
{% extends 'notifications/item_layout.html' %}
{% load i18n %}
{% load utilities %}
{% 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' %}
{% blocktrans trimmed %}
favorited your <a href="{{ related_path }}">review of <em>{{ book_title }}</em></a>
{% endblocktrans %}
{% elif related_status.status_type == 'Comment' %}
{% blocktrans trimmed %}
favorited your <a href="{{ related_path }}">comment on<em>{{ book_title }}</em></a>
{% endblocktrans %}
{% elif related_status.status_type == 'Quotation' %}
{% blocktrans trimmed %}
favorited your <a href="{{ related_path }}">quote from <em>{{ book_title }}</em></a>
{% endblocktrans %}
{% else %}
{% blocktrans trimmed %}
favorited your <a href="{{ related_path }}">status</a>
{% endblocktrans %}
{% endif %}
{% endwith %}
{% endwith %}
{% endblock %}
{% block preview %}
<div class="notification py-2 {% if notification.id in unread %}is-primary is-light{% else %}has-background-white has-text-grey-dark{% endif %}">
<div class="columns">
<div class="column is-clipped">
{% include 'snippets/status_preview.html' with status=related_status %}
</div>
<div class="column is-narrow has-grey-dark">
{{ related_status.published_date|timesince }}
{% include 'snippets/privacy-icons.html' with item=related_status %}
</div>
</div>
</div>
{% endblock %}

View file

@ -0,0 +1,13 @@
{% extends 'notifications/item_layout.html' %}
{% load i18n %}
{% load utilities %}
{% block icon %}
<span class="icon icon-local"></span>
{% endblock %}
{% block description %}
{% trans "followed you" %}
{% include 'snippets/follow_button.html' with user=notification.related_user %}
{% endblock %}

View file

@ -0,0 +1,15 @@
{% extends 'notifications/item_layout.html' %}
{% load i18n %}
{% load utilities %}
{% block icon %}
<span class="icon icon-local"></span>
{% endblock %}
{% block description %}
{% trans "sent you a follow request" %}
<div class="row shrink">
{% include 'snippets/follow_request_buttons.html' with user=notification.related_user %}
</div>
{% endblock %}

View file

@ -0,0 +1,12 @@
{% extends 'notifications/item_layout.html' %}
{% load i18n %}
{% block icon %}
<span class="icon icon-list"></span>
{% endblock %}
{% block description %}
{% url 'import-status' notification.related_import.id as url %}
{% blocktrans %}Your <a href="{{ url }}">import</a> completed.{% endblocktrans %}
{% endblock %}

View file

@ -1,2 +1,20 @@
{# load the right template #}
{% include 'notifications/mention.html' %}
{% if notification.notification_type == 'MENTION' %}
{% include 'notifications/mention.html' %}
{% elif notification.notification_type == 'REPLY' %}
{% include 'notifications/reply.html' %}
{% elif notification.notification_type == 'BOOST' %}
{% include 'notifications/boost.html' %}
{% elif notification.notification_type == 'FAVORITE' %}
{% include 'notifications/fav.html' %}
{% elif notification.notification_type == 'FOLLOW' %}
{% include 'notifications/follow.html' %}
{% elif notification.notification_type == 'FOLLOW_REQUEST' %}
{% include 'notifications/follow_request.html' %}
{% elif notification.notification_type == 'IMPORT' %}
{% include 'notifications/import.html' %}
{% elif notification.notification_type == 'ADD' %}
{% include 'notifications/add.html' %}
{% elif notification.notification_type == 'REPORT' %}
{% include 'notifications/report.html' %}
{% endif %}

View file

@ -44,14 +44,13 @@
{% endblock %}
{% block preview %}
<div class="notification py-2 {% if notification.id in unread %}is-primary is-light{% else %}has-background-white has-text-black{% endif %}">
<div class="columns">
<div class="column is-clipped">
{% include 'snippets/status_preview.html' with status=related_status %}
</div>
<div class="column is-narrow {% if notification.notification_type == 'REPLY' or notification.notification_type == 'MENTION' %}has-text-black{% else %}has-text-grey-dark{% endif %}">
<div class="column is-narrow has-text-black">
{{ related_status.published_date|timesince }}
{% include 'snippets/privacy-icons.html' with item=related_status %}
</div>

View file

@ -0,0 +1,62 @@
{% extends 'notifications/item_layout.html' %}
{% load i18n %}
{% load utilities %}
{% block icon %}
<span class="icon icon-comments"></span>
{% endblock %}
{% block description %}
{% with related_status.reply_parent.book|book_title as book_title %}
{% with related_status.local_path as related_path %}
{% with related_status.reply_parent.local_path as parent_path %}
{% if related_status.reply_parent.status_type == 'Review' %}
{% blocktrans trimmed %}
<a href="{{ related_path }}">replied</a> to your <a href="{{ parent_path }}">review of <em>{{ book_title }}</em></a>
{% endblocktrans %}
{% elif related_status.reply_parent.status_type == 'Comment' %}
{% blocktrans trimmed %}
<a href="{{ related_path }}">replied</a> to your <a href="{{ parent_path }}">comment on <em>{{ book_title }}</em></a>
{% endblocktrans %}
{% elif related_status.reply_parent.status_type == 'Quotation' %}
{% blocktrans trimmed %}
<a href="{{ related_path }}">replied</a> to your <a href="{{ parent_path }}">quote from <em>{{ book_title }}</em></a>
{% endblocktrans %}
{% else %}
{% blocktrans trimmed %}
<a href="{{ related_path }}">replied</a> to your <a href="{{ parent_path }}">status</a>
{% endblocktrans %}
{% endif %}
{% endwith %}
{% endwith %}
{% endwith %}
{% endblock %}
{% block preview %}
<div class="notification py-2 {% if notification.id in unread %}is-primary is-light{% else %}has-background-white has-text-black{% endif %}">
<div class="columns">
<div class="column is-clipped">
{% include 'snippets/status_preview.html' with status=related_status %}
</div>
<div class="column is-narrow has-text-black">
{{ related_status.published_date|timesince }}
{% include 'snippets/privacy-icons.html' with item=related_status %}
</div>
</div>
</div>
{% endblock %}

View file

@ -0,0 +1,12 @@
{% extends 'notifications/item_layout.html' %}
{% load i18n %}
{% block icon %}
<span class="icon icon-warning"></span>
{% endblock %}
{% block description %}
{% url 'settings-report' notification.related_report.id as path %}
{% blocktrans %}A new <a href="{{ path }}">report</a> needs moderation.{% endblocktrans %}
{% endblock %}