Add epic notifications
parent
c3570e9446
commit
79eeccf379
|
@ -112,6 +112,7 @@ def _filter_by_permissions(obj, user):
|
||||||
UserStory = apps.get_model("userstories", "UserStory")
|
UserStory = apps.get_model("userstories", "UserStory")
|
||||||
Issue = apps.get_model("issues", "Issue")
|
Issue = apps.get_model("issues", "Issue")
|
||||||
Task = apps.get_model("tasks", "Task")
|
Task = apps.get_model("tasks", "Task")
|
||||||
|
Epic = apps.get_model("epics", "Epic")
|
||||||
WikiPage = apps.get_model("wiki", "WikiPage")
|
WikiPage = apps.get_model("wiki", "WikiPage")
|
||||||
|
|
||||||
if isinstance(obj, UserStory):
|
if isinstance(obj, UserStory):
|
||||||
|
@ -120,6 +121,8 @@ def _filter_by_permissions(obj, user):
|
||||||
return user_has_perm(user, "view_issues", obj, cache="project")
|
return user_has_perm(user, "view_issues", obj, cache="project")
|
||||||
elif isinstance(obj, Task):
|
elif isinstance(obj, Task):
|
||||||
return user_has_perm(user, "view_tasks", obj, cache="project")
|
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):
|
elif isinstance(obj, WikiPage):
|
||||||
return user_has_perm(user, "view_wiki_pages", obj, cache="project")
|
return user_has_perm(user, "view_wiki_pages", obj, cache="project")
|
||||||
return False
|
return False
|
||||||
|
|
|
@ -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) %}
|
||||||
|
<h1>Epic updated</h1>
|
||||||
|
<p>Hello {{ user }}, <br> {{ changer }} has updated a epic on {{ project }}</p>
|
||||||
|
<p>Epic #{{ ref }} {{ subject }}</p>
|
||||||
|
<a class="button" href="{{ url }}" title="See Epic #{{ ref }}: {{ subject }} in Taiga">See epic</a>
|
||||||
|
{% endtrans %}
|
||||||
|
{% endblock %}
|
|
@ -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 %}
|
|
@ -0,0 +1,3 @@
|
||||||
|
{% trans project=project.name|safe, ref=snapshot.ref, subject=snapshot.subject|safe %}
|
||||||
|
[{{ project }}] Updated the epic #{{ ref }} "{{ subject }}"
|
||||||
|
{% endtrans %}
|
|
@ -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) %}
|
||||||
|
<h1>New epic created</h1>
|
||||||
|
<p>Hello {{ user }},<br />{{ changer }} has created a new epic on {{ project }}</p>
|
||||||
|
<p>Epic #{{ ref }} {{ subject }}</p>
|
||||||
|
<a class="button" href="{{ url }}" title="See Epic #{{ ref }} {{ subject }}">See epic</a>
|
||||||
|
<p><small>The Taiga Team</small></p>
|
||||||
|
{% endtrans %}
|
||||||
|
{% endblock %}
|
|
@ -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 %}
|
|
@ -0,0 +1,3 @@
|
||||||
|
{% trans project=project.name|safe, ref=snapshot.ref, subject=snapshot.subject|safe %}
|
||||||
|
[{{ project }}] Created the epic #{{ ref }} "{{ subject }}"
|
||||||
|
{% endtrans %}
|
|
@ -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 %}
|
||||||
|
<h1>Epic deleted</h1>
|
||||||
|
<p>Hello {{ user }},<br />{{ changer }} has deleted a epic on {{ project }}</p>
|
||||||
|
<p>Epic #{{ ref }} {{ subject }}</p>
|
||||||
|
<p><small>The Taiga Team</small></p>
|
||||||
|
{% endtrans %}
|
||||||
|
{% endblock %}
|
||||||
|
|
|
@ -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 %}
|
|
@ -0,0 +1,3 @@
|
||||||
|
{% trans project=project.name|safe, ref=snapshot.ref, subject=snapshot.subject|safe %}
|
||||||
|
[{{ project }}] Deleted the epic #{{ ref }} "{{ subject }}"
|
||||||
|
{% endtrans %}
|
Loading…
Reference in New Issue