mirror of https://github.com/snachodog/mybuddy.git
Add staff and active settings for users.
This commit is contained in:
parent
b34cc6aee8
commit
29e2a4af20
|
@ -11,13 +11,15 @@ from .models import Settings
|
||||||
class UserAddForm(UserCreationForm):
|
class UserAddForm(UserCreationForm):
|
||||||
class Meta:
|
class Meta:
|
||||||
model = User
|
model = User
|
||||||
fields = ['username', 'first_name', 'last_name', 'email']
|
fields = ['username', 'first_name', 'last_name', 'email',
|
||||||
|
'is_staff', 'is_active']
|
||||||
|
|
||||||
|
|
||||||
class UserUpdateForm(forms.ModelForm):
|
class UserUpdateForm(forms.ModelForm):
|
||||||
class Meta:
|
class Meta:
|
||||||
model = User
|
model = User
|
||||||
fields = ['username', 'first_name', 'last_name', 'email']
|
fields = ['username', 'first_name', 'last_name', 'email',
|
||||||
|
'is_staff', 'is_active']
|
||||||
|
|
||||||
|
|
||||||
class UserForm(forms.ModelForm):
|
class UserForm(forms.ModelForm):
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{% extends 'babybuddy/page.html' %}
|
{% extends 'babybuddy/page.html' %}
|
||||||
{% load widget_tweaks static thumbnail %}
|
{% load bootstrap widget_tweaks %}
|
||||||
|
|
||||||
{% block title %}Users{% endblock %}
|
{% block title %}Users{% endblock %}
|
||||||
|
|
||||||
|
@ -18,6 +18,8 @@
|
||||||
<th>First Name</th>
|
<th>First Name</th>
|
||||||
<th>Last Name</th>
|
<th>Last Name</th>
|
||||||
<th>Email</th>
|
<th>Email</th>
|
||||||
|
<th>Staff</th>
|
||||||
|
<th>Active</th>
|
||||||
<th class="text-center">Actions</th>
|
<th class="text-center">Actions</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
|
@ -28,6 +30,8 @@
|
||||||
<td>{{ object.first_name }}</td>
|
<td>{{ object.first_name }}</td>
|
||||||
<td>{{ object.last_name }}</td>
|
<td>{{ object.last_name }}</td>
|
||||||
<td>{{ object.email }}</td>
|
<td>{{ object.email }}</td>
|
||||||
|
<td>{{ object.is_staff|bool_icon }}</td>
|
||||||
|
<td>{{ object.is_active|bool_icon }}</td>
|
||||||
<td class="text-center">
|
<td class="text-center">
|
||||||
<div class="btn-group btn-group-sm" role="group" aria-label="Actions">
|
<div class="btn-group btn-group-sm" role="group" aria-label="Actions">
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue