add some group management
This commit is contained in:
parent
602127cbdc
commit
026fbf3c58
6 changed files with 157 additions and 21 deletions
26
ldap_frontend/templates/groups/list.html
Normal file
26
ldap_frontend/templates/groups/list.html
Normal file
|
@ -0,0 +1,26 @@
|
|||
{% extends "layout/default.html" %}
|
||||
{% block title %}groups{% endblock %}
|
||||
{% block content %}
|
||||
<table class="table table-hover align-middle">
|
||||
<thead class="table-light">
|
||||
<tr>
|
||||
<th scope="col">group name</th>
|
||||
<th scope="col">group description</th>
|
||||
<th scope="col">member count</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for group in groups|sort %}
|
||||
<tr>
|
||||
{% if USER_IS_ADMIN %}
|
||||
<th scope="row"><a href="{{ url_for("group_edit", ou=group["ou"]) }}">{{ group["ou"] }}</a></th>
|
||||
{% else %}
|
||||
<th scope="row">{{ group["ou"] }}</th>
|
||||
{% endif %}
|
||||
<td>{{ group["description"] }}</td>
|
||||
<td>{{ group["member"]|length }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% endblock %}
|
27
ldap_frontend/templates/groups/members.html
Normal file
27
ldap_frontend/templates/groups/members.html
Normal file
|
@ -0,0 +1,27 @@
|
|||
{% extends "layout/default.html" %}
|
||||
{% block title %}group {{ ou }}{% endblock %}
|
||||
{% block content %}
|
||||
<table class="table table-hover align-middle">
|
||||
<thead class="table-light">
|
||||
<tr>
|
||||
<th scope="col">uid</th>
|
||||
<th scope="col">cn</th>
|
||||
<th scope="col">remove</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for member in members|sort %}
|
||||
<tr>
|
||||
<th scope="row">{{ member["uid"] }}</th>
|
||||
<td>{{ member["cn"] }}</td>
|
||||
<td>
|
||||
<form action="{{ url_for("group_edit", ou=ou) }}" method="post">
|
||||
<input type="hidden" name="remove" value="{{ member["uid"] }}">
|
||||
<input type="submit" value="remove" class="btn btn-danger">
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% endblock %}
|
|
@ -23,7 +23,7 @@
|
|||
<a class="nav-link" href="{{ url_for("selfservice") }}">self service</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="#">groups</a>
|
||||
<a class="nav-link" href="{{ url_for("groups") }}">groups</a>
|
||||
</li>
|
||||
</ul>
|
||||
<span class="navbar-text navbar-right">Signed in as <em>{{ CURRENT_USER["uid"] }}</em> - <a href="{{ url_for("logout") }}">logout</a></span>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue