add notifications for groups

Moved into new structure after merge.
This commit is contained in:
Hugh Rundle 2021-10-03 11:46:51 +11:00
parent 77ac8e0c04
commit f13223b8ca
6 changed files with 124 additions and 0 deletions

View file

@ -17,4 +17,14 @@
{% include 'notifications/items/add.html' %}
{% elif notification.notification_type == 'REPORT' %}
{% include 'notifications/items/report.html' %}
{% elif notification.notification_type == 'INVITE' %}
{% include 'notifications/items/invite.html' %}
{% elif notification.notification_type == 'ACCEPT' %}
{% include 'notifications/items/accept.html' %}
{% elif notification.notification_type == 'JOIN' %}
{% include 'notifications/items/join.html' %}
{% elif notification.notification_type == 'LEAVE' %}
{% include 'notifications/items/leave.html' %}
{% elif notification.notification_type == 'REMOVE' %}
{% include 'notifications/items/remove.html' %}
{% endif %}

View file

@ -0,0 +1,20 @@
{% extends 'notifications/items/item_layout.html' %}
{% load i18n %}
{% load utilities %}
{% block primary_link %}{% spaceless %}
{{ notification.related_group.local_path }}
{% endspaceless %}{% endblock %}
{% block icon %}
<span class="icon icon-local"></span>
{% endblock %}
{% block description %}
{% blocktrans 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>"
{% endblocktrans %}
{% endblock %}

View file

@ -0,0 +1,22 @@
{% extends 'notifications/items/item_layout.html' %}
{% load i18n %}
{% load utilities %}
{% block primary_link %}{% spaceless %}
{{ notification.related_group.local_path }}
{% endspaceless %}{% endblock %}
{% block icon %}
<span class="icon icon-local"></span>
{% endblock %}
{% block description %}
{% blocktrans 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>
{% endblocktrans %}
<div class="row shrink">
{% include 'snippets/join_invitation_buttons.html' with group=notification.related_group %}
</div>
{% endblock %}

View file

@ -0,0 +1,23 @@
{% extends 'notifications/items/item_layout.html' %}
{% load i18n %}
{% load utilities %}
{% block primary_link %}{% spaceless %}
{{ notification.related_group.local_path }}
{% endspaceless %}{% endblock %}
{% block icon %}
<span class="icon icon-local"></span>
{% endblock %}
{% block description %}
{% blocktrans with group_name=notification.related_group.name group_path=notification.related_group.local_path %}
has joined your group "<a href="{{ group_path }}">{{ group_name }}</a>"
{% endblocktrans %}
{% endblock %}

View file

@ -0,0 +1,20 @@
{% extends 'notifications/items/item_layout.html' %}
{% load i18n %}
{% load utilities %}
{% block primary_link %}{% spaceless %}
{{ notification.related_group.local_path }}
{% endspaceless %}{% endblock %}
{% block icon %}
<span class="icon icon-local"></span>
{% endblock %}
{% block description %}
{% blocktrans 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>"
{% endblocktrans %}
{% endblock %}

View file

@ -0,0 +1,29 @@
{% extends 'notifications/items/item_layout.html' %}
{% load i18n %}
{% load utilities %}
{% block primary_link %}{% spaceless %}
{{ notification.related_group.local_path }}
{% endspaceless %}{% endblock %}
{% block icon %}
<span class="icon icon-local"></span>
{% endblock %}
{% block description %}
{% if notification.related_user %}
{% blocktrans with group_name=notification.related_group.name group_path=notification.related_group.local_path %}
has been removed from your group "<a href="{{ group_path }}">{{ group_name }}</a>"
{% endblocktrans %}
{% else %}
{% blocktrans with group_name=notification.related_group.name group_path=notification.related_group.local_path %}
You have been removed from the "<a href="{{ group_path }}">{{ group_name }}</a> group"
{% endblocktrans %}
{% endif %}
{% endblock %}