mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-12-28 01:43:46 +00:00
Bricoles d'affichage
This commit is contained in:
parent
ca2e0172a1
commit
c12b3575dd
5 changed files with 68 additions and 6 deletions
|
@ -28,6 +28,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
<th>Clef</th>
|
||||
<th>Commentaire</th>
|
||||
<th>Clef par default des switchs</th>
|
||||
<th>Clef utilisée par les switchs</th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
|
@ -37,10 +38,16 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
<td>{{ radiuskey.radius_key }}</td>
|
||||
<td>{{ radiuskey.comment }}</td>
|
||||
<td>{{ radiuskey.default_switch }}</td>
|
||||
<td>{{ radiuskey.switch_set.all|join:", " }}</td>
|
||||
<td class="text-right">
|
||||
{% can_edit radiuskey %}
|
||||
{% include 'buttons/edit.html' with href='preferences:edit-radiuskey' id=radiuskey.id %}
|
||||
{% acl_end %}
|
||||
{% can_delete radiuskey %}
|
||||
<a class="btn btn-danger btn-sm" role="button" title="Supprimer" href="{% url 'preferences:del-radiuskey' radiuskey.pk %}">
|
||||
<i class="fa fa-trash"></i>
|
||||
</a>
|
||||
{% acl_end %}
|
||||
{% include 'buttons/history.html' with href='preferences:history' name='radiuskey' id=radiuskey.id %}
|
||||
</td>
|
||||
</tr>
|
||||
|
|
|
@ -27,6 +27,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
<tr>
|
||||
<th>Identifiant</th>
|
||||
<th>Creds par default des switchs</th>
|
||||
<th>Utilisé pour les switchs</th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
|
@ -35,10 +36,16 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
<tr>
|
||||
<td>{{ switchmanagementcred.management_id }}</td>
|
||||
<td>{{ switchmanagementcred.default_switch }}</td>
|
||||
<td>{{ switchmanagementcred.switch_set.all|join:", " }}</td>
|
||||
<td class="text-right">
|
||||
{% can_edit switchmanagementcred %}
|
||||
{% include 'buttons/edit.html' with href='preferences:edit-switchmanagementcred' id=switchmanagementcred.id %}
|
||||
{% acl_end %}
|
||||
{% can_delete switchmanagementcred %}
|
||||
<a class="btn btn-danger btn-sm" role="button" title="Supprimer" href="{% url 'preferences:del-switchmanagementcred' switchmanagementcred.pk %}">
|
||||
<i class="fa fa-trash"></i>
|
||||
</a>
|
||||
{% acl_end %}
|
||||
{% include 'buttons/history.html' with href='preferences:history' name='switchmanagementcred' id=switchmanagementcred.id %}
|
||||
</td>
|
||||
</tr>
|
||||
|
|
40
preferences/templates/preferences/delete.html
Normal file
40
preferences/templates/preferences/delete.html
Normal file
|
@ -0,0 +1,40 @@
|
|||
{% extends "topologie/sidebar.html" %}
|
||||
{% comment %}
|
||||
Re2o est un logiciel d'administration développé initiallement au rezometz. Il
|
||||
se veut agnostique au réseau considéré, de manière à être installable en
|
||||
quelques clics.
|
||||
|
||||
Copyright © 2017 Gabriel Détraz
|
||||
Copyright © 2017 Goulven Kermarec
|
||||
Copyright © 2017 Augustin Lemesle
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
{% endcomment %}
|
||||
|
||||
{% load bootstrap3 %}
|
||||
|
||||
{% block title %}Création et modification de machines{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<form class="form" method="post">
|
||||
{% csrf_token %}
|
||||
<h4>Attention, voulez-vous vraiment supprimer cet objet {{ objet_name }} ( {{ objet }} ) ?</h4>
|
||||
{% bootstrap_button "Confirmer" button_type="submit" icon="trash" %}
|
||||
</form>
|
||||
<br />
|
||||
<br />
|
||||
<br />
|
||||
{% endblock %}
|
|
@ -93,13 +93,13 @@ urlpatterns = [
|
|||
views.edit_radiuskey,
|
||||
name='edit-radiuskey'
|
||||
),
|
||||
url(r'^del_radiuskey/$', views.del_radiuskey, name='del-radiuskey'),
|
||||
url(r'^del_radiuskey/(?P<radiuskeyid>[0-9]+)$', views.del_radiuskey, name='del-radiuskey'),
|
||||
url(r'^add_switchmanagementcred/$', views.add_switchmanagementcred, name='add-switchmanagementcred'),
|
||||
url(
|
||||
r'^edit_switchmanagementcred/(?P<switchmanagementcredid>[0-9]+)$',
|
||||
views.edit_switchmanagementcred,
|
||||
name='edit-switchmanagementcred'
|
||||
),
|
||||
url(r'^del_switchmanagementcred/$', views.del_switchmanagementcred, name='del-switchmanagementcred'),
|
||||
url(r'^del_switchmanagementcred/(?P<switchmanagementcredid>[0-9]+)$', views.del_switchmanagementcred, name='del-switchmanagementcred'),
|
||||
url(r'^$', views.display_options, name='display-options'),
|
||||
]
|
||||
|
|
|
@ -261,8 +261,12 @@ def edit_radiuskey(request, radiuskey_instance, **_kwargs):
|
|||
def del_radiuskey(request, radiuskey_instance, **_kwargs):
|
||||
"""Destruction d'un radiuskey"""
|
||||
if request.method == "POST":
|
||||
radiuskey_instance.delete()
|
||||
messages.success(request, "La radiuskey a été détruite")
|
||||
try:
|
||||
radiuskey_instance.delete()
|
||||
messages.success(request, "La radiuskey a été détruite")
|
||||
except ProtectedError:
|
||||
messages.error(request, "Erreur la\
|
||||
clef ne peut être supprimé, elle est affectée à des switchs")
|
||||
return redirect(reverse('preferences:display-options'))
|
||||
return form(
|
||||
{'objet': radiuskey_instance, 'objet_name': 'radiuskey'},
|
||||
|
@ -306,8 +310,12 @@ def edit_switchmanagementcred(request, switchmanagementcred_instance, **_kwargs)
|
|||
def del_switchmanagementcred(request, switchmanagementcred_instance, **_kwargs):
|
||||
"""Destruction d'un switchmanagementcred"""
|
||||
if request.method == "POST":
|
||||
switchmanagementcred_instance.delete()
|
||||
messages.success(request, "Ce switchmanagementcred a été détruit")
|
||||
try:
|
||||
switchmanagementcred_instance.delete()
|
||||
messages.success(request, "Ces creds ont été détruits")
|
||||
except ProtectedError:
|
||||
messages.error(request, "Erreur ces\
|
||||
creds ne peuvent être supprimés, ils sont affectés à des switchs")
|
||||
return redirect(reverse('preferences:display-options'))
|
||||
return form(
|
||||
{'objet': switchmanagementcred_instance, 'objet_name': 'switchmanagementcred'},
|
||||
|
|
Loading…
Reference in a new issue