diff --git a/plinth/modules/users/templates/users_change_password.html b/plinth/modules/users/templates/users_change_password.html index 4a64f5c28..70972603b 100644 --- a/plinth/modules/users/templates/users_change_password.html +++ b/plinth/modules/users/templates/users_change_password.html @@ -21,27 +21,22 @@ {% load bootstrap %} {% load i18n %} -{% block content %} +{% block content_row %} +
+

+ {% blocktrans trimmed with username=form.user.username %} + Change Password for {{ username }} + {% endblocktrans %} +

+
+ {% csrf_token %} -

- {% blocktrans trimmed with username=form.user.username %} - Change Password for {{ username }} - {% endblocktrans %} -

+ {{ form|bootstrap }} -
-
- - {% csrf_token %} - - {{ form|bootstrap }} - - - -
+ +
- {% endblock %} {% block page_js %} diff --git a/plinth/modules/users/templates/users_update.html b/plinth/modules/users/templates/users_update.html index 6dc15717b..9c0fd28a9 100644 --- a/plinth/modules/users/templates/users_update.html +++ b/plinth/modules/users/templates/users_update.html @@ -29,32 +29,28 @@ {% endblock %} -{% block content %} +{% block content_row %} +
+

{{ object.username }}

-

{{ object.username }}

+

+ {% url 'users:change_password' object.username as change_password_url %} -

- {% url 'users:change_password' object.username as change_password_url %} + {% blocktrans trimmed %} + Use the change password form + to change the password. + {% endblocktrans %} +

- {% blocktrans trimmed %} - Use the change password form - to change the password. - {% endblocktrans %} -

+
+ {% csrf_token %} -
-
- - {% csrf_token %} + {{ form|bootstrap }} - {{ form|bootstrap }} - - - -
+ +
- {% endblock %} {% block page_js %} diff --git a/plinth/modules/users/urls.py b/plinth/modules/users/urls.py index fca202851..79d16d852 100644 --- a/plinth/modules/users/urls.py +++ b/plinth/modules/users/urls.py @@ -24,18 +24,19 @@ from django.contrib.auth import views as auth_views from django.urls import reverse_lazy from stronghold.decorators import public +from plinth.utils import non_admin_view from . import views urlpatterns = [ url(r'^sys/users/$', views.UserList.as_view(), name='index'), url(r'^sys/users/create/$', views.UserCreate.as_view(), name='create'), - url(r'^sys/users/(?P[\w.@+-]+)/edit/$', views.UserUpdate.as_view(), + url(r'^sys/users/(?P[\w.@+-]+)/edit/$', non_admin_view(views.UserUpdate.as_view()), name='edit'), url(r'^sys/users/(?P[\w.@+-]+)/delete/$', views.UserDelete.as_view(), name='delete'), url(r'^sys/users/(?P[\w.@+-]+)/change_password/$', - views.UserChangePassword.as_view(), name='change_password'), + non_admin_view(views.UserChangePassword.as_view()), name='change_password'), # Add Django's login/logout urls url(r'^accounts/login/$', public(auth_views.login), {'template_name': 'login.html'}, name='login'),