mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-09-19 04:59:01 +00:00
Update UI strings in user module
- Fixed an i18n issue. - Marked more messages for i18n.
This commit is contained in:
parent
6dc463ff6e
commit
20e03c700a
@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
|
||||||
<h3>Change password of {{ form.user.username }}</h3>
|
<h3>Change Password for <em>{{ form.user.username }}</em></h3>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-sm-6">
|
<div class="col-sm-6">
|
||||||
|
|||||||
@ -22,10 +22,9 @@
|
|||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
|
||||||
<h3>Delete User {{ object.username }}</h3>
|
<h3>Delete User <em>{{ object.username }}</em></h3>
|
||||||
<p>
|
|
||||||
Deleting is permanent. Are you sure?
|
<p>Delete user permanently?</p>
|
||||||
</p>
|
|
||||||
|
|
||||||
<form class="form" method="post">
|
<form class="form" method="post">
|
||||||
{% csrf_token %}
|
{% csrf_token %}
|
||||||
|
|||||||
@ -22,10 +22,6 @@
|
|||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
|
||||||
<h3>Users</h3>
|
|
||||||
<p>
|
|
||||||
You can edit or delete users here.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-sm-4">
|
<div class="col-sm-4">
|
||||||
|
|||||||
@ -30,13 +30,13 @@
|
|||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
|
||||||
<h3>Edit {{ object.username }}</h3>
|
<h3>Edit User <em>{{ object.username }}</em></h3>
|
||||||
|
|
||||||
<p style='font-size:larger'>
|
<p style='font-size:larger'>
|
||||||
Use the
|
Use the
|
||||||
<a href='{% url 'users:change_password' object.username %}'>
|
<a href='{% url 'users:change_password' object.username %}'>
|
||||||
Change password form
|
change password form
|
||||||
</a> to change the password of {{ object.username }}.
|
</a> to change the password.
|
||||||
</p>
|
</p>
|
||||||
<hr>
|
<hr>
|
||||||
|
|
||||||
|
|||||||
@ -56,7 +56,7 @@ class UserCreate(PlinthContextMixin, SuccessMessageMixin, CreateView):
|
|||||||
form_class = UserCreationForm
|
form_class = UserCreationForm
|
||||||
template_name = 'users_create.html'
|
template_name = 'users_create.html'
|
||||||
model = User
|
model = User
|
||||||
success_message = "%(username)s was created successfully"
|
success_message = _('User %(username)s created.')
|
||||||
success_url = reverse_lazy('users:create')
|
success_url = reverse_lazy('users:create')
|
||||||
title = _('Create User')
|
title = _('Create User')
|
||||||
|
|
||||||
@ -64,7 +64,7 @@ class UserCreate(PlinthContextMixin, SuccessMessageMixin, CreateView):
|
|||||||
class UserList(PlinthContextMixin, ListView):
|
class UserList(PlinthContextMixin, ListView):
|
||||||
model = User
|
model = User
|
||||||
template_name = 'users_list.html'
|
template_name = 'users_list.html'
|
||||||
title = _('Edit or Delete User')
|
title = _('Users')
|
||||||
|
|
||||||
|
|
||||||
class UserUpdate(PlinthContextMixin, SuccessMessageMixin, UpdateView):
|
class UserUpdate(PlinthContextMixin, SuccessMessageMixin, UpdateView):
|
||||||
@ -72,9 +72,9 @@ class UserUpdate(PlinthContextMixin, SuccessMessageMixin, UpdateView):
|
|||||||
form_class = UserForm
|
form_class = UserForm
|
||||||
model = User
|
model = User
|
||||||
slug_field = "username"
|
slug_field = "username"
|
||||||
success_message = "User %(username)s was changed successfully"
|
|
||||||
fields = ['username', 'password']
|
fields = ['username', 'password']
|
||||||
exclude = ('last_login', 'email', 'first_name', 'last_name')
|
exclude = ('last_login', 'email', 'first_name', 'last_name')
|
||||||
|
success_message = _('User %(username)s updated.')
|
||||||
title = _('Edit User')
|
title = _('Edit User')
|
||||||
|
|
||||||
def get_success_url(self):
|
def get_success_url(self):
|
||||||
@ -99,7 +99,7 @@ class UserDelete(PlinthContextMixin, DeleteView):
|
|||||||
The SuccessMessageMixin doesn't work with the DeleteView on Django1.7,
|
The SuccessMessageMixin doesn't work with the DeleteView on Django1.7,
|
||||||
so set the success message manually here.
|
so set the success message manually here.
|
||||||
"""
|
"""
|
||||||
message = _("User %s was deleted" % self.kwargs['slug'])
|
message = _('User %s deleted.') % self.kwargs['slug']
|
||||||
output = super(UserDelete, self).delete(*args, **kwargs)
|
output = super(UserDelete, self).delete(*args, **kwargs)
|
||||||
messages.success(self.request, message)
|
messages.success(self.request, message)
|
||||||
return output
|
return output
|
||||||
@ -111,7 +111,7 @@ class UserChangePassword(PlinthContextMixin, SuccessMessageMixin, FormView):
|
|||||||
slug_field = "username"
|
slug_field = "username"
|
||||||
model = User
|
model = User
|
||||||
title = _('Create User')
|
title = _('Create User')
|
||||||
success_message = _("The password was changed successfully")
|
success_message = _('Password changed successfully.')
|
||||||
|
|
||||||
def get_form_kwargs(self):
|
def get_form_kwargs(self):
|
||||||
"""Make the user object available to the form"""
|
"""Make the user object available to the form"""
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user