mirror of
https://github.com/ae-utbm/sith.git
synced 2025-07-09 19:40:19 +00:00
Add "Mark all as read"
This commit is contained in:
@ -47,7 +47,8 @@
|
||||
n.date|time(DATETIME_FORMAT) }}</span><br>
|
||||
{{ n }}</a></li>
|
||||
{% endfor %}
|
||||
<li><a href="{{ url('core:notification_list') }}">{% trans %}View more{% endtrans %}</a></li>
|
||||
<li><a href="{{ url('core:notification_list') }}">{% trans %}View more{% endtrans %}</a>
|
||||
<a href="{{ url('core:notification_list') }}?see_all">{% trans %}Mark all as read{% endtrans %}</a></li>
|
||||
</ul>
|
||||
<a href="{{ url('core:user_tools') }}">{% trans %}Tools{% endtrans %}</a>
|
||||
<a href="{{ url('core:logout') }}">{% trans %}Logout{% endtrans %}</a>
|
||||
|
@ -21,6 +21,8 @@ class NotificationList(ListView):
|
||||
template_name = "core/notification_list.jinja"
|
||||
|
||||
def get_queryset(self):
|
||||
if 'see_all' in self.request.GET.keys():
|
||||
self.request.user.notifications.update(viewed=True)
|
||||
return self.request.user.notifications.order_by('-id')[:20]
|
||||
|
||||
def notification(request, notif_id):
|
||||
|
Reference in New Issue
Block a user