58 lines
2.3 KiB
Django/Jinja
58 lines
2.3 KiB
Django/Jinja
{% macro get_sidebar(realms, realm=None) -%}
|
|
{# <div class="col-2 col-xl-3 sidebar">#}
|
|
<div class="bg-light border-right sidebar-wrapper">
|
|
<h2 class="sidebar-heading">Realms</h2>
|
|
<div class="list-group list-group-flush">
|
|
<a href="#" class="list-group-item list-group-item-action bg-light">Dashboard</a>
|
|
{% for realm_item in realms %}
|
|
<a href="{{ url('realm-detail', args=[realm_item.id]) }}">{{ realm_item.name }}</a>
|
|
{# {% if request.user.is_superuser %}#}
|
|
{# <a href="{{ url('realm-delete', args=[realm_item.id]) }}">Delete</a>#}
|
|
{# {% endif %}#}
|
|
{% endfor %}
|
|
{% if realm %}
|
|
<h2>{{ realm.name }}</h2>
|
|
{# <a href="{{ }}">Users</a>#}
|
|
{# <a href="{{ }}">Groups</a>#}
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
{# </div>#}
|
|
{% endmacro %}
|
|
|
|
{% macro get_user_table(realm, users) -%}
|
|
<div class="form-group w-25 float-right">
|
|
<input type="text"
|
|
class="form-control"
|
|
id="data-table-search-input">
|
|
<label for="data-table-search-input">Suche</label>
|
|
</div>
|
|
<table class="table table-hover table-striped table-inverse table-bordered data-table">
|
|
<thead>
|
|
<tr>
|
|
<th scope="col">Nutzername</th>
|
|
<th scope="col">E-Mail</th>
|
|
<th scope="col">Vorname</th>
|
|
<th scope="col">Nachname</th>
|
|
<th scope="col">Aktiv</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for user in users %}
|
|
<tr>
|
|
<td>
|
|
<a href="{{ url('realm-user-detail', args=[realm.id, user.user.dn]) }}">{{ user.user.username }}</a>
|
|
</td>
|
|
<td>{{ user.user.email }}</td>
|
|
<td>{{ user.user.first_name }}</td>
|
|
<td>{{ user.user.last_name }}</td>
|
|
<td class="text-center">{% if user.active %}
|
|
<i class="fas fa-check-circle text-success"></i>{% else %}
|
|
<i class="far fa-times-circle text-warning"></i>{% endif %}</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
{% endmacro %}
|
|
|