Merge pull request #2082 from bookwyrm-social/notifications
Notifications refactor
This commit is contained in:
commit
0b7c8e8dc0
29 changed files with 1168 additions and 296 deletions
|
@ -13,8 +13,34 @@
|
|||
|
||||
{% block description %}
|
||||
|
||||
{% if other_user_count == 0 %}
|
||||
|
||||
{% blocktrans trimmed with group_name=notification.related_group.name group_path=notification.related_group.local_path %}
|
||||
accepted your invitation to join group "<a href="{{ group_path }}">{{ group_name }}</a>"
|
||||
<a href="{{ related_user_link }}">{{ related_user }}</a>
|
||||
accepted your invitation to join group
|
||||
"<a href="{{ group_path }}">{{ group_name }}</a>"
|
||||
{% endblocktrans %}
|
||||
|
||||
{% elif other_user_count == 1 %}
|
||||
|
||||
{% blocktrans trimmed with group_name=notification.related_group.name group_path=notification.related_group.local_path %}
|
||||
<a href="{{ related_user_link }}">{{ related_user }}</a>
|
||||
and
|
||||
<a href="{{ second_user_link }}">{{ second_user }}</a>
|
||||
accepted your invitation to join group
|
||||
"<a href="{{ group_path }}">{{ group_name }}</a>"
|
||||
{% endblocktrans %}
|
||||
|
||||
{% else %}
|
||||
|
||||
{% blocktrans trimmed with group_name=notification.related_group.name group_path=notification.related_group.local_path %}
|
||||
<a href="{{ related_user_link }}">{{ related_user }}</a>
|
||||
and
|
||||
{{ other_user_display_count }} others
|
||||
accepted your invitation to join group
|
||||
"<a href="{{ group_path }}">{{ group_name }}</a>"
|
||||
{% endblocktrans %}
|
||||
|
||||
{% endif %}
|
||||
|
||||
{% endblock %}
|
||||
|
|
|
@ -1,14 +1,16 @@
|
|||
{% extends 'notifications/items/layout.html' %}
|
||||
|
||||
{% load i18n %}
|
||||
{% load utilities %}
|
||||
{% load humanize %}
|
||||
|
||||
{% block primary_link %}{% spaceless %}
|
||||
{% if notification.related_list_item.approved %}
|
||||
{{ notification.related_list_item.book_list.local_path }}
|
||||
{% with related_list=notification.related_list_items.first.book_list %}
|
||||
{% if related_list.curation != "curated" %}
|
||||
{{ related_list.local_path }}
|
||||
{% else %}
|
||||
{% url 'list-curate' notification.related_list_item.book_list.id %}
|
||||
{% url 'list-curate' related_list.id %}
|
||||
{% endif %}
|
||||
{% endwith %}
|
||||
{% endspaceless %}{% endblock %}
|
||||
|
||||
{% block icon %}
|
||||
|
@ -16,25 +18,89 @@
|
|||
{% 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_name=notification.related_list_item.book_list.name %}
|
||||
{% with related_list=notification.related_list_items.first.book_list %}
|
||||
{% with book_path=notification.related_list_items.first.book.local_path %}
|
||||
{% with book_title=notification.related_list_items.first.book|book_title %}
|
||||
{% with second_book_path=notification.related_list_items.all.1.book.local_path %}
|
||||
{% with second_book_title=notification.related_list_items.all.1.book|book_title %}
|
||||
{% with list_name=related_list.name %}
|
||||
|
||||
{% if notification.related_list_item.approved %}
|
||||
{% blocktrans trimmed with list_path=notification.related_list_item.book_list.local_path %}
|
||||
{% url 'list' related_list.id as list_path %}
|
||||
{% url 'list-curate' related_list.id as list_curate_path %}
|
||||
|
||||
added <em><a href="{{ book_path }}">{{ book_title }}</a></em> to your list "<a href="{{ list_path }}">{{ list_name }}</a>"
|
||||
|
||||
{% endblocktrans %}
|
||||
{% if notification.related_list_items.count == 1 %}
|
||||
{% if related_list.curation != "curated" %}
|
||||
{% blocktrans trimmed %}
|
||||
<a href="{{ related_user_link }}">{{ related_user }}</a>
|
||||
added <em><a href="{{ book_path }}">{{ book_title }}</a></em>
|
||||
to your list "<a href="{{ list_path }}">{{ list_name }}</a>"
|
||||
{% endblocktrans %}
|
||||
{% else %}
|
||||
{% url 'list-curate' notification.related_list_item.book_list.id as list_path %}
|
||||
{% blocktrans trimmed with list_path=list_path %}
|
||||
|
||||
suggested adding <em><a href="{{ book_path }}">{{ book_title }}</a></em> to your list "<a href="{{ list_path }}">{{ list_name }}</a>"
|
||||
|
||||
{% endblocktrans %}
|
||||
{% blocktrans trimmed %}
|
||||
<a href="{{ related_user_link }}">{{ related_user }}</a>
|
||||
suggested adding <em><a href="{{ book_path }}">{{ book_title }}</a></em>
|
||||
to your list "<a href="{{ list_curate_path }}">{{ list_name }}</a>"
|
||||
{% endblocktrans %}
|
||||
{% endif %}
|
||||
{% elif notification.related_list_items.count == 2 %}
|
||||
{% if related_list.curation != "curated" %}
|
||||
{% blocktrans trimmed %}
|
||||
<a href="{{ related_user_link }}">{{ related_user }}</a>
|
||||
added <em><a href="{{ book_path }}">{{ book_title }}</a></em>
|
||||
and <em><a href="{{ second_book_path }}">{{ second_book_title }}</a></em>
|
||||
to your list "<a href="{{ list_path }}">{{ list_name }}</a>"
|
||||
{% endblocktrans %}
|
||||
{% else %}
|
||||
{% blocktrans trimmed %}
|
||||
<a href="{{ related_user_link }}">{{ related_user }}</a>
|
||||
suggested adding <em><a href="{{ book_path }}">{{ book_title }}</a></em>
|
||||
and <em><a href="{{ second_book_path }}">{{ second_book_title }}</a></em>
|
||||
to your list "<a href="{{ list_curate_path }}">{{ list_name }}</a>"
|
||||
{% endblocktrans %}
|
||||
{% endif %}
|
||||
{% else %}
|
||||
{% with count=notification.related_list_items.count|add:"-2" %}
|
||||
{% with display_count=count|intcomma %}
|
||||
{% if related_list.curation != "curated" %}
|
||||
|
||||
{% blocktrans trimmed count counter=count %}
|
||||
<a href="{{ related_user_link }}">{{ related_user }}</a>
|
||||
added <em><a href="{{ book_path }}">{{ book_title }}</a></em>,
|
||||
<em><a href="{{ second_book_path }}">{{ second_book_title }}</a></em>,
|
||||
and {{ display_count }} other book
|
||||
to your list "<a href="{{ list_path }}">{{ list_name }}</a>"
|
||||
{% plural %}
|
||||
<a href="{{ related_user_link }}">{{ related_user }}</a>
|
||||
added <em><a href="{{ book_path }}">{{ book_title }}</a></em>,
|
||||
<em><a href="{{ second_book_path }}">{{ second_book_title }}</a></em>,
|
||||
and {{ display_count }} other books
|
||||
to your list "<a href="{{ list_path }}">{{ list_name }}</a>"
|
||||
{% endblocktrans %}
|
||||
|
||||
{% else %}
|
||||
|
||||
{% blocktrans trimmed count counter=count %}
|
||||
<a href="{{ related_user_link }}">{{ related_user }}</a>
|
||||
suggested adding <em><a href="{{ book_path }}">{{ book_title }}</a></em>,
|
||||
<em><a href="{{ second_book_path }}">{{ second_book_title }}</a></em>,
|
||||
and {{ display_count }} other book
|
||||
to your list "<a href="{{ list_curate_path }}">{{ list_name }}</a>"
|
||||
{% plural %}
|
||||
<a href="{{ related_user_link }}">{{ related_user }}</a>
|
||||
suggested adding <em><a href="{{ book_path }}">{{ book_title }}</a></em>,
|
||||
<em><a href="{{ second_book_path }}">{{ second_book_title }}</a></em>,
|
||||
and {{ display_count }} other books
|
||||
to your list "<a href="{{ list_curate_path }}">{{ list_name }}</a>"
|
||||
{% endblocktrans %}
|
||||
|
||||
{% endif %}
|
||||
{% endwith %}
|
||||
{% endwith %}
|
||||
{% endif %}
|
||||
|
||||
{% endwith %}
|
||||
{% endwith %}
|
||||
{% endwith %}
|
||||
{% endwith %}
|
||||
{% endwith %}
|
||||
{% endwith %}
|
||||
|
|
|
@ -16,29 +16,97 @@
|
|||
{% with related_status.local_path as related_path %}
|
||||
|
||||
{% if related_status.status_type == 'Review' %}
|
||||
{% blocktrans trimmed %}
|
||||
{% if other_user_count == 0 %}
|
||||
|
||||
boosted your <a href="{{ related_path }}">review of <em>{{ book_title }}</em></a>
|
||||
{% blocktrans trimmed %}
|
||||
<a href="{{ related_user_link }}">{{ related_user }}</a> boosted your <a href="{{ related_path }}">review of <em>{{ book_title }}</em></a>
|
||||
{% endblocktrans %}
|
||||
|
||||
{% 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>
|
||||
boosted 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 boosted your <a href="{{ related_path }}">review of <em>{{ book_title }}</em></a>
|
||||
{% endblocktrans %}
|
||||
|
||||
{% endif %}
|
||||
{% elif related_status.status_type == 'Comment' %}
|
||||
{% blocktrans trimmed %}
|
||||
{% if other_user_count == 0 %}
|
||||
|
||||
boosted your <a href="{{ related_path }}">comment on<em>{{ book_title }}</em></a>
|
||||
{% blocktrans trimmed %}
|
||||
<a href="{{ related_user_link }}">{{ related_user }}</a> boosted your <a href="{{ related_path }}">comment on <em>{{ book_title }}</em></a>
|
||||
{% endblocktrans %}
|
||||
|
||||
{% 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>
|
||||
boosted 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 boosted your <a href="{{ related_path }}">comment on <em>{{ book_title }}</em></a>
|
||||
{% endblocktrans %}
|
||||
|
||||
{% endif %}
|
||||
{% elif related_status.status_type == 'Quotation' %}
|
||||
{% blocktrans trimmed %}
|
||||
{% if other_user_count == 0 %}
|
||||
|
||||
boosted your <a href="{{ related_path }}">quote from <em>{{ book_title }}</em></a>
|
||||
{% blocktrans trimmed %}
|
||||
<a href="{{ related_user_link }}">{{ related_user }}</a> boosted your <a href="{{ related_path }}">quote from <em>{{ book_title }}</em></a>
|
||||
{% endblocktrans %}
|
||||
|
||||
{% 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>
|
||||
boosted 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 boosted your <a href="{{ related_path }}">quote from <em>{{ book_title }}</em></a>
|
||||
{% endblocktrans %}
|
||||
|
||||
{% endif %}
|
||||
{% else %}
|
||||
{% blocktrans trimmed %}
|
||||
{% if other_user_count == 0 %}
|
||||
|
||||
boosted your <a href="{{ related_path }}">status</a>
|
||||
{% blocktrans trimmed %}
|
||||
<a href="{{ related_user_link }}">{{ related_user }}</a> boosted your <a href="{{ related_path }}">status</a>
|
||||
{% endblocktrans %}
|
||||
|
||||
{% 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>
|
||||
boosted 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 boosted your <a href="{{ related_path }}">status</a>
|
||||
{% endblocktrans %}
|
||||
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
{% endwith %}
|
||||
|
|
|
@ -16,29 +16,98 @@
|
|||
{% with related_status.local_path as related_path %}
|
||||
|
||||
{% if related_status.status_type == 'Review' %}
|
||||
{% blocktrans trimmed %}
|
||||
{% if other_user_count == 0 %}
|
||||
|
||||
liked your <a href="{{ related_path }}">review of <em>{{ book_title }}</em></a>
|
||||
{% blocktrans trimmed %}
|
||||
<a href="{{ related_user_link }}">{{ related_user }}</a> liked your <a href="{{ related_path }}">review of <em>{{ book_title }}</em></a>
|
||||
{% endblocktrans %}
|
||||
|
||||
{% 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' %}
|
||||
{% blocktrans trimmed %}
|
||||
{% if other_user_count == 0 %}
|
||||
|
||||
liked your <a href="{{ related_path }}">comment on <em>{{ book_title }}</em></a>
|
||||
{% blocktrans trimmed %}
|
||||
<a href="{{ related_user_link }}">{{ related_user }}</a> liked your <a href="{{ related_path }}">comment on <em>{{ book_title }}</em></a>
|
||||
{% endblocktrans %}
|
||||
|
||||
{% 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' %}
|
||||
{% blocktrans trimmed %}
|
||||
{% if other_user_count == 0 %}
|
||||
|
||||
liked your <a href="{{ related_path }}">quote from <em>{{ book_title }}</em></a>
|
||||
{% blocktrans trimmed %}
|
||||
<a href="{{ related_user_link }}">{{ related_user }}</a> liked your <a href="{{ related_path }}">quote from <em>{{ book_title }}</em></a>
|
||||
{% endblocktrans %}
|
||||
|
||||
{% 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 %}
|
||||
{% blocktrans trimmed %}
|
||||
{% if other_user_count == 0 %}
|
||||
|
||||
liked your <a href="{{ related_path }}">status</a>
|
||||
{% 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 %}
|
||||
|
||||
{% endblocktrans %}
|
||||
{% endif %}
|
||||
|
||||
{% endwith %}
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
{% load utilities %}
|
||||
|
||||
{% block primary_link %}{% spaceless %}
|
||||
{{ notification.related_user.local_path }}
|
||||
{% url 'user-followers' request.user.localname %}
|
||||
{% endspaceless %}{% endblock %}
|
||||
|
||||
{% block icon %}
|
||||
|
@ -12,6 +12,19 @@
|
|||
{% endblock %}
|
||||
|
||||
{% block description %}
|
||||
{% trans "followed you" %}
|
||||
{% include 'snippets/follow_button.html' with user=notification.related_user %}
|
||||
{% if related_user_count == 1 %}
|
||||
{% blocktrans trimmed %}
|
||||
<a href="{{ related_user_link }}">{{ related_user }}</a> followed you
|
||||
{% endblocktrans %}
|
||||
{% elif related_user_count == 2 %}
|
||||
{% blocktrans trimmed %}
|
||||
<a href="{{ related_user_link }}">{{ related_user }}</a> and
|
||||
<a href="{{ second_user_link }}">{{ second_user }}</a> followed you
|
||||
{% endblocktrans %}
|
||||
{% else %}
|
||||
{% blocktrans trimmed %}
|
||||
<a href="{{ related_user_link }}">{{ related_user }}</a> and {{ other_user_display_count }} others followed you
|
||||
{% endblocktrans %}
|
||||
{% endif %}
|
||||
|
||||
{% endblock %}
|
||||
|
|
|
@ -3,13 +3,19 @@
|
|||
{% load i18n %}
|
||||
{% load utilities %}
|
||||
|
||||
{% block primary_link %}{% spaceless %}
|
||||
{% url 'user-followers' request.user.localname %}
|
||||
{% endspaceless %}{% endblock %}
|
||||
|
||||
{% block icon %}
|
||||
<span class="icon icon-local"></span>
|
||||
{% endblock %}
|
||||
|
||||
{% block description %}
|
||||
{% trans "sent you a follow request" %}
|
||||
{% blocktrans trimmed %}
|
||||
<a href="{{ related_user_link }}">{{ related_user }}</a> sent you a follow request
|
||||
{% endblocktrans %}
|
||||
<div class="row shrink">
|
||||
{% include 'snippets/follow_request_buttons.html' with user=notification.related_user %}
|
||||
{% include 'snippets/follow_request_buttons.html' with user=notification.related_users.first %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
|
|
@ -12,11 +12,15 @@
|
|||
{% endblock %}
|
||||
|
||||
{% block description %}
|
||||
|
||||
{% blocktrans trimmed with group_name=notification.related_group.name group_path=notification.related_group.local_path %}
|
||||
invited you to join the group "<a href="{{ group_path }}">{{ group_name }}</a>"
|
||||
<a href="{{ related_user_link }}">{{ related_user }}</a>
|
||||
invited you to join the group
|
||||
"<a href="{{ group_path }}">{{ group_name }}</a>"
|
||||
{% endblocktrans %}
|
||||
|
||||
<div class="row shrink">
|
||||
{% include 'snippets/join_invitation_buttons.html' with group=notification.related_group %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% endblock %}
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
{% load notification_page_tags %}
|
||||
{% load humanize %}
|
||||
{% related_status notification as related_status %}
|
||||
|
||||
{% with related_users=notification.related_users.all.distinct %}
|
||||
{% with related_user_count=notification.related_users.count %}
|
||||
<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 %}">
|
||||
<div class="column is-narrow is-size-3">
|
||||
|
@ -9,14 +13,43 @@
|
|||
</div>
|
||||
|
||||
<div class="column is-clipped">
|
||||
{% if related_user_count > 1 %}
|
||||
<div class="block">
|
||||
<ul class="is-flex">
|
||||
{% for user in related_users|slice:10 %}
|
||||
<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">
|
||||
<p>
|
||||
{% if notification.related_user %}
|
||||
<a href="{{ notification.related_user.local_path }}">{% include 'snippets/avatar.html' with user=notification.related_user %}
|
||||
{{ notification.related_user.display_name }}</a>
|
||||
{% endif %}
|
||||
{% if related_user_count == 1 %}
|
||||
{% with user=related_users.first %}
|
||||
{% spaceless %}
|
||||
<a href="{{ user.local_path }}" class="mr-2">
|
||||
{% include 'snippets/avatar.html' with user=user %}
|
||||
</a>
|
||||
{% endspaceless %}
|
||||
{% endwith %}
|
||||
{% endif %}
|
||||
|
||||
{% with related_user=related_users.first.display_name %}
|
||||
{% with related_user_link=related_users.first.local_path %}
|
||||
{% 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 %}
|
||||
</p>
|
||||
{% endwith %}
|
||||
{% endwith %}
|
||||
{% endwith %}
|
||||
{% endwith %}
|
||||
{% endwith %}
|
||||
{% endwith %}
|
||||
</div>
|
||||
|
||||
{% if related_status %}
|
||||
|
@ -27,4 +60,5 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endwith %}
|
||||
{% endwith %}
|
||||
|
|
|
@ -13,8 +13,34 @@
|
|||
|
||||
{% block description %}
|
||||
|
||||
{% if other_user_count == 0 %}
|
||||
|
||||
{% blocktrans trimmed with group_name=notification.related_group.name group_path=notification.related_group.local_path %}
|
||||
has left your group "<a href="{{ group_path }}">{{ group_name }}</a>"
|
||||
<a href="{{ related_user_link }}">{{ related_user }}</a>
|
||||
has left your group
|
||||
"<a href="{{ group_path }}">{{ group_name }}</a>"
|
||||
{% endblocktrans %}
|
||||
|
||||
{% elif other_user_count == 1 %}
|
||||
|
||||
{% blocktrans trimmed with group_name=notification.related_group.name group_path=notification.related_group.local_path %}
|
||||
<a href="{{ related_user_link }}">{{ related_user }}</a>
|
||||
and
|
||||
<a href="{{ second_user_link }}">{{ second_user }}</a>
|
||||
have left your group
|
||||
"<a href="{{ group_path }}">{{ group_name }}</a>"
|
||||
{% endblocktrans %}
|
||||
|
||||
{% else %}
|
||||
|
||||
{% blocktrans trimmed with group_name=notification.related_group.name group_path=notification.related_group.local_path %}
|
||||
<a href="{{ related_user_link }}">{{ related_user }}</a>
|
||||
and
|
||||
{{ other_user_display_count }} others
|
||||
have left your group
|
||||
"<a href="{{ group_path }}">{{ group_name }}</a>"
|
||||
{% endblocktrans %}
|
||||
|
||||
{% endif %}
|
||||
|
||||
{% endblock %}
|
||||
|
|
|
@ -19,25 +19,25 @@
|
|||
{% if related_status.status_type == 'Review' %}
|
||||
{% blocktrans trimmed %}
|
||||
|
||||
mentioned you in a <a href="{{ related_path }}">review of <em>{{ book_title }}</em></a>
|
||||
<a href="{{ related_user_link }}">{{ related_user }}</a> mentioned you in a <a href="{{ related_path }}">review of <em>{{ book_title }}</em></a>
|
||||
|
||||
{% endblocktrans %}
|
||||
{% elif related_status.status_type == 'Comment' %}
|
||||
{% blocktrans trimmed %}
|
||||
|
||||
mentioned you in a <a href="{{ related_path }}">comment on <em>{{ book_title }}</em></a>
|
||||
<a href="{{ related_user_link }}">{{ related_user }}</a> mentioned you in a <a href="{{ related_path }}">comment on <em>{{ book_title }}</em></a>
|
||||
|
||||
{% endblocktrans %}
|
||||
{% elif related_status.status_type == 'Quotation' %}
|
||||
{% blocktrans trimmed %}
|
||||
|
||||
mentioned you in a <a href="{{ related_path }}">quote from <em>{{ book_title }}</em></a>
|
||||
<a href="{{ related_user_link }}">{{ related_user }}</a> mentioned you in a <a href="{{ related_path }}">quote from <em>{{ book_title }}</em></a>
|
||||
|
||||
{% endblocktrans %}
|
||||
{% else %}
|
||||
{% blocktrans trimmed %}
|
||||
|
||||
mentioned you in a <a href="{{ related_path }}">status</a>
|
||||
<a href="{{ related_user_link }}">{{ related_user }}</a> mentioned you in a <a href="{{ related_path }}">status</a>
|
||||
|
||||
{% endblocktrans %}
|
||||
{% endif %}
|
||||
|
|
|
@ -20,25 +20,25 @@
|
|||
{% 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>
|
||||
<a href="{{ related_user_link }}">{{ related_user }}</a> <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>
|
||||
<a href="{{ related_user_link }}">{{ related_user }}</a> <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>
|
||||
<a href="{{ related_user_link }}">{{ related_user }}</a> <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>
|
||||
<a href="{{ related_user_link }}">{{ related_user }}</a> <a href="{{ related_path }}">replied</a> to your <a href="{{ parent_path }}">status</a>
|
||||
|
||||
{% endblocktrans %}
|
||||
{% endif %}
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
{% extends 'notifications/items/layout.html' %}
|
||||
|
||||
{% load humanize %}
|
||||
{% load i18n %}
|
||||
|
||||
{% block primary_link %}{% spaceless %}
|
||||
{% url 'settings-report' notification.related_report.id %}
|
||||
{% url 'settings-reports' %}
|
||||
{% endspaceless %}{% endblock %}
|
||||
|
||||
{% block icon %}
|
||||
|
@ -11,6 +11,10 @@
|
|||
{% endblock %}
|
||||
|
||||
{% block description %}
|
||||
{% url 'settings-report' notification.related_report.id as path %}
|
||||
{% blocktrans %}A new <a href="{{ path }}">report</a> needs moderation.{% endblocktrans %}
|
||||
{% url 'settings-reports' as path %}
|
||||
{% blocktrans trimmed count counter=notification.related_reports.count with display_count=notification.related_reports.count|intcomma %}
|
||||
A new <a href="{{ path }}">report</a> needs moderation
|
||||
{% plural %}
|
||||
{{ display_count }} new <a href="{{ path }}">reports</a> need moderation
|
||||
{% endblocktrans %}
|
||||
{% endblock %}
|
||||
|
|
|
@ -16,11 +16,11 @@
|
|||
<select>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
|
||||
<div id="barcode-status" class="block">
|
||||
<div class="grant-access is-hidden">
|
||||
<span class="icon icon-lock"></span>
|
||||
<span class="is-size-5">{% trans "Requesting camera..." %}</span></br>
|
||||
<span class="is-size-5">{% trans "Requesting camera..." %}</span><br/>
|
||||
<span>{% trans "Grant access to the camera to scan a book's barcode." %}</span>
|
||||
</div>
|
||||
<div class="access-denied is-hidden">
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue