Commit 54711698 authored by Gabriel Detraz's avatar Gabriel Detraz Committed by root

Formatage et nettoyage du formulaire switch

parent a2e03538
...@@ -125,7 +125,8 @@ class NewSwitchForm(ModelForm): ...@@ -125,7 +125,8 @@ class NewSwitchForm(ModelForm):
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
prefix = kwargs.pop('prefix', self.Meta.model.__name__) prefix = kwargs.pop('prefix', self.Meta.model.__name__)
super(NewSwitchForm, self).__init__(*args, prefix=prefix, **kwargs) super(NewSwitchForm, self).__init__(*args, prefix=prefix, **kwargs)
self.fields['location'].label = 'Localisation'
self.fields['number'].label = 'Nombre de ports'
class EditRoomForm(ModelForm): class EditRoomForm(ModelForm):
"""Permet d'éediter le nom et commentaire d'une prise murale""" """Permet d'éediter le nom et commentaire d'une prise murale"""
......
...@@ -47,12 +47,15 @@ with this program; if not, write to the Free Software Foundation, Inc., ...@@ -47,12 +47,15 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<form class="form" method="post"> <form class="form" method="post">
{% csrf_token %} {% csrf_token %}
{% if topoform %} {% if topoform %}
<h3>Réglage spécifiques du switch</h3>
{% massive_bootstrap_form topoform 'switch_interface' %} {% massive_bootstrap_form topoform 'switch_interface' %}
{% endif %} {% endif %}
{% if machineform %} {% if machineform %}
<h3>Réglages généraux de la machine associée au switch</h3>
{% massive_bootstrap_form machineform 'user' %} {% massive_bootstrap_form machineform 'user' %}
{% endif %} {% endif %}
{% if interfaceform %} {% if interfaceform %}
<h3>Réglages généraux de l'interface associée au switch</h3>
{% if i_mbf_param %} {% if i_mbf_param %}
{% massive_bootstrap_form interfaceform 'ipv4,machine' mbf_param=i_mbf_param %} {% massive_bootstrap_form interfaceform 'ipv4,machine' mbf_param=i_mbf_param %}
{% else %} {% else %}
...@@ -60,6 +63,7 @@ with this program; if not, write to the Free Software Foundation, Inc., ...@@ -60,6 +63,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% endif %} {% endif %}
{% endif %} {% endif %}
{% if domainform %} {% if domainform %}
<h3>Nom de la machine</h3>
{% bootstrap_form domainform %} {% bootstrap_form domainform %}
{% endif %} {% endif %}
{% bootstrap_button "Créer ou modifier" button_type="submit" icon="ok" %} {% bootstrap_button "Créer ou modifier" button_type="submit" icon="ok" %}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment