Add custom password change view
This commit is contained in:
parent
87a23eb76a
commit
36c329f7a7
@ -29,7 +29,7 @@ urlpatterns = [
|
||||
path('realm/<int:realm_id>/user/<str:user_dn>/group/update/',
|
||||
account_manager.views.user_views.realm_user_group_update,
|
||||
name='realm-user-group-update'),
|
||||
path('realm/<int:realm_id>/user/delete/s/<str:user_dn>/', account_manager.views.user_views.realm_user_delete,
|
||||
path('realm/<int:realm_id>/user/delete/single/<str:user_dn>/', account_manager.views.user_views.realm_user_delete,
|
||||
name='realm-user-delete'),
|
||||
path('realm/<int:realm_id>/user/delete/multiple', account_manager.views.user_views.realm_multiple_user_delete,
|
||||
name='realm-multiple-user-delete'),
|
||||
|
||||
@ -181,6 +181,9 @@
|
||||
{% endmacro %}
|
||||
|
||||
{% macro password_input(field, list='', css_classes='') -%}
|
||||
{% if field.help_text %}
|
||||
<br/>
|
||||
{% endif %}
|
||||
<div class="form-group">
|
||||
<input type="password"
|
||||
{% if css_classes %}
|
||||
@ -211,9 +214,6 @@
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
{% if field.help_text %}
|
||||
<br/>
|
||||
{% endif %}
|
||||
</small>
|
||||
</div>
|
||||
{% endmacro %}
|
||||
|
||||
22
templates/registration/password_change_form.html
Normal file
22
templates/registration/password_change_form.html
Normal file
@ -0,0 +1,22 @@
|
||||
{% extends 'base.jinja2' %}
|
||||
{% import 'macros/form_macros.jinja2' as mform %}
|
||||
{% block content %}
|
||||
<div class="col-12 ">
|
||||
<div class="row justify-content-center justify-content-sm-center">
|
||||
<div class="col-12 col-sm-8 col-md-7 col-lg-5 col-xl-4 bg-white text-dark p-3 mt-5 border">
|
||||
<h1 class="mb-4">Passwort ändern</h1>
|
||||
<form method="post" class="floating-label-form">
|
||||
<input type="hidden" name="csrfmiddlewaretoken" value="{{ csrf_token }}">
|
||||
{{ mform.password_input(form.old_password) }}
|
||||
{{ mform.password_input(form.new_password1) }}
|
||||
{{ mform.password_input(form.new_password2) }}
|
||||
<div class="d-flex mt-4">
|
||||
<button type="submit" class="btn btn-primary mr-auto p-2">Speichern</button>
|
||||
<a href="{{ url('realm-home')}}"
|
||||
class="btn btn-secondary p-2">Abbrechen</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
@ -22,7 +22,8 @@
|
||||
<li class="list-group-item"><span
|
||||
class="font-weight-bold">Email:</span> {{ user.email }}</li>
|
||||
<li class="list-group-item"><span
|
||||
class="font-weight-bold">Passwort:</span> {{ user.password }}
|
||||
class="font-weight-bold">Passwort:</span> {{ user.password }} <a
|
||||
href="{{ url('password_change') }}">Passwort ändern</a>
|
||||
</li>
|
||||
<li class="list-group-item"><span
|
||||
class="font-weight-bold">Telefon:</span> {{ user.phone }}</li>
|
||||
|
||||
Reference in New Issue
Block a user