Commit b26b0062 authored by Robert's avatar Robert

Add templates for content activity preview

parent 0651b600
Pipeline #1813 passed with stage
in 7 minutes and 21 seconds
{% if association.container.is_conversation %}
{% include 'conversations/_preview.html' with show_type=True %}
{% else %}
{% with c=association.container %}
<a href="{% url 'content' association.entity.slug association.slug %}"
class="thread-preview{% if not association.public %} content-internal{% endif %}">
<div class="thread-preview-image">
{% if group_avatar and association.entity.is_group %}
{% include 'groups/_avatar.html' with group=association.entity link=False size=64 %}
{% else %}
{% include 'gestalten/_avatar.html' with gestalt=c.versions.first.author link=False size=64 %}
{% endif %}
</div>
<div class="thread-preview-body">
<div class="thread-preview-title">
{{ c.subject }}
</div>
<span class="thread-preview-stat">
{% if unread %}
<strong>neue Aktivität,</strong>
{% endif %}
{% with num_comments=c.contributions.count %}
Beitrag{% if num_comments > 0 %},{% endif %}
{% if num_comments > 0 %}
{{ num_comments }} Kommentar{{ num_comments|pluralize:'e' }}
{% endif %}
{% endwith %}
</span>
</div>
<div class="thread-preview-meta">
<div>
{% time c.versions.first.time_created %}
{% include 'content/_content_visibility.html' with small=True %}
</div>
{% include 'associations/_contributors.html' with contributors=c.get_authors max_shown=10 %}
</div>
</a>
{% endwith %}
{% endif %}
......@@ -6,12 +6,6 @@
{% include 'core/_heading.html' with title='Aktivität' icon='sg-comments' %}
{% endblock %}
{% block sidebar %}
{% load events groups %}
{% sidebar_calendar view.get_content component_id='conversations-calendar' %}
{% sidebar_groups user %}
{% endblock %}
{% block heading_toolbar %}
<form method="post">
{% csrf_token %}
......@@ -22,28 +16,14 @@
{% endblock %}
{% block content %}
{% load dismissible %}
{% dismissible 'conversation-list-create' %}
<div class="disclaimer content-block">
{% dismiss 'conversation-list-create' %}
{% if not user.is_authenticated %}
<p>Gespräche sind nicht öffentlich und daher nur für <a href="{% url 'account_login' %}?next={{ request.path }}">angemeldete Gestalten</a> sichtbar.</p>
{% endif %}
<p>Um ein neues Gespräch zu beginnen, wähle auf der Seite einer <a href="{% url 'group-index' %}">Gruppe</a> oder <a href="{% url 'gestalten' %}">Gestalt</a> die Schaltfläche <em>Nachricht schreiben</em> oder <em>Neues Gespräch</em>.</p>
{% if user.is_authenticated %}
<p>Außerdem kannst Du bei vielen Gestalten auf ihr <em>Symbol (Avatar)</em> klicken, um ein persönliches Gespräch mit ihnen zu beginnen.</p>
{% endif %}
</div>
{% enddismissible %}
<ol class="thread-preview-list">
{% for association in association_list %}
<li>
{% load associations %}
{% include 'conversations/_preview.html' with group_avatar=True unread=association|unread:user.gestalt %}
{% include 'associations/_activity_preview.html' with group_avatar=True unread=association|unread:user.gestalt %}
</li>
{% endfor %}
</ol>
{% pagination 'Weitere Gespräche' %}
{% pagination 'Weitere Aktivität' %}
{% endblock %}
......@@ -41,9 +41,6 @@ class ActivityView(PermissionMixin, ListView):
template_name = 'associations/list_activity.html'
paginate_by = 10
def get_content(self):
return Association.objects.can_view(self.request.user)
def get_queryset(self):
return super().get_queryset().ordered_user_associations(self.request.user)
......
{% if user.is_authenticated %}
{% if association.public %}
<span class="btn has-state has-square-icon has-hover-title is-unresponsive" data-state="inactive">
<i class="sg sg-xl sg-privacy-public"></i>
<span class="btn has-state has-square-icon{% if small %} has-square-icon-sm{% endif %} has-hover-title is-unresponsive" data-state="inactive">
<i class="sg {% if not small %}sg-xl {% endif %} sg-privacy-public"></i>
<span class="btn-htitle" data-position="right"
title="Diesen Beitrag können alle Menschen sehen, die diese Seite besuchen."></span>
</span>
{% else %}
<span class="btn has-state has-square-icon has-hover-title is-unresponsive" data-state="active">
<i class="sg sg-xl sg-privacy-private"></i>
<span class="btn has-state has-square-icon{% if small %} has-square-icon-sm{% endif %} has-hover-title is-unresponsive" data-state="active">
<i class="sg {% if not small %}sg-xl {% endif %} sg-privacy-private"></i>
{% if association.entity.is_group %}
<span class="btn-htitle" data-position="right"
title="Du kannst diesen Beitrag sehen, weil Du Mitglied der Gruppe „{{ association.entity }}“ bist."></span>
......
......@@ -15,6 +15,9 @@
{% if unread %}
<strong>neue Aktivität,</strong>
{% endif %}
{% if show_type %}
Gespräch,
{% endif %}
{% with num_replies=c.contributions.count|add:'-1' %}
{% if num_replies == 0 %}
<strong>noch keine Antwort</strong>
......@@ -29,7 +32,7 @@
{% time c.contributions.first.time_created %}
{% include 'conversations/_visibility.html' with small=True %}
</div>
{% include 'conversations/_contributors.html' with contributors=c.get_authors max_shown=10 %}
{% include 'associations/_contributors.html' with contributors=c.get_authors max_shown=10 %}
</div>
</a>
{% endwith %}
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