8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-11-25 04:43:10 +00:00

Fix form topologie (new stack + affichage stack)

La création réussie d'une stack redirect sur la liste des stack et ne
renvoie pas sur le formulaire de création
La stack s'affichae même si il n'y a aucune interface liée
This commit is contained in:
Maël Kervella 2017-10-13 23:36:04 +00:00
parent e619e5a31c
commit 95c32b464e
2 changed files with 51 additions and 28 deletions

View file

@ -30,32 +30,53 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<th>Details</th> <th>Details</th>
<th>Membres</th> <th>Membres</th>
</tr> </tr>
</thead> </thead>
{% for stack in stack_list %} {% for stack in stack_list %}
{% for switch in stack.switch_set.all %} {% for switch in stack.switch_set.all %}
<tr class="active"> <tbody>
{% if forloop.first %} <tr class="active">
<td rowspan="{{ stack.switch_set.all|length }}">{{stack.name}}</td> {% if forloop.first %}
<td rowspan="{{ stack.switch_set.all|length }}">{{stack.stack_id}}</td> <td rowspan="{{ stack.switch_set.all|length }}">{{stack.name}}</td>
<td rowspan="{{ stack.switch_set.all|length }}" >{{stack.details}}</td> <td rowspan="{{ stack.switch_set.all|length }}">{{stack.stack_id}}</td>
{% endif %} <td rowspan="{{ stack.switch_set.all|length }}" >{{stack.details}}</td>
<td><a href="{% url 'topologie:index-port' switch.pk %}">{{switch}}</a></td> {% endif %}
{% if forloop.first %} <td><a href="{% url 'topologie:index-port' switch.pk %}">{{switch}}</a></td>
<td rowspan="{{ stack.switch_set.all|length }}"> {% if forloop.first %}
<a class="btn btn-info btn-sm" role="button" title="Historique" href="{% url 'topologie:history' 'stack' stack.pk %}"> <td rowspan="{{ stack.switch_set.all|length }}">
<i class="glyphicon glyphicon-time"></i> <a class="btn btn-info btn-sm" role="button" title="Historique" href="{% url 'topologie:history' 'stack' stack.pk %}">
</a> <i class="glyphicon glyphicon-time"></i>
{% if is_infra %} </a>
<a class="btn btn-primary btn-sm" role="button" title="Éditer" href="{% url 'topologie:edit-stack' stack.id %}"> {% if is_infra %}
<i class="glyphicon glyphicon-edit"></i> <a class="btn btn-primary btn-sm" role="button" title="Éditer" href="{% url 'topologie:edit-stack' stack.id %}">
</a> <i class="glyphicon glyphicon-edit"></i>
<a class="btn btn-danger btn-sm" role="button" title="Supprimer" href="{% url 'topologie:del-stack' stack.pk %}"> </a>
<i class="glyphicon glyphicon-trash"></i> <a class="btn btn-danger btn-sm" role="button" title="Supprimer" href="{% url 'topologie:del-stack' stack.pk %}">
</a> <i class="glyphicon glyphicon-trash"></i>
{% endif %} </a>
</td> {% endif %}
{% endif %} </td>
</tr> {% endif %}
{% endfor %} </tr>
{% endfor %} {% empty %}
<tr class="active">
<td>{{stack.name}}</td>
<td>{{stack.stack_id}}</td>
<td>{{stack.details}}</td>
<td>Aucun</td>
<td>
<a class="btn btn-info btn-sm" role="button" title="Historique" href="{% url 'topologie:history' 'stack' stack.pk %}">
<i class="glyphicon glyphicon-time"></i>
</a>
{% if is_infra %}
<a class="btn btn-primary btn-sm" role="button" title="Éditer" href="{% url 'topologie:edit-stack' stack.id %}">
<i class="glyphicon glyphicon-edit"></i>
</a>
<a class="btn btn-danger btn-sm" role="button" title="Supprimer" href="{% url 'topologie:del-stack' stack.pk %}">
<i class="glyphicon glyphicon-trash"></i>
</a>
{% endif %}
</td>
{% endfor %}
</tbody>
{% endfor %}
</table> </table>

View file

@ -211,6 +211,8 @@ def new_stack(request):
messages.success(request, "Stack crée") messages.success(request, "Stack crée")
except: except:
messages.error(request, "Cette stack existe déjà") messages.error(request, "Cette stack existe déjà")
else:
return redirect('/topologie/index_stack')
return form({'topoform':stack}, 'topologie/topo.html', request) return form({'topoform':stack}, 'topologie/topo.html', request)