diff --git a/taiga/projects/notifications/services.py b/taiga/projects/notifications/services.py index a4128622..4c7012d1 100644 --- a/taiga/projects/notifications/services.py +++ b/taiga/projects/notifications/services.py @@ -112,6 +112,7 @@ def _filter_by_permissions(obj, user): UserStory = apps.get_model("userstories", "UserStory") Issue = apps.get_model("issues", "Issue") Task = apps.get_model("tasks", "Task") + Epic = apps.get_model("epics", "Epic") WikiPage = apps.get_model("wiki", "WikiPage") if isinstance(obj, UserStory): @@ -120,6 +121,8 @@ def _filter_by_permissions(obj, user): return user_has_perm(user, "view_issues", obj, cache="project") elif isinstance(obj, Task): return user_has_perm(user, "view_tasks", obj, cache="project") + elif isinstance(obj, Epic): + return user_has_perm(user, "view_epics", obj, cache="project") elif isinstance(obj, WikiPage): return user_has_perm(user, "view_wiki_pages", obj, cache="project") return False diff --git a/taiga/projects/notifications/templates/emails/epics/epic-change-body-html.jinja b/taiga/projects/notifications/templates/emails/epics/epic-change-body-html.jinja new file mode 100644 index 00000000..5c84885d --- /dev/null +++ b/taiga/projects/notifications/templates/emails/epics/epic-change-body-html.jinja @@ -0,0 +1,10 @@ +{% extends "emails/updates-body-html.jinja" %} + +{% block head %} + {% trans user=user.get_full_name(), changer=changer.get_full_name(), project=project.name, ref=snapshot.ref, subject=snapshot.subject, url=resolve_front_url("epic", project.slug, snapshot.ref) %} +

Epic updated

+

Hello {{ user }},
{{ changer }} has updated a epic on {{ project }}

+

Epic #{{ ref }} {{ subject }}

+ See epic + {% endtrans %} +{% endblock %} diff --git a/taiga/projects/notifications/templates/emails/epics/epic-change-body-text.jinja b/taiga/projects/notifications/templates/emails/epics/epic-change-body-text.jinja new file mode 100644 index 00000000..1d6800e2 --- /dev/null +++ b/taiga/projects/notifications/templates/emails/epics/epic-change-body-text.jinja @@ -0,0 +1,8 @@ +{% extends "emails/updates-body-text.jinja" %} +{% block head %} +{% trans user=user.get_full_name(), changer=changer.get_full_name(), project=project.name, ref=snapshot.ref, subject=snapshot.subject, url=resolve_front_url("epic", project.slug, snapshot.ref) %} +Epic updated +Hello {{ user }}, {{ changer }} has updated a epic on {{ project }} +See epic #{{ ref }} {{ subject }} at {{ url }} +{% endtrans %} +{% endblock %} diff --git a/taiga/projects/notifications/templates/emails/epics/epic-change-subject.jinja b/taiga/projects/notifications/templates/emails/epics/epic-change-subject.jinja new file mode 100644 index 00000000..d66464e0 --- /dev/null +++ b/taiga/projects/notifications/templates/emails/epics/epic-change-subject.jinja @@ -0,0 +1,3 @@ +{% trans project=project.name|safe, ref=snapshot.ref, subject=snapshot.subject|safe %} +[{{ project }}] Updated the epic #{{ ref }} "{{ subject }}" +{% endtrans %} diff --git a/taiga/projects/notifications/templates/emails/epics/epic-create-body-html.jinja b/taiga/projects/notifications/templates/emails/epics/epic-create-body-html.jinja new file mode 100644 index 00000000..0484ee0b --- /dev/null +++ b/taiga/projects/notifications/templates/emails/epics/epic-create-body-html.jinja @@ -0,0 +1,11 @@ +{% extends "emails/base-body-html.jinja" %} + +{% block body %} + {% trans user=user.get_full_name(), changer=changer.get_full_name(), project=project.name, ref=snapshot.ref, subject=snapshot.subject, url=resolve_front_url("epic", project.slug, snapshot.ref) %} +

New epic created

+

Hello {{ user }},
{{ changer }} has created a new epic on {{ project }}

+

Epic #{{ ref }} {{ subject }}

+ See epic +

The Taiga Team

+ {% endtrans %} +{% endblock %} diff --git a/taiga/projects/notifications/templates/emails/epics/epic-create-body-text.jinja b/taiga/projects/notifications/templates/emails/epics/epic-create-body-text.jinja new file mode 100644 index 00000000..51748107 --- /dev/null +++ b/taiga/projects/notifications/templates/emails/epics/epic-create-body-text.jinja @@ -0,0 +1,8 @@ +{% trans user=user.get_full_name(), changer=changer.get_full_name(), project=project.name, ref=snapshot.ref, subject=snapshot.subject, url=resolve_front_url("epic", project.slug, snapshot.ref) %} +New epic created +Hello {{ user }}, {{ changer }} has created a new epic on {{ project }} +See epic #{{ ref }} {{ subject }} at {{ url }} + +--- +The Taiga Team +{% endtrans %} diff --git a/taiga/projects/notifications/templates/emails/epics/epic-create-subject.jinja b/taiga/projects/notifications/templates/emails/epics/epic-create-subject.jinja new file mode 100644 index 00000000..d41e9c78 --- /dev/null +++ b/taiga/projects/notifications/templates/emails/epics/epic-create-subject.jinja @@ -0,0 +1,3 @@ +{% trans project=project.name|safe, ref=snapshot.ref, subject=snapshot.subject|safe %} +[{{ project }}] Created the epic #{{ ref }} "{{ subject }}" +{% endtrans %} diff --git a/taiga/projects/notifications/templates/emails/epics/epic-delete-body-html.jinja b/taiga/projects/notifications/templates/emails/epics/epic-delete-body-html.jinja new file mode 100644 index 00000000..0debb545 --- /dev/null +++ b/taiga/projects/notifications/templates/emails/epics/epic-delete-body-html.jinja @@ -0,0 +1,11 @@ +{% extends "emails/base-body-html.jinja" %} + +{% block body %} + {% trans user=user.get_full_name(), changer=changer.get_full_name(), project=project.name, ref=snapshot.ref, subject=snapshot.subject %} +

Epic deleted

+

Hello {{ user }},
{{ changer }} has deleted a epic on {{ project }}

+

Epic #{{ ref }} {{ subject }}

+

The Taiga Team

+ {% endtrans %} +{% endblock %} + diff --git a/taiga/projects/notifications/templates/emails/epics/epic-delete-body-text.jinja b/taiga/projects/notifications/templates/emails/epics/epic-delete-body-text.jinja new file mode 100644 index 00000000..b5855eba --- /dev/null +++ b/taiga/projects/notifications/templates/emails/epics/epic-delete-body-text.jinja @@ -0,0 +1,8 @@ +{% trans user=user.get_full_name(), changer=changer.get_full_name(), project=project.name, ref=snapshot.ref, subject=snapshot.subject %} +Epic deleted +Hello {{ user }}, {{ changer }} has deleted a epic on {{ project }} +Epic #{{ ref }} {{ subject }} + +--- +The Taiga Team +{% endtrans %} diff --git a/taiga/projects/notifications/templates/emails/epics/epic-delete-subject.jinja b/taiga/projects/notifications/templates/emails/epics/epic-delete-subject.jinja new file mode 100644 index 00000000..65286ec2 --- /dev/null +++ b/taiga/projects/notifications/templates/emails/epics/epic-delete-subject.jinja @@ -0,0 +1,3 @@ +{% trans project=project.name|safe, ref=snapshot.ref, subject=snapshot.subject|safe %} +[{{ project }}] Deleted the epic #{{ ref }} "{{ subject }}" +{% endtrans %}