fix group references in templates
Let's do this the sensible way huh, by using backwards references to memberships etc Also adds filters for is_member and is_invited so we don't have to do weird things in group Views
This commit is contained in:
@ -11,7 +11,7 @@
|
||||
{% block searchresults %}
|
||||
{% endblock %}
|
||||
|
||||
{% include "groups/members.html" %}
|
||||
{% include "groups/members.html" with group=group %}
|
||||
|
||||
<h2 class="title is-5">Lists</h2>
|
||||
{% if not lists %}
|
||||
|
@ -7,7 +7,8 @@
|
||||
<p class="subtitle is-6">{% trans "Members can add and remove books on your group's book lists" %}</p>
|
||||
|
||||
<div class="column is-flex is-flex-grow-0">
|
||||
{% for member in group.members.all %}
|
||||
{% for membership in group.memberships.all %}
|
||||
{% with member=membership.user %}
|
||||
<div class="box has-text-centered is-shadowless has-background-white-bis my-0 mx-2">
|
||||
<a href="{{ member.local_path }}" class="has-text-black">
|
||||
{% include 'snippets/avatar.html' with user=member large=True %}
|
||||
@ -19,7 +20,7 @@
|
||||
<span class="is-sr-only">Manager</span>
|
||||
</span>
|
||||
{% endif %}
|
||||
{% include 'snippets/add_to_group_button.html' with user=member minimal=True %}
|
||||
{% include 'snippets/add_to_group_button.html' with user=member group=group minimal=True %}
|
||||
{% if member.mutuals %}
|
||||
<p class="help">
|
||||
{% blocktrans trimmed with mutuals=member.mutuals|intcomma count counter=member.mutuals %}
|
||||
@ -41,5 +42,6 @@
|
||||
</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endwith %}
|
||||
{% endfor %}
|
||||
</div>
|
@ -12,7 +12,7 @@
|
||||
<span title="{{ user.display_name }}" class="is-block is-6 has-text-weight-bold">{{ user.display_name|truncatechars:10 }}</span>
|
||||
<span title="@{{ user|username }}" class="is-block pb-3">@{{ user|username|truncatechars:8 }}</span>
|
||||
</a>
|
||||
{% include 'snippets/add_to_group_button.html' with user=user minimal=True %}
|
||||
{% include 'snippets/add_to_group_button.html' with user=user group=group minimal=True %}
|
||||
{% if user.mutuals %}
|
||||
<p class="help">
|
||||
{% blocktrans trimmed with mutuals=user.mutuals|intcomma count counter=user.mutuals %}
|
||||
|
@ -3,7 +3,7 @@
|
||||
{% load interaction %}
|
||||
|
||||
<div class="columns is-multiline">
|
||||
{% for group in user.bookwyrm_groups.all %}
|
||||
{% for group in groups %}
|
||||
<div class="column is-one-quarter">
|
||||
<div class="card is-stretchable">
|
||||
<header class="card-header">
|
||||
|
Reference in New Issue
Block a user