#101 Team settings

* adds first implementation for team managing
This commit is contained in:
2022-02-17 13:13:32 +01:00
parent 2339fcebd1
commit 75c70ff8dc
9 changed files with 285 additions and 32 deletions

View File

@@ -62,6 +62,14 @@
</button>
</a>
</div>
<div class="row mb-2">
<a href="{% url 'user:team-index' %}" title="{% trans 'Manage teams' %}">
<button class="btn btn-default">
{% fa5_icon 'users' %}
<span>{% trans 'Teams' %}</span>
</button>
</a>
</div>
</div>
</div>
</div>

View File

@@ -0,0 +1,67 @@
{% extends 'base.html' %}
{% load i18n fontawesome_5 %}
{% block head %}
{% comment %}
dal documentation (django-autocomplete-light) states using form.media for adding needed scripts.
This does not work properly with modal forms, as the scripts are not loaded properly inside the modal.
Therefore the script linkages from form.media have been extracted and put inside dal/scripts.html to ensure
these scripts are loaded when needed.
{% endcomment %}
{% include 'dal/scripts.html' %}
{% endblock %}
{% block body %}
<h4>{% trans 'Teams' %}</h4>
<div class="col-md">
<button class="btn rlp-r btn-modal" data-form-url="{% url 'user:team-new' %}" title="{% trans 'Add new team' %}">
{% fa5_icon 'plus' %}
{% trans 'New' %}
</button>
</div>
<div class="table-container">
<table class="table table-hover">
<thead>
<tr>
<th scope="col" class="align-middle">{% trans 'Name' %}</th>
<th scope="col" class="align-middle w-20">{% trans 'Description' %}</th>
<th scope="col" class="align-middle">{% trans 'Members' %}</th>
<th scope="col" class="align-middle">{% trans 'Actions' %}</th>
</tr>
</thead>
<tbody>
{% for team in teams %}
<tr>
<td>{{team.name}}</td>
<td>
<div class="scroll-150">
{{team.description}}
</div>
</td>
<td>
{% for member in team.users.all %}
<span class="badge badge-pill rlp-r">{{member.username}}</span>
{% endfor %}
</td>
<td>
{% if team.admin == user %}
<button class="btn rlp-r btn-modal" data-form-url="{% url 'user:team-edit' team.id %}" title="{% trans 'Edit team' %}">
{% fa5_icon 'edit' %}
</button>
<button class="btn rlp-r btn-modal" data-form-url="{% url 'user:team-remove' team.id %}" title="{% trans 'Remove team' %}">
{% fa5_icon 'trash' %}
</button>
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% with 'btn-modal' as btn_class %}
{% include 'modal/modal_form_script.html' %}
{% endwith %}
{% endblock %}