From 714486ff2f4117cbbeee947d60012e1e583b5b31 Mon Sep 17 00:00:00 2001 From: guimoz Date: Sat, 19 Aug 2017 01:16:51 +0200 Subject: [PATCH] =?UTF-8?q?Debut=20de=20la=20cr=C3=A9ation=20de=20la=20pag?= =?UTF-8?q?e=20de=20gestion=20en=20masse=20des=20stacks?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- topologie/forms.py | 1 + .../templates/topologie/edit_stack_sw.html | 53 +++++++++++++++++++ topologie/views.py | 17 ++++++ 3 files changed, 71 insertions(+) create mode 100644 topologie/templates/topologie/edit_stack_sw.html diff --git a/topologie/forms.py b/topologie/forms.py index 0a13d8c8..c2227e5d 100644 --- a/topologie/forms.py +++ b/topologie/forms.py @@ -65,3 +65,4 @@ class EditRoomForm(ModelForm): class Meta: model = Room fields = '__all__' + diff --git a/topologie/templates/topologie/edit_stack_sw.html b/topologie/templates/topologie/edit_stack_sw.html new file mode 100644 index 00000000..e4ca286d --- /dev/null +++ b/topologie/templates/topologie/edit_stack_sw.html @@ -0,0 +1,53 @@ +{% 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 %} + + + + + + + + + + {% for stack in stack_list %} + + + + + + + {% endfor %} +
StackIDDetails
{{stack.name}}{{stack.stack_id}}{{stack.details}} + + + + {% if is_infra %} + + + + + + + {% endif %} +
diff --git a/topologie/views.py b/topologie/views.py index 2c1b7513..7ed647b6 100644 --- a/topologie/views.py +++ b/topologie/views.py @@ -210,6 +210,23 @@ def del_stack(request,stack_id): return redirect('/topologie/index_stack') return form({'objet':stack}, 'topologie/delete.html', request) +@login_required +@permission_required('infra') +def edit_switchs_stack(request,stack_id): + try: + stack = Stack.objects.get(pk=stack_id) + except Stack.DoesNotExist: + messages.error(request, u"Stack inexistante") + return redirect('/topologie/index_stack') + if request.method == "POST": + pass + else: + context = {'stack': stack} + context['switchs_stack'] = stack.switchs_set.all() + context['switchs_autres'] = Switch.object.filter(stack=None) + pass + + @login_required @permission_required('infra') def new_switch(request):