Commit 6677892b authored by Élie Bouttier's avatar Élie Bouttier

todo: visualisation abonnements notifications

parent f49edb0e
......@@ -26,15 +26,16 @@
<table class="table" id="tasktable">
<tr class="nodrop">
<th>Tâche</th>
<th>Créé le</th>
<th scope="col">Tâche</th>
<th scope="col">Créé le</th>
{% if completed %}
<th>Terminée le</th>
<th scope="col">Terminée le</th>
{% else %}
<th>Due pour le</th>
<th scope="col">Due pour le</th>
{% endif %}
<th>Créé par</th>
<th>Assigné à</th>
<th scope="col">Créé par</th>
<th scope="col">Assigné à</th>
<th scope="col"></th>
{% comment %}<th>Mark</th{% endcomment %}
</tr>
......@@ -42,6 +43,11 @@
<tr id="{{ task.id }}">
<td>
<a href="{% url 'todo:show-task' tasklist.slug task.id %}">{{ task.title|truncatewords:10 }}</a>
{% if request.user in task.task_list.subscribers.all and request.user in task.unsubscribers.all %}
<span class="float-right badge badge-secondary badge-pill"><span class="far fa-eye-slash"></span></span>
{% elif request.user not in task.task_list.subscribers.all and request.user in task.subscribers.all %}
<span class="float-right badge badge-secondary badge-pill"><span class="far fa-eye"></span></span>
{% endif %}
</td>
<td>
{{ task.created_date|date:"m/d/Y" }}
......@@ -71,6 +77,8 @@
</form>
</td>
{% endcomment %}
<td>
</td>
</tr>
{% endfor %}
</table>
......
{% extends "todo/base.html" %}
{% block js_end %}
{{ block.super }}
<script type="text/javascript">
$(function () {
$('[data-toggle="tooltip"]').tooltip()
})
</script>
{% endblock %}
{% block content %}
<h1>Liste des tâches</h1>
......@@ -10,10 +19,19 @@
<li class="list-group-item d-flex justify-content-between align-items-center">
<a href="{% url 'todo:show-tasklist' list.slug %}">{{ list.name }}</a>
<span class="text-right">
{% if request.user in list.subscribers.all %}
<span class="badge badge-secondary badge-pill" data-toggle="tooltip" data-placement="top" title="Vous êtes abonné aux notifications concernant les tâches de cette liste.">
<span class="far fa-eye"></span>
</span>
{% endif %}
{% if list.own_uncompleted_task_count %}
<span class="badge badge-danger badge-pill">{{ list.own_uncompleted_task_count }}</span>
<span class="badge badge-danger badge-pill" data-toggle="tooltip" data-placement="top" title="Nombre de tâches qui vous est assignées.">
{{ list.own_uncompleted_task_count }}
</span>
{% endif %}
<span class="badge badge-primary badge-pill">{{ list.uncompleted_task_set.count }}</span>
<span class="badge badge-primary badge-pill" data-toggle="tooltip" data-placement="top" title="Nombre de tâches dans cette liste.">
{{ list.uncompleted_task_set.count }}
</span>
</span>
</li>
{% endfor %}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment