Update layout
This commit is contained in:
parent
cd9043d8f3
commit
0b13fe4d7a
@ -40,11 +40,8 @@ class RealmUpdateForm(forms.Form):
|
||||
ldap_base_dn = forms.CharField(label='LDAP Base DN',
|
||||
help_text='TODO',
|
||||
max_length=200)
|
||||
email = forms.EmailField(label='Bereichs E-Mail Adresse')
|
||||
name = forms.CharField(label='Bereichsname', max_length=200)
|
||||
admin_group = forms.ModelChoiceField(label='Admin Grouppe',
|
||||
admin_group = forms.ModelChoiceField(label='Admin Gruppe',
|
||||
help_text="Die Mitglieder dieser Gruppe darf den Bereich administieren",
|
||||
queryset=LdapGroup.objects.all())
|
||||
|
||||
|
||||
class EmailSettingsForm(forms.Form):
|
||||
email = forms.EmailField(label='Eigene E-Mail Adresse')
|
||||
|
||||
@ -10,7 +10,7 @@ from django.shortcuts import render, redirect, HttpResponse
|
||||
|
||||
from account_helper.models import Realm
|
||||
from account_manager.utils.mail_utils import realm_send_mail
|
||||
from .forms import RealmAddForm, RealmUpdateForm, EmailSettingsForm
|
||||
from .forms import RealmAddForm, RealmUpdateForm
|
||||
from .models import LdapGroup, LdapUser
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
@ -75,12 +75,14 @@ def realm_update(request, realm_id):
|
||||
if request.user.is_superuser:
|
||||
realm_obj = Realm.objects.get(id=realm_id)
|
||||
data = {'id': realm_obj.id, 'ldap_base_dn': realm_obj.ldap_base_dn, 'name': realm_obj.name,
|
||||
'email': realm_obj.email,
|
||||
'admin_group': realm_obj.admin_group}
|
||||
if request.method == 'POST':
|
||||
form = RealmUpdateForm(request.POST)
|
||||
if form.is_valid():
|
||||
realm_obj.name = form.cleaned_data['name']
|
||||
realm_obj.ldap_base_dn = form.cleaned_data['ldap_base_dn']
|
||||
realm_obj.email = form.cleaned_data['email']
|
||||
admin_ldap_group = form.cleaned_data['admin_group']
|
||||
realm_obj.admin_group, _ = Group.objects.get_or_create(name=admin_ldap_group.name)
|
||||
realm_obj.save()
|
||||
@ -119,23 +121,23 @@ def permission_denied(request):
|
||||
return render(request, 'permission_denied.jinja2', {})
|
||||
|
||||
|
||||
@login_required
|
||||
@is_realm_admin
|
||||
def realm_email_update(request, realm_id):
|
||||
realm = Realm.objects.get(id=realm_id)
|
||||
|
||||
if request.method == 'POST':
|
||||
form = EmailSettingsForm(request.POST)
|
||||
if form.is_valid():
|
||||
realm.email = form.cleaned_data['email']
|
||||
realm.save()
|
||||
return redirect('realm-detail', realm.id)
|
||||
else:
|
||||
data = {}
|
||||
if realm.email:
|
||||
data = {'email': realm.email, }
|
||||
form = EmailSettingsForm(initial=data)
|
||||
return render(request, 'realm/realm_create_update_mail.jinja2', {'realm': realm, 'form': form})
|
||||
# @login_required
|
||||
# @is_realm_admin
|
||||
# def realm_email_update(request, realm_id):
|
||||
# realm = Realm.objects.get(id=realm_id)
|
||||
#
|
||||
# if request.method == 'POST':
|
||||
# form = EmailSettingsForm(request.POST)
|
||||
# if form.is_valid():
|
||||
# realm.email = form.cleaned_data['email']
|
||||
# realm.save()
|
||||
# return redirect('realm-detail', realm.id)
|
||||
# else:
|
||||
# data = {}
|
||||
# if realm.email:
|
||||
# data = {'email': realm.email, }
|
||||
# form = EmailSettingsForm(initial=data)
|
||||
# return render(request, 'realm/realm_create_update_mail.jinja2', {'realm': realm, 'form': form})
|
||||
|
||||
|
||||
def realm_email_test(request, realm_id):
|
||||
|
||||
@ -10,7 +10,7 @@ urlpatterns = [
|
||||
path('realm/<int:realm_id>/', main_views.realm_detail, name='realm-detail'),
|
||||
path('realm/<int:realm_id>/update/', main_views.realm_update, name='realm-update'),
|
||||
path('realm/<int:realm_id>/delete/', main_views.realm_delete, name='realm-delete'),
|
||||
path('realm/<int:realm_id>/mail/', main_views.realm_email_update, name='realm-mail-add-update'),
|
||||
# path('realm/<int:realm_id>/mail/', main_views.realm_email_update, name='realm-mail-add-update'),
|
||||
path('realm/<int:realm_id>/mail/test/', main_views.realm_email_test, name='realm-mail-test'),
|
||||
|
||||
# Realm User
|
||||
|
||||
@ -74,7 +74,7 @@ def group_update(request, realm_id, group_dn):
|
||||
data = {'name': group.name, 'members': group.members}
|
||||
form = AddLDAPGroupForm(initial=data)
|
||||
|
||||
return render(request, 'group/group_detail.jinja2', {'form': form, 'realm': realm})
|
||||
return render(request, 'group/group_detail.jinja2', {'form': form, 'realm': realm, 'group': group})
|
||||
|
||||
|
||||
def group_delete(request, realm_id, group_dn):
|
||||
|
||||
@ -3,21 +3,28 @@
|
||||
{% block body %}
|
||||
<div class="d-flex wrapper">
|
||||
<div class="bg-light border-right sidebar-wrapper">
|
||||
<h2 class="sidebar-heading">Realms</h2>
|
||||
<div class="list-group list-group-flush">
|
||||
{% for realm_item in realms %}
|
||||
<a href="{{ url('realm-detail', args=[realm_item.id]) }}"
|
||||
class="list-group-item list-group-item-action bg-light">{{ 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 class="sidebar-heading">{{ realm.name }}</h2>
|
||||
{# <a href="{{ }}">Users</a>#}
|
||||
{# <a href="{{ }}">Groups</a>#}
|
||||
{% endif %}
|
||||
</div>
|
||||
{% if realms %}
|
||||
<h2 class="sidebar-heading">Realms</h2>
|
||||
<div class="list-group list-group-flush">
|
||||
{% for realm_item in realms %}
|
||||
<a href="{{ url('realm-detail', args=[realm_item.id]) }}"
|
||||
class="list-group-item list-group-item-action bg-light">{{ realm_item.name }} </a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% else %}
|
||||
<h2 class="sidebar-heading">Bereich</h2>
|
||||
<a href="{{ url('realm-home') }}" class="list-group-item list-group-item-action bg-light">
|
||||
Bereichsübersicht</a>
|
||||
<h2 class="sidebar-heading">{{ realm.name }}</h2>
|
||||
<div class="list-group list-group-flush">
|
||||
<a href="{{ url('realm-detail', args=[realm.id]) }}"
|
||||
class="list-group-item list-group-item-action bg-light">Bereichsinformationen</a>
|
||||
<a href="{{ url('realm-user-list', args=[realm.id]) }}"
|
||||
class="list-group-item list-group-item-action bg-light">Nutzer</a>
|
||||
<a href="{{ url('realm-group-list', args=[realm.id]) }}"
|
||||
class="list-group-item list-group-item-action bg-light">Gruppen</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="page-content-wrapper">
|
||||
|
||||
@ -1,5 +1,16 @@
|
||||
<form action="{{ url('realm-group-add', args=[realm.id]) }}" method="post">
|
||||
<input type="hidden" name="csrfmiddlewaretoken" value="{{ csrf_token }}">
|
||||
{{ form.as_p() }}
|
||||
<input type="submit" value="Submit">
|
||||
</form>
|
||||
{% extends 'realm/realm_detailed.jinja2' %}
|
||||
{% import 'macros/form_macros.jinja2' as mform %}
|
||||
|
||||
{% block detail_content %}
|
||||
<form action="{{ url('realm-group-add', args=[realm.id]) }}" method="post">
|
||||
<input type="hidden" name="csrfmiddlewaretoken" value="{{ csrf_token }}">
|
||||
{{ mform.text_input(form.name) }}
|
||||
<p>Mitglieder</p>
|
||||
{{ form.members }}
|
||||
<div class="d-flex mt-4">
|
||||
<button type="submit" class="btn btn-primary mr-auto p-2">Speichern</button>
|
||||
<a href="{{ url('realm-group-list', args = [realm.id]) }}"
|
||||
class="btn btn-secondary p-2">Abbrechen</a>
|
||||
</div>
|
||||
</form>
|
||||
{% endblock %}
|
||||
@ -1,21 +1,45 @@
|
||||
{% extends 'realm/realm_detailed.jinja2' %}
|
||||
{% import 'macros/form_macros.jinja2' as forms %}
|
||||
{% block extra_content %}
|
||||
{% import 'macros/form_macros.jinja2' as mform %}
|
||||
|
||||
{% block detail_content %}
|
||||
{% if not form %}
|
||||
<h1>{{ group.name }}</h1>
|
||||
<p>DN: {{ group.dn }}</p>
|
||||
<p>Nutzername: {{ group.name }}</p>
|
||||
<h3>{{ group.name }}</h3>
|
||||
<ul class="list-group list-group-flush w-100 mb-3">
|
||||
<li class="list-group-item">Ldap Domain: {{ group.dn }}</li>
|
||||
</ul>
|
||||
<h2>Mitglieder</h2>
|
||||
{% for user in group.members %}
|
||||
<p>{{ user }}</p>
|
||||
{% endfor %}
|
||||
<a href="{{ url('realm-group-update', args = [realm.id, group.dn]) }}">Update Gruppe</a>
|
||||
<a href="{{ url('realm-group-delete', args = [realm.id, group.dn]) }}">Delete Gruppe</a>
|
||||
<ul class="list-group list-group-flush w-100 mb-3">
|
||||
{% for user in group.members %}
|
||||
<li class="list-group-item"><a
|
||||
href="{{ url('realm-user-detail', args=[realm.id, user]) }}">{{ user }}</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
<div class="d-flex mt-3">
|
||||
<a href="{{ url('realm-group-update', args = [realm.id, group.dn]) }}" class="btn btn-primary mr-auto p-2">Update
|
||||
Gruppe</a>
|
||||
<a href="{{ url('realm-group-delete', args = [realm.id, group.dn]) }}" class="btn btn-danger p-2">Delete
|
||||
Gruppe</a>
|
||||
</div>
|
||||
{% else %}
|
||||
<form method="post">
|
||||
<input type="hidden" name="csrfmiddlewaretoken" value="{{ csrf_token }}">
|
||||
{{ form.as_p()|safe }}
|
||||
<button type="submit">Speichern</button>
|
||||
{{ mform.text_input(form.name) }}
|
||||
{% for choice_value, choice_label in form.members.field.choices %}
|
||||
<p>{{ form.members.html_name }} | {{ choice_value }} | {{ choice_label }} | {{ form.members.value.value }}</p>
|
||||
{# {{ mform.checkbox_input_for_choice_fields(choice_id, choice_label ) }}#}
|
||||
{% endfor %}
|
||||
{# {% for value in form.members.value %}#}
|
||||
{# <p>{{ value }}</p>#}
|
||||
{# {{ mform.checkbox_input_for_choice_fields(choice_id, choice_label ) }}#}
|
||||
{# {% endfor %}#}
|
||||
|
||||
<div class="d-flex mt-4">
|
||||
<button type="submit" class="btn btn-primary mr-auto p-2">Speichern</button>
|
||||
<a href="{{ url('realm-group-detail', args = [realm.id, group.dn]) }}"
|
||||
class="btn btn-secondary p-2">Abbrechen</a>
|
||||
</div>
|
||||
</form>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
@ -143,6 +143,37 @@
|
||||
</div>
|
||||
{% endmacro %}
|
||||
|
||||
{% macro checkbox_input_for_choice_fields(label, value, id) -%}
|
||||
<div class="form-check">
|
||||
{# <label class="{{ type }}{% if display == "inline" or field.field.widget.attrs.inline %} inline{% endif %}">#}
|
||||
{# <input#}
|
||||
{# type="checkbox"#}
|
||||
{# name="{{ field.html_name }}"#}
|
||||
{# value="{{ choice_id }}"#}
|
||||
{# {% if field.field.widget.allow_multiple_selected %}#}
|
||||
{# {% if choice_id|safe in field.value|safeseq %}checked{% endif %}#}
|
||||
{# {% else %}#}
|
||||
{# {% if field.value|safe == choice_id|safe %}checked{% endif %}#}
|
||||
{# {% endif %}#}
|
||||
{# {{ field.field.widget.attrs|html_attrs }}#}
|
||||
{# />#}
|
||||
{# {{ choice_label }}#}
|
||||
{# </label>#}
|
||||
<input type="checkbox"
|
||||
class="form-check-input"
|
||||
placeholder="{{ field.label }}"
|
||||
aria-describedby="{{ field.id_for_label }}_help"
|
||||
name="{{ field.html_name }}"
|
||||
id="{{ field.id_for_label }}"
|
||||
{% if field.value() != None %}value="{{ field.value() }}"{% endif %}
|
||||
maxlength="{{ field.field.max_length }}"
|
||||
{% if field.field.required %}required{% endif %}>
|
||||
<label id="{{ field.id_for_label }}" class="form-check-label" for="{{ field.id_for_label }}">
|
||||
{{ field.label }}
|
||||
</label>
|
||||
</div>
|
||||
{% endmacro %}
|
||||
|
||||
{% macro select_input(field, multiple=False) -%}
|
||||
<div class="form-group">
|
||||
<label for="{{ field.id_for_label }}">{{ field.label }}</label>
|
||||
|
||||
@ -1,41 +1,66 @@
|
||||
{% extends 'base.jinja2' %}
|
||||
{% block content %}
|
||||
<a href="{{ url('realm-home') }}">Zurück zur Realmübersicht</a>
|
||||
<h1>Bereich {{ realm.name }}</h1>
|
||||
{% if notice %}
|
||||
<p style="color: green">{{ notice }}</p>
|
||||
{% endif %}
|
||||
{% if error %}
|
||||
<p style="color: darkred">{{ error }}</p>
|
||||
{% endif %}
|
||||
<h2>Bereich Info</h2>
|
||||
<p>LDAP OU: {{ realm.ldap_base_dn }}</p>
|
||||
{% if realm.email %}
|
||||
<p>Email: {{ realm.email }}</p>
|
||||
{% else %}
|
||||
<p>Noch ausstehend</p>
|
||||
{% endif %}
|
||||
<p>Admin Gruppe: {{ realm.admin_group }}</p>
|
||||
{% if request.user.is_superuser %}
|
||||
{% block realm_form %}
|
||||
<h2><a href="{{ url('realm-update', args=[realm.id]) }}">Bereichsinformationen anpassen</a></h2>
|
||||
{% endblock %}
|
||||
{% endif %}
|
||||
<h2>
|
||||
<a href="{{ url('realm-mail-add-update', args=[realm.id]) }}">E-Mail Einstellungen</a> |
|
||||
{% if realm.email %}
|
||||
<a href="{{ url('realm-mail-test', args=[realm.id]) }}">Test Mail</a>
|
||||
{% endif %}
|
||||
</h2>
|
||||
{% extends 'base_admin.jinja2' %}
|
||||
{% block admin_content %}
|
||||
<div class="row ">
|
||||
<div class="col-12 p-3">
|
||||
<h1>Bereich <span style="text-transform: uppercase">{{ realm.name }}</span>
|
||||
<small>
|
||||
{% if request.user.is_superuser %}
|
||||
<a href="{{ url('realm-delete', args=[realm.id]) }}">Delete</a>
|
||||
{% endif %}
|
||||
</small>
|
||||
</h1>
|
||||
{% if notice %}
|
||||
<p style="color: green">{{ notice }}</p>
|
||||
{% endif %}
|
||||
{% if error %}
|
||||
<p style="color: darkred">{{ error }}</p>
|
||||
{% endif %}
|
||||
{% block detail_content %}
|
||||
<ul class="list-group list-group-flush w-100">
|
||||
<li class="list-group-item">LDAP Organisationseinheit: {{ realm.ldap_base_dn }}</li>
|
||||
{% if realm.email %}
|
||||
<li class="list-group-item">Email: {{ realm.email }}</li>
|
||||
{% else %}
|
||||
<li class="list-group-item">Email: <span class="text-danger">Noch ausstehend</span></li>
|
||||
{% endif %}
|
||||
{% if realm.admin_group %}
|
||||
<li class="list-group-item">Admin Gruppe: {{ realm.admin_group }}</li>
|
||||
{% else %}
|
||||
<li class="list-group-item">Admin Gruppe: <span class="text-warning">Noch ausstehend</span></li>
|
||||
{% endif %}
|
||||
{% if realm.default_group %}
|
||||
<li class="list-group-item">Default Gruppe: {{ realm.admin_group }}</li>
|
||||
{% else %}
|
||||
<li class="list-group-item">Default Gruppe: <span class="text-warning">Noch ausstehend</span>
|
||||
</li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
<div class="d-flex mt-3">
|
||||
{% if request.user.is_superuser %}
|
||||
<a href="{{ url('realm-update', args=[realm.id]) }}" class="btn btn-primary mr-auto p-2">Bereichsinformationen
|
||||
anpassen</a>
|
||||
{% endif %}
|
||||
{# <a href="{{ url('realm-mail-add-update', args=[realm.id]) }}" class="btn btn-primary p-2">E-Mail#}
|
||||
{# Einstellungen</a>#}
|
||||
{% if realm.email %}
|
||||
<a href="{{ url('realm-mail-test', args=[realm.id]) }}" class="btn btn-secondary p-2">Test
|
||||
Mail</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% block realm_form %}
|
||||
{% endblock %}
|
||||
{% endblock %}
|
||||
|
||||
<h2><a href="{{ url('realm-user-add', args=[realm.id]) }}">Nutzer hinzufügen</a></h2>
|
||||
{% block user_content %}
|
||||
<h2><a href="{{ url('realm-user-list', args=[realm.id]) }}">Nutzer</a></h2>
|
||||
{% endblock %}
|
||||
<h2><a href="{{ url('realm-group-add', args=[realm.id]) }}">Gruppen hinzufügen</a></h2>
|
||||
{% block groups_content %}
|
||||
<h2><a href="{{ url('realm-group-list', args=[realm.id]) }}">Gruppen</a></h2>
|
||||
{% endblock %}
|
||||
{% block extra_content %}
|
||||
{% endblock %}
|
||||
{# <h2><a href="{{ url('realm-user-add', args=[realm.id]) }}">Nutzer hinzufügen</a></h2>#}
|
||||
{# {% block user_content %}#}
|
||||
{# <h2><a href="{{ url('realm-user-list', args=[realm.id]) }}">Nutzer</a></h2>#}
|
||||
{# {% endblock %}#}
|
||||
{# <h2><a href="{{ url('realm-group-add', args=[realm.id]) }}">Gruppen hinzufügen</a></h2>#}
|
||||
{# {% block groups_content %}#}
|
||||
{# <h2><a href="{{ url('realm-group-list', args=[realm.id]) }}">Gruppen</a></h2>#}
|
||||
{# {% endblock %}#}
|
||||
{# {% block extra_content %}#}
|
||||
{# {% endblock %}#}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
@ -1,9 +1,24 @@
|
||||
{% extends 'realm/realm_detailed.jinja2' %}
|
||||
|
||||
{% block groups_content %}
|
||||
<h2>Gruppen</h2>
|
||||
{% for group in realm_groups %}
|
||||
<p>{{ group.name }} - <a href="{{ url('realm-group-detail', args=[realm.id, group.dn]) }}">{{ group.dn }}</a>
|
||||
</p>
|
||||
{% endfor %}
|
||||
{% block detail_content %}
|
||||
<h3>Gruppen</h3>
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">Name</th>
|
||||
<th scope="col">Ldap Domain</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for group in realm_groups %}
|
||||
<tr>
|
||||
<td>{{ group.name }}</td>
|
||||
<td>
|
||||
<a href="{{ url('realm-group-detail', args=[realm.id, group.dn]) }}">{{ group.dn }}</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
<a href="{{ url('realm-group-add', args=[realm.id]) }}" class="btn btn-primary">Gruppen hinzufügen</a>
|
||||
{% endblock %}
|
||||
|
||||
@ -1,10 +1,19 @@
|
||||
{% extends 'realm/realm_detailed.jinja2' %}
|
||||
{% block realm_form %}
|
||||
{% import 'macros/form_macros.jinja2' as mform %}
|
||||
|
||||
{% block detail_content %}
|
||||
{% if form %}
|
||||
<form method="post">
|
||||
<input type="hidden" name="csrfmiddlewaretoken" value="{{ csrf_token }}">
|
||||
{{ form.as_p()|safe }}
|
||||
<button type="submit">Speichern</button>
|
||||
{{ mform.text_input(form.ldap_base_dn) }}
|
||||
{{ mform.text_input(form.name) }}
|
||||
{{ mform.email_input(form.email) }}
|
||||
{{ mform.text_input(form.admin_group) }}
|
||||
<div class="d-flex mt-4">
|
||||
<button type="submit" class="btn btn-primary mr-auto p-2">Speichern</button>
|
||||
<a href="{{ url('realm-detail', args = [realm.id]) }}"
|
||||
class="btn btn-secondary p-2">Abbrechen</a>
|
||||
</div>
|
||||
</form>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
@ -1,10 +1,24 @@
|
||||
{% extends 'realm/realm_detailed.jinja2' %}
|
||||
{% block user_content %}
|
||||
{% block detail_content %}
|
||||
<h2>Nutzer</h2>
|
||||
<a href="{{ url('realm-multiple-user-delete', args=[realm.id]) }}"> Mehrere Nutzer Löschen</a>
|
||||
{% for user in realm_user %}
|
||||
<p>
|
||||
{{ user.username }} - <a href="{{ url('realm-user-detail', args=[realm.id, user.dn]) }}">{{ user.dn }}</a>
|
||||
</p>
|
||||
{% endfor %}
|
||||
<a href="{{ url('realm-multiple-user-delete', args=[realm.id]) }}" class="text-right"> Mehrere Nutzer Löschen</a>
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">Name</th>
|
||||
<th scope="col">Ldap Domain</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for user in realm_user %}
|
||||
<tr>
|
||||
<td>{{ user.username }}</td>
|
||||
<td>
|
||||
<a href="{{ url('realm-user-detail', args=[realm.id, user.dn]) }}">{{ user.dn }}</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
<a href="{{ url('realm-user-add', args=[realm.id]) }}" class="btn btn-primary">Nutzer hinzufügen</a>
|
||||
{% endblock %}
|
||||
@ -1,10 +1,15 @@
|
||||
{% extends 'realm/realm_detailed.jinja2' %}
|
||||
{% block user_content %}
|
||||
<h2>Nutzer</h2>
|
||||
<a href="{{ url('realm-user-list', args=[realm.id]) }}">Abrechen</a>
|
||||
{% import 'macros/form_macros.jinja2' as mform %}
|
||||
|
||||
{% block detail_content %}
|
||||
<h2>Nutzer löschen</h2>
|
||||
<form action="{{ url('realm-multiple-user-delete', args=[realm.id]) }}" method="post">
|
||||
<input type="hidden" name="csrfmiddlewaretoken" value="{{ csrf_token }}">
|
||||
<input type="submit" value="Ausführen">
|
||||
{{ form.as_p() }}
|
||||
<div class="d-flex mt-4">
|
||||
<button type="submit" class="btn btn-danger mr-auto p-2">Ausführen</button>
|
||||
<a href="{{ url('realm-user-list', args = [realm.id]) }}"
|
||||
class="btn btn-secondary p-2">Abbrechen</a>
|
||||
</div>
|
||||
</form>
|
||||
{% endblock %}
|
||||
@ -1,6 +1,17 @@
|
||||
<h1>Einen Nutzer für den Bereich {{ realm.name }} anlegen</h1>
|
||||
<form action="{{ url('realm-user-add', args=[realm.id]) }}" method="post">
|
||||
<input type="hidden" name="csrfmiddlewaretoken" value="{{ csrf_token }}">
|
||||
{{ form.as_p() }}
|
||||
<input type="submit" value="Submit">
|
||||
</form>
|
||||
{% extends 'realm/realm_detailed.jinja2' %}
|
||||
{% import 'macros/form_macros.jinja2' as mform %}
|
||||
|
||||
{% block detail_content %}
|
||||
<h2>Nutzer anlegen</h2>
|
||||
<form action="{{ url('realm-user-add', args=[realm.id]) }}" method="post">
|
||||
<input type="hidden" name="csrfmiddlewaretoken" value="{{ csrf_token }}">
|
||||
{# {{ form.as_p() }}#}
|
||||
{{ mform.text_input(form.username) }}
|
||||
{{ mform.email_input(form.email) }}
|
||||
<div class="d-flex mt-4">
|
||||
<button type="submit" class="btn btn-primary mr-auto p-2">Speichern</button>
|
||||
<a href="{{ url('realm-user-list', args = [realm.id]) }}"
|
||||
class="btn btn-secondary p-2">Abbrechen</a>
|
||||
</div>
|
||||
</form>
|
||||
{% endblock %}
|
||||
@ -1,23 +1,37 @@
|
||||
{% extends 'realm/realm_detailed.jinja2' %}
|
||||
{% block extra_content %}
|
||||
<div class="col-6">
|
||||
{% if not form %}
|
||||
<p>DN: {{ user.dn }}</p>
|
||||
<p>Nutzername: {{ user.username }}</p>
|
||||
<p>Vorname: {{ user.first_name }}</p>
|
||||
<p>Nachname: {{ user.last_name }}</p>
|
||||
<p>Email: {{ user.email }}</p>
|
||||
<p>Passwort: {{ user.password }}</p>
|
||||
<p>Telefon: {{ user.phone }}</p>
|
||||
<p>Mobiltelefon: {{ user.mobile_phone }}</p>
|
||||
<a href="{{ url('realm-user-update', args = [realm.id, user.dn]) }}">Update User</a>
|
||||
<a href="{{ url('realm-user-delete', args = [realm.id, user.dn]) }}">Delete User</a>
|
||||
{% else %}
|
||||
<form method="post">
|
||||
<input type="hidden" name="csrfmiddlewaretoken" value="{{ csrf_token }}">
|
||||
{{ form.as_p()|safe }}
|
||||
<button type="submit">Speichern</button>
|
||||
</form>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% import 'macros/form_macros.jinja2' as mform %}
|
||||
|
||||
{% block detail_content %}
|
||||
<h3>{{ user.username }}</h3>
|
||||
{% if not form %}
|
||||
<ul class="list-group list-group-flush w-100">
|
||||
<li class="list-group-item">Ldap Domain: {{ user.dn }}</li>
|
||||
{# <li class="list-group-item">Nutzername: {{ user.username }}</li>#}
|
||||
<li class="list-group-item">Vorname: {{ user.first_name }}</li>
|
||||
<li class="list-group-item">Nachname: {{ user.last_name }}</li>
|
||||
<li class="list-group-item">Email: {{ user.email }}</li>
|
||||
<li class="list-group-item">Passwort: {{ user.password }}</li>
|
||||
<li class="list-group-item">Telefon: {{ user.phone }}</li>
|
||||
<li class="list-group-item">Mobiltelefon: {{ user.mobile_phone }}</li>
|
||||
</ul>
|
||||
<div class="d-flex mt-3">
|
||||
<a href="{{ url('realm-user-update', args = [realm.id, user.dn]) }}" class="btn btn-primary mr-auto p-2">Update
|
||||
User</a>
|
||||
<a href="{{ url('realm-user-delete', args = [realm.id, user.dn]) }}" class="btn btn-danger p-2">Delete
|
||||
User</a>
|
||||
</div>
|
||||
{% else %}
|
||||
<form method="post">
|
||||
<input type="hidden" name="csrfmiddlewaretoken" value="{{ csrf_token }}">
|
||||
{{ mform.email_input(form.email) }}
|
||||
{{ mform.password_input(form.password) }}
|
||||
{{ mform.text_input(form.first_name) }}
|
||||
{{ mform.text_input(form.last_name) }}
|
||||
<div class="d-flex mt-4">
|
||||
<button type="submit" class="btn btn-primary mr-auto p-2">Speichern</button>
|
||||
<a href="{{ url('realm-user-detail', args = [realm.id, user.dn]) }}"
|
||||
class="btn btn-secondary p-2">Abbrechen</a>
|
||||
</div>
|
||||
</form>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user