Commit 25b506d1 authored by Robert's avatar Robert

Add button to (book)mark conversations as read

parent da319c53
Pipeline #1807 failed with stage
in 5 minutes and 4 seconds
......@@ -12,6 +12,15 @@
{% sidebar_groups user %}
{% endblock %}
{% block heading_toolbar %}
<form method="post">
{% csrf_token %}
<button class="btn btn-ch">
<span class="btn-label">Alle gelesen</span>
</button>
</form>
{% endblock %}
{% block content %}
{% load dismissible %}
{% dismissible 'conversation-list-create' %}
......
from django import shortcuts
from django import shortcuts, urls
from django.contrib.messages import views as messages
from django import urls
from django.http import HttpResponseRedirect
from django.shortcuts import get_object_or_404
from django.urls import reverse
from django.utils.timezone import now
from django.views import generic
import grouprise.core.views
......@@ -40,6 +42,11 @@ class Conversations(grouprise.core.views.PermissionMixin, generic.ListView):
def get_queryset(self):
return super().get_queryset().ordered_user_conversations(self.request.user)
def post(self, *args, **kwargs):
self.request.user.gestalt.activity_bookmark_time = now()
self.request.user.gestalt.save()
return HttpResponseRedirect(reverse('conversations'))
class GroupConversations(Conversations):
permission_required = 'conversations.list_group'
......
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