diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 3f2090cb03bcb3fbed703bb4296a8f0db2809d9e..e0d1a93cd2c81c59a81b40fb1217d0e99a6b5904 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -14,6 +14,7 @@ Added * Notification drawer in top nav bar * GraphQL queries and mutations for core data management +* Show also group ownerships on person detail page Changed ~~~~~~~ diff --git a/aleksis/core/templates/core/person/full.html b/aleksis/core/templates/core/person/full.html index 9a58951118e4bdafe3278cb7e4280e455fa99943..d295cab1705919b3f70d8d5f7ce32f068ac8e886 100644 --- a/aleksis/core/templates/core/person/full.html +++ b/aleksis/core/templates/core/person/full.html @@ -241,18 +241,36 @@ {% endif %} {% has_perm 'core.view_person_groups_rule' user person as can_view_groups %} - {% if can_view_groups and groups %} + {% if can_view_groups %} <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 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> + <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 %} + </div> + </div> + </div> + {% endif %} </div> {% endif %} </div>