chore: display user’s teams with a table

This commit is contained in:
David Larlet 2024-08-30 11:12:36 -04:00
parent 426780af2c
commit 11d3152682
No known key found for this signature in database
GPG key ID: 3E2953A359E7E7BD

View file

@ -6,14 +6,46 @@
{% include "umap/dashboard_menu.html" with selected="teams" %}
<div class="wrapper">
<div class="row">
<ul>
{% for team in teams %}
<li>
<a href="{% url 'team_maps' team.pk %}">{{ team }}</a> <a href="{% url 'team_update' team.pk %}">({% trans "Edit" %})</a>
</li>
{% endfor %}
</ul>
<a href="{% url 'team_new' %}">{% trans "New team" %}</a>
<div class="table-wrapper">
<table>
<thead>
<tr>
<th>
{% blocktrans %}Name{% endblocktrans %}
</th>
<th>
{% blocktrans %}Users{% endblocktrans %}
</th>
<th>
{% blocktrans %}Actions{% endblocktrans %}
</th>
</tr>
</thead>
<tbody>
{% for team in teams %}
<tr>
<th scope="row">
<a href="{% url 'team_maps' team.pk %}">{{ team }}</a>
</th>
<td>
{% for user in team.users.all %}
{{ user }}{% if not forloop.last %}, {% endif %}
{% endfor %}
</td>
<td>
<a href="{% url 'team_update' team.pk %}"
class="icon-link"
title="{% translate "Edit" %}">
<span class="icon-dashboard icon-edit"></span>
<span class="sr-only">{% translate "Edit" %}</span>
</a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
<a class="button" href="{% url 'team_new' %}">{% trans "New team" %}</a>
</div>
</div>
{% endblock maincontent %}