Commit 0852e418 authored by chirac's avatar chirac
Browse files

Permet l'edition du shell et autres réglages

parent 897c8789
......@@ -12,8 +12,9 @@ De cette manière, il est possible de pluguer très facilement des services dess
Dépendances :
* python3-django (1.8, jessie-backports)
* django-bootstrap3 (pip install)
* python3-dateutil (jessie-backports)
* python3-django-reversion (1.10, stretch)
* django-bootstrap3 (pip3 install)
* django-ldapdb (pip3 install)
Moteur de db conseillé (mysql), postgresql fonctionne également.
Pour mysql, il faut installer :
......
......@@ -44,7 +44,6 @@ INSTALLED_APPS = (
'bootstrap3',
'users',
're2o',
'rest_framework',
'reversion'
)
......
......@@ -355,6 +355,7 @@ class BaseInfoForm(ModelForm):
'pseudo',
'email',
'comment',
'shell',
]
class EditInfoForm(BaseInfoForm):
......
<table class="table table-striped">
<thead>
<tr>
{% for right in right_list %}
<th>{{ right }}</th>
<th></th>
{% endfor %}
</tr>
</thead>
{% for user_right in user_right_list %}
<tr>
<td> {{ user_right }}</td>
</tr>
{% endfor %}
</table>
<form class="form" method="post">
{% csrf_token %}
{% bootstrap_form right_list %}
{% bootstrap_button "Créer ou modifier" button_type="submit" icon="star" %}
</form>
......@@ -21,6 +21,7 @@
<th>Pseudo</th>
<th>Statut</th>
<th>Uid</th>
<th>Mail</th>
<th>Profil</th>
</tr>
</thead>
......@@ -34,8 +35,9 @@
{% else %}
<font color="red">Désactivée</font>
{% endif %}
<td>{{ user.uid_number }}</td>
</td>
<td>{{ user.uid_number }}</td>
<td>{{ user.email }}</td>
<td><a href="{% url "users:profil" user.id%}" class="btn btn-primary btn-sm" role="button"><i class="glyphicon glyphicon-user"></i></a>
</td>
</tr>
......
......@@ -146,13 +146,12 @@ def password(request, userid):
@permission_required('bureau')
def del_right(request):
user_right_list = DelRightForm(request.POST or None)
right_list = ListRight.objects.all()
if user_right_list.is_valid():
right_del = user_right_list.cleaned_data['rights']
right_del.delete()
messages.success(request, "Droit retiré avec succès")
return redirect("/users/")
return form({'user_right_list': user_right_list, 'right_list': right_list}, 'users/index_rights.html', request)
return form({'user_right_list': user_right_list}, 'users/index_rights.html', request)
@login_required
@permission_required('bureau')
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment