diff --git a/tasks/templates/tasks/taskDetail.djhtml b/tasks/templates/tasks/taskDetail.djhtml index 23ee728..46e5022 100644 --- a/tasks/templates/tasks/taskDetail.djhtml +++ b/tasks/templates/tasks/taskDetail.djhtml @@ -7,6 +7,38 @@ {% block admin_link %}{% url 'admin:tasks_task_change' task.id %}{% endblock %} +{% block nav_extra %} + {% if user.is_authenticated %} + {% if task_subs or tool_subs %} + + + 🔔 + + + Group Task Subscriptions + {% for task_sub in task_subs %} + + {{ task_sub.group }} - {{ task_sub.days_before }} days + + {% endfor %} + + + Group Tool Subscriptions + {% for tool_sub in tool_subs %} + + {{ tool_sub.tool }} - {{ tool_sub.group }} - {{ tool_sub.days_before }} days + + {% endfor %} + + + {% else %} + 🔕 + {% endif %} + {% endif %} +{% endblock %} + {% block content %} diff --git a/tasks/views.py b/tasks/views.py index 9894b48..c152ab4 100644 --- a/tasks/views.py +++ b/tasks/views.py @@ -43,6 +43,8 @@ def taskDetail(request, tool_slug, task_slug): context = { 'tool': tool, 'task': task, + 'task_subs': task.grouptasksubscription_set.filter(group__user=request.user), + 'tool_subs': tool.grouptoolsubscription_set.filter(group__user=request.user), 'events': events, 'form': form, } diff --git a/templates/base.djhtml b/templates/base.djhtml index 10a9b4d..488237a 100644 --- a/templates/base.djhtml +++ b/templates/base.djhtml @@ -19,6 +19,7 @@ + {% block nav_extra %}{% endblock %} {% if user.is_staff %} Admin {% endif %}