From 5471169827aa2c98c31b3deda69b6c3f4ec1dc60 Mon Sep 17 00:00:00 2001 From: Gabriel Detraz Date: Thu, 26 Oct 2017 18:54:38 +0200 Subject: [PATCH] Formatage et nettoyage du formulaire switch --- topologie/forms.py | 3 ++- topologie/templates/topologie/switch.html | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/topologie/forms.py b/topologie/forms.py index 3ad2e7be..a325c0f9 100644 --- a/topologie/forms.py +++ b/topologie/forms.py @@ -125,7 +125,8 @@ class NewSwitchForm(ModelForm): def __init__(self, *args, **kwargs): prefix = kwargs.pop('prefix', self.Meta.model.__name__) super(NewSwitchForm, self).__init__(*args, prefix=prefix, **kwargs) - + self.fields['location'].label = 'Localisation' + self.fields['number'].label = 'Nombre de ports' class EditRoomForm(ModelForm): """Permet d'éediter le nom et commentaire d'une prise murale""" diff --git a/topologie/templates/topologie/switch.html b/topologie/templates/topologie/switch.html index e87570c4..1753161e 100644 --- a/topologie/templates/topologie/switch.html +++ b/topologie/templates/topologie/switch.html @@ -47,12 +47,15 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% csrf_token %} {% if topoform %} +

Réglage spécifiques du switch

{% massive_bootstrap_form topoform 'switch_interface' %} {% endif %} {% if machineform %} +

Réglages généraux de la machine associée au switch

{% massive_bootstrap_form machineform 'user' %} {% endif %} {% if interfaceform %} +

Réglages généraux de l'interface associée au switch

{% if i_mbf_param %} {% massive_bootstrap_form interfaceform 'ipv4,machine' mbf_param=i_mbf_param %} {% else %} @@ -60,6 +63,7 @@ with this program; if not, write to the Free Software Foundation, Inc., {% endif %} {% endif %} {% if domainform %} +

Nom de la machine

{% bootstrap_form domainform %} {% endif %} {% bootstrap_button "Créer ou modifier" button_type="submit" icon="ok" %}