Skip to content
Snippets Groups Projects
Verified Commit 3fdb8a22 authored by Lukas Weichelt's avatar Lukas Weichelt Committed by Jonathan Weth
Browse files

Fix group ownership on detail page

(cherry picked from commit 70af2427)
parent 76cdfbe6
No related branches found
No related tags found
No related merge requests found
......@@ -241,35 +241,37 @@
{% endif %}
{% has_perm 'core.view_person_groups_rule' user person as can_view_groups %}
{% if can_view_groups and groups %}
{% if groups.count %}
<div class="col s12 m6 l4">
<h2>{% blocktrans %}Groups{% endblocktrans %}</h2>
<div class="card-panel">
<div class="collection">
{% for group in groups %}
<a href="{{ group.get_absolute_url }}" class="collection-item">
{{ group.name }} ({{ group.school_term }})
</a>
{% endfor %}
{% if can_view_groups and groups.count or can_view_groups and person.owner_of_recursive.count or can_view_groups and person.owner_of_recursive.count and groups.count %}
<div class="col s12 m6 l4">
{% if groups.count %}
<div>
<h2>{% blocktrans %}Groups{% endblocktrans %}</h2>
<div class="card-panel">
<div class="collection">
{% for group in groups %}
<a href="{{ group.get_absolute_url }}" class="collection-item">
{{ group.name }} ({{ group.school_term }})
</a>
{% endfor %}
</div>
</div>
</div>
</div>
{% endif %}
{% if person.owner_of_recursive.count %}
<div class="col s12 m6 l4">
<h2>{% blocktrans %}Group ownership{% endblocktrans %}</h2>
<div class="card-panel">
<div class="collection">
{% for group in person.owner_of_recursive.all %}
<a href="{{ group.get_absolute_url }}" class="collection-item">
{{ group.name }} ({{ group.school_term }}) {{ person.owner_of_recursive.count}}
{% endif %}
{% if person.owner_of_recursive.count %}
<div>
<h2>{% blocktrans %}Group ownership{% endblocktrans %}</h2>
<div class="card-panel">
<div class="collection">
{% for group in person.owner_of_recursive.all %}
<a href="{{ group.get_absolute_url }}" class="collection-item">
{{ group.name }} ({{ group.school_term }})
</a>
{% endfor %}
{% endfor %}
</div>
</div>
</div>
</div>
{% endif %}
{% endif %}
</div>
{% endif %}
</div>
{% endblock %}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment