users can disable notifications

This commit is contained in:
Élie Bouttier 2014-09-04 20:12:38 -07:00
parent 4a61d463bd
commit f420dd98ac
9 changed files with 82 additions and 22 deletions

View file

@ -20,7 +20,7 @@
{% endcomment %}
{% if request.user.is_authenticated %}
{% if request.user.email and request.user in project.subscribers.all %}
{% if request.user.email and request.user.notifications and request.user in project.subscribers.all %}
<li><a href="{% url 'unsubscribe-project' project.name %}?next={{ request.get_full_path }}"><span class="glyphicon glyphicon-eye-close"></span> Unwatch</a></li>
{% else %}
<li><a href="{% url 'subscribe-project' project.name %}?next={{ request.get_full_path }}"><span class="glyphicon glyphicon-eye-open"></span> Watch</a></li>

View file

@ -193,15 +193,13 @@
</h5>
<div class="row">
<span style="display: inline-block; margin-left: 14px;"></span>
{% if request.user.email and request.user in project.subscribers.all %}
{% if request.user.email and request.user.notifications and request.user in project.subscribers.all %}
Subscribed to the project
{% else %}
{% if request.user in issue.subscribers.all %}
{% elif request.user.notifications and request.user in issue.subscribers.all %}
<a href="{% url 'unsubscribe-issue' project.name issue.id %}" class="btn btn-default"><span class="glyphicon glyphicon-eye-close"></span>&#160;Unsubscribe</a>
{% else %}
<a href="{% url 'subscribe-issue' project.name issue.id %}" class="btn btn-default"><span class="glyphicon glyphicon-eye-open"></span>&#160;Subscribe</a>
{% endif %}
{% endif %}
</div>
{% endif %}
</div>