Commit da319c53 authored by Robert's avatar Robert

Show unread conversations in list

parent 2500fc44
Pipeline #1806 failed with stage
in 2 minutes and 2 seconds
from django import template
from django.db.models import Max
register = template.Library()
@register.filter
def unread(association, gestalt):
last_activity = association.container.contributions.aggregate(Max('time_created'))
last_activity = last_activity['time_created__max']
return last_activity >= gestalt.activity_bookmark_time
......@@ -12,6 +12,9 @@
{{ c.subject }}
</div>
<span class="thread-preview-stat">
{% if unread %}
<strong>neue Aktivität,</strong>
{% endif %}
{% with num_replies=c.contributions.count|add:'-1' %}
{% if num_replies == 0 %}
<strong>noch keine Antwort</strong>
......
{% extends 'stadt/stadt.html' %}
{% load dismissible events groups %}
{% block title %}Gespräche - {{ GROUPRISE_SITE_NAME }}{% endblock %}
{% block menu %}{% with menu='conversation' %}{{ block.super }}{% endwith %}{% endblock %}
......@@ -8,11 +7,13 @@
{% endblock %}
{% block sidebar %}
{% load events groups %}
{% sidebar_calendar view.get_content component_id='conversations-calendar' %}
{% sidebar_groups user %}
{% endblock %}
{% block content %}
{% load dismissible %}
{% dismissible 'conversation-list-create' %}
<div class="disclaimer content-block">
{% dismiss 'conversation-list-create' %}
......@@ -29,7 +30,8 @@
<ol class="thread-preview-list">
{% for association in association_list %}
<li>
{% include 'conversations/_preview.html' with group_avatar=True %}
{% load associations %}
{% include 'conversations/_preview.html' with group_avatar=True unread=association|unread:user.gestalt %}
</li>
{% endfor %}
</ol>
......
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