113 lines
4.4 KiB
Django/Jinja
113 lines
4.4 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 %}
|
|
|
|
{% macro get_realm_table(realms) -%}
|
|
<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 text-center">
|
|
<thead>
|
|
<tr>
|
|
<th scope="col">Bereichsname</th>
|
|
<th scope="col">Ldap Basis DN</th>
|
|
<th scope="col">Mailadresse</th>
|
|
<th scope="col">Admingruppe</th>
|
|
<th scope="col">Defaultgruppe</th>
|
|
<th scope="col">Nutzeranzahl</th>
|
|
<th scope="col">Gruppenanzahl</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for realm_wrapper in realms %}
|
|
<tr>
|
|
<td>
|
|
<a href="{{ url('realm-detail', args=[realm_wrapper.realm.id]) }}">{{ realm_wrapper.realm.name }}</a>
|
|
</td>
|
|
<td>{{ realm_wrapper.realm.ldap_base_dn }}</td>
|
|
<td>{{ realm_wrapper.realm.email }}</td>
|
|
<td>
|
|
{% if realm_wrapper.realm.admin_group %}
|
|
{{ realm_wrapper.realm.admin_group }}
|
|
{% else %}
|
|
<span class="text-warning"><i class="fas fa-exclamation-circle"></i></span>
|
|
{% endif %}
|
|
</td>
|
|
<td>
|
|
{% if realm_wrapper.realm.default_group %}
|
|
{{ realm_wrapper.realm.default_group }}
|
|
{% else %}
|
|
<span class="text-warning"><i class="fas fa-exclamation-circle align-middle"></i></span>
|
|
{% endif %}
|
|
</td>
|
|
<td>{{ realm_wrapper.user_count }}</td>
|
|
<td>{{ realm_wrapper.group_count }}</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
{% endmacro %}
|
|
|
|
{% macro get_warning_box(error_text) -%}
|
|
{% if error_text %}
|
|
<div class="alert alert-warning">{{ error_text }}</div>
|
|
{% endif %}
|
|
{% endmacro %}
|
|
|