From 5624247487c4f2564a37cab75156706002805d4c Mon Sep 17 00:00:00 2001 From: Gabriel Detraz Date: Mon, 16 Apr 2018 06:54:34 +0200 Subject: [PATCH] Fix #104 --- topologie/templates/topologie/aff_stacks.html | 79 ++++++------------- .../templates/topologie/aff_switch_bay.html | 2 +- topologie/views.py | 3 +- 3 files changed, 29 insertions(+), 55 deletions(-) diff --git a/topologie/templates/topologie/aff_stacks.html b/topologie/templates/topologie/aff_stacks.html index def83036..969c1075 100644 --- a/topologie/templates/topologie/aff_stacks.html +++ b/topologie/templates/topologie/aff_stacks.html @@ -31,58 +31,31 @@ with this program; if not, write to the Free Software Foundation, Inc., {% include "buttons/sort.html" with prefix='stack' col='id' text='ID' %} Détails Membres + - - {% for stack in stack_list %} - {% for switch in stack.switch_set.all %} - - - {% if forloop.first %} - {{stack.name}} - {{stack.stack_id}} - {{stack.details}} - {% endif %} - {{switch}} - {% if forloop.first %} - - - - - {% can_edit stack %} - - - - {% acl_end %} - {% can_delete stack %} - - - - {% acl_end %} - - {% endif %} - - {% empty %} - - {{stack.name}} - {{stack.stack_id}} - {{stack.details}} - Aucun - - - - - {% can_edit stack %} - - - - {% acl_end %} - {% can_delete stack %} - - - - {% acl_end %} - - {% endfor %} - - {% endfor %} + + {% for stack in stack_list %} + + {{ stack.name }} + {{stack.stack_id}} + {{stack.details}} + {% for switch in stack.switch_set.all %}{{switch }} {% endfor %} + + + + + {% can_edit stack %} + + + + {% acl_end %} + {% can_delete stack %} + + + + {% acl_end %} + + + {% endfor %} + diff --git a/topologie/templates/topologie/aff_switch_bay.html b/topologie/templates/topologie/aff_switch_bay.html index e8d11c60..3d1ee3b3 100644 --- a/topologie/templates/topologie/aff_switch_bay.html +++ b/topologie/templates/topologie/aff_switch_bay.html @@ -43,7 +43,7 @@ with this program; if not, write to the Free Software Foundation, Inc., {{switch_bay.name}} {{switch_bay.building}} {{switch_bay.info}} - {{switch_bay.switch_set.all |join:", "}} + {% for switch in switch_bay.switch_set.all %}{{switch }} {% endfor %} diff --git a/topologie/views.py b/topologie/views.py index 5e7144c3..283f4ffe 100644 --- a/topologie/views.py +++ b/topologie/views.py @@ -352,6 +352,7 @@ def new_stack(request): if stack.is_valid(): stack.save() messages.success(request, "Stack crée") + return redirect(reverse('topologie:index-physical-grouping')) return form( {'topoform': stack, 'action_name': 'Créer'}, 'topologie/topo.html', @@ -367,7 +368,7 @@ def edit_stack(request, stack, **_kwargs): if stack.is_valid(): if stack.changed_data: stack.save() - return redirect(reverse('topologie:index-physical-grouping')) + return redirect(reverse('topologie:index-physical-grouping')) return form( {'topoform': stack, 'action_name': 'Editer'}, 'topologie/topo.html',