Intitial teams support #147

Merged
Oleg-Komarov merged 34 commits from teams-support into main 2024-05-23 19:43:54 +02:00
Showing only changes of commit 15452acfc3 - Show all commits

View File

@ -4,58 +4,64 @@
<h1 class="mb-3">Teams</h1>
<div class="row">
<div class="col">
<table class="table table-hover">
<thead>
<tr>
<th class="w-100">
Team name
</th>
<th>
Role
</th>
<th>
Users
</th>
<th></th>
</tr>
</thead>
<tbody>
{% for team_member in user.team_users.all %}
{% with team=team_member.team %}
<tr>
<td>
<a class="px-0" href="{{ team.get_absolute_url }}">{{ team.name }}</a>
</td>
<td>
<div class="badge">
{{ team_member.get_role_display }}
</div>
</td>
<td class="text-center">
<div class="badge">
{{ team.team_users.all.count }}
</div>
</td>
<td>
{# TODO: disable dropdown btn leave team if user is the only manager #}
<div class="dropdown">
<button class="btn btn-link dropdown-toggle js-dropdown-toggle" data-toggle-menu-id="team-{{ team.id }}">
<i class="i-more-vertical"></i>
</button>
<ul class="dropdown-menu dropdown-menu-right js-dropdown-menu" id="team-{{ team.id }}">
<li>
{# TODO: add page leave team base and link #}
{# TODO: add conditional class 'dropdown-item-disabled' if user is the only manager #}
<a class="dropdown-item {% comment %}dropdown-item-disabled{% endcomment %}" href="#"><i class="i-log-out"></i>Leave Team</a>
</li>
</ul>
</div>
</td>
</tr>
{% endwith %}
{% endfor %}
</tbody>
</table>
{% if user.team_users.all %}
<table class="table table-hover">
<thead>
<tr>
<th class="w-100">
Team name
</th>
<th>
Role
</th>
<th>
Users
</th>
<th></th>
</tr>
</thead>
<tbody>
{% for team_member in user.team_users.all %}
{% with team=team_member.team %}
<tr>
<td>
<a class="px-0" href="{{ team.get_absolute_url }}">{{ team.name }}</a>
</td>
<td>
<div class="badge">
{{ team_member.get_role_display }}
</div>
</td>
<td class="text-center">
<div class="badge">
{{ team.team_users.all.count }}
</div>
</td>
<td>
{# TODO: disable dropdown btn leave team if user is the only manager #}
<div class="dropdown">
<button class="btn btn-link dropdown-toggle js-dropdown-toggle" data-toggle-menu-id="team-{{ team.id }}">
<i class="i-more-vertical"></i>
</button>
<ul class="dropdown-menu dropdown-menu-right js-dropdown-menu" id="team-{{ team.id }}">
<li>
{# TODO: add page leave team base and link #}
{# TODO: add conditional class 'dropdown-item-disabled' if user is the only manager #}
<a class="dropdown-item {% comment %}dropdown-item-disabled{% endcomment %}" href="#"><i class="i-log-out"></i>Leave Team</a>
</li>
</ul>
</div>
</td>
</tr>
{% endwith %}
{% endfor %}
</tbody>
</table>
{% else %}
<p>
You are not assigned to any teams yet.
</p>
{% endif %}
</div>
</div>
{% endblock settings %}