8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-12-25 08:23:46 +00:00

Added a button to navigate between the list of a switch's ports and edition forms, issue #50.

This commit is contained in:
Laouen Fernet 2017-12-15 01:49:05 +01:00 committed by root
parent a5f4ff9375
commit 6db6f88e5a
3 changed files with 12 additions and 5 deletions

View file

@ -44,6 +44,9 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% if id_switch %}
<a class="btn btn-primary" href="{% url "topologie:index-port" id_switch %}" role="button">{% bootstrap_icon "list" %} Aller à la liste des ports</a>
{% endif %}
<form class="form" method="post"> <form class="form" method="post">
{% csrf_token %} {% csrf_token %}
{% if topoform %} {% if topoform %}

View file

@ -26,11 +26,14 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% load bootstrap3 %} {% load bootstrap3 %}
{% load massive_bootstrap_form %} {% load massive_bootstrap_form %}
{% block title %}Création et modificationd 'utilisateur{% endblock %} {% block title %}Modification de la topologie{% endblock %}
{% block content %} {% block content %}
{% bootstrap_form_errors topoform %} {% bootstrap_form_errors topoform %}
{% if id_switch %}
<a class="btn btn-primary" href="{% url "topologie:index-port" id_switch %}" role="button">{% bootstrap_icon "list" %} Aller à la liste des ports</a>
{% endif %}
<form class="form" method="post"> <form class="form" method="post">
{% csrf_token %} {% csrf_token %}
{% massive_bootstrap_form topoform 'room,related,machine_interface' %} {% massive_bootstrap_form topoform 'room,related,machine_interface' %}

View file

@ -295,7 +295,7 @@ def new_port(request, switch_id):
'topologie:index-port', 'topologie:index-port',
kwargs={'switch_id':switch_id} kwargs={'switch_id':switch_id}
)) ))
return form({'topoform': port}, 'topologie/topo.html', request) return form({'id_switch': switch_id,'topoform': port}, 'topologie/topo.html', request)
@login_required @login_required
@ -327,7 +327,7 @@ def edit_port(request, port_id):
'topologie:index-port', 'topologie:index-port',
kwargs={'switch_id': str(port_object.switch.id)} kwargs={'switch_id': str(port_object.switch.id)}
)) ))
return form({'topoform': port}, 'topologie/topo.html', request) return form({'id_switch': str(port_object.switch.id), 'topoform': port}, 'topologie/topo.html', request)
@login_required @login_required
@ -524,7 +524,7 @@ def create_ports(request, switch_id):
return redirect("/topologie/switch/" + str(switch.id)) return redirect("/topologie/switch/" + str(switch.id))
return form({'topoform': port_form}, 'topologie/switch.html', request) return form({'id_switch': switch_id, 'topoform': port_form}, 'topologie/switch.html', request)
@login_required @login_required
@ -586,6 +586,7 @@ def edit_switch(request, switch_id):
return redirect(reverse('topologie:index')) return redirect(reverse('topologie:index'))
i_mbf_param = generate_ipv4_mbf_param( interface_form, False ) i_mbf_param = generate_ipv4_mbf_param( interface_form, False )
return form({ return form({
'id_switch': switch_id,
'topoform': switch_form, 'topoform': switch_form,
'machineform': machine_form, 'machineform': machine_form,
'interfaceform': interface_form, 'interfaceform': interface_form,