notify group members of group changes

Send a notification to all group members when group name, description, or privacy are changed.
This commit is contained in:
Hugh Rundle
2021-10-22 20:23:45 +11:00
parent c9deda8fdd
commit 6bc86f189f
4 changed files with 60 additions and 1 deletions

View File

@ -27,4 +27,10 @@
{% include 'notifications/items/leave.html' %}
{% elif notification.notification_type == 'REMOVE' %}
{% include 'notifications/items/remove.html' %}
{% elif notification.notification_type == 'GROUP_PRIVACY' %}
{% include 'notifications/items/update.html' %}
{% elif notification.notification_type == 'GROUP_NAME' %}
{% include 'notifications/items/update.html' %}
{% elif notification.notification_type == 'GROUP_DESCRIPTION' %}
{% include 'notifications/items/update.html' %}
{% endif %}

View File

@ -0,0 +1,28 @@
{% 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.notification_type == 'GROUP_PRIVACY' %}
{% blocktrans with group_name=notification.related_group.name group_path=notification.related_group.local_path %}
has changed the privacy level for <a href="{{ group_path }}">{{ group_name }}</a>
{% endblocktrans %}
{% elif notification.notification_type == 'GROUP_NAME' %}
{% blocktrans with group_name=notification.related_group.name group_path=notification.related_group.local_path %}
has changed the name of <a href="{{ group_path }}">{{ group_name }}</a>
{% endblocktrans %}
{% else %}
{% blocktrans with group_name=notification.related_group.name group_path=notification.related_group.local_path %}
has changed the description of <a href="{{ group_path }}">{{ group_name }}</a>
{% endblocktrans %}
{% endif %}
{% endblock %}