Commit 2c3a1494 authored by Lucas Serrano's avatar Lucas Serrano

[wifimap] Form un peu moins moche

parent 61c48e9e
......@@ -5,7 +5,7 @@ from django import forms
from django.forms import widgets
class Wifi_Action(forms.Form):
actions_possibles = forms.ChoiceField(widget=forms.RadioSelect(), label=u'Actions possible sur les bornes ', required=False)
actions_possibles = forms.ChoiceField(label=u'Actions possible sur les bornes ', required=False)
class Wifi_Info(forms.Form):
vlan_select = forms.CharField(label=u'Vlan séléctionné', max_length=40, required=False)
......@@ -15,5 +15,5 @@ class Wifi_Info(forms.Form):
encryption_key = forms.CharField(label=u'Clef de Sécurité Radius', max_length=40, required=False)
class Bornes_Cibles(forms.Form):
batiment = forms.MultipleChoiceField(widget=forms.CheckboxSelectMultiple, label=u'Action à effectuer sur les batiments ', required=False)
batiment = forms.MultipleChoiceField(label=u'Action à effectuer sur les batiments ', required=False)
borne = forms.CharField(label=u'Action sur une borne en particulier ', max_length=40, required=False)
......@@ -2,33 +2,46 @@
{% block title %} Mise à jour de la configuration {% endblock %}
{% block h1 %} Mise à jour de la configuration du parc {% endblock %}
{% block content %}
<div style="text-align: center;">
<div class="wifi_manager">
<table class="wifi_manager">
{% if not option %}
<form action="/wifimap/change_conf" method="post">
{% csrf_token %}
<tr class="no-border"><td>{{ wifi_action.actions_possibles.label_tag }}</td><td> {{ wifi_action.actions_possibles }} {{ wifi_action.actions_possibles.errors }}</td></tr>
<tr><td colspan="2" style="text-align:center;"><input type="submit" value="Valider les changements"></td></tr>
</form>
{% else %}
<form action="/wifimap/change_conf" method="post">
{% csrf_token %}
{% if option = "vlan"%}
<tr class="no-border"><td>Numéro du vlan à ajouter :</td></tr>
<tr class="no-border"><td>{{ wifi_info.label_tag }}</td><td> {{ wifi_info.vlan_select }} {{ wifi_info.vlan_select.errors }}</td></tr>
{% elif option = "ssid_enable" or option = "ssid_disable" %}
<tr class="no-border"><td>Numéro du SSID à activer/desactiver :</td></tr>
<tr class="no-border"><td>{{ wifi_info.label_tag }}</td><td> {{ wifi_info.ssid_name }} {{ wifi_info.ssid_name.errors }}</td></tr>
{% elif option = "ssid"%}
{{ wifi_info }}
{% endif %}
<tr class="no-border"><td>{{ bornes_cibles.batiment.label_tag }}</td><td> {{ bornes_cibles.batiment }} {{ bornes_cibles.batiment.errors }}</td></tr>
<tr class="no-border"><td>{{ bornes_cibles.borne.label_tag }}</td><td> {{ bornes_cibles.borne }} {{ bornes_cibles.borne.errors }}</td></tr>
<tr><td colspan="2" style="text-align:center;"><input type="hidden" value={{ option }} name="option" /><input type="submit" value="Valider définitivement"></td></tr>
</form>
{% endif %}
</table>
<form class="form-full-width" method="post"> {% csrf_token %}
{% if not option %}
{{ wifi_action.actions_possibles.label_tag }}
{{ wifi_action.actions_possibles }}
{{ wifi_action.actions_possibles.errors }}
{% else %}
<div class="row">
<div class="six columns">
{% if option == "vlan" %}
{{ wifi_info.vlan_select.label_tag }}
{{ wifi_info.vlan_select }}
{{ wifi_info.vlan_select.errors }}
{% elif option == "ssid_enable" or option = "ssid_disable" %}
{{ wifi_info.ssid_name.label_tag }}
{{ wifi_info.ssid_name }}
{{ wifi_info.ssid_name.errors }}
{% elif option == "ssid" %}
{{ wifi_info }}
{% endif %}
</div>
</div>
</div>
<div class="row">
<div class="six columns">
{{ bornes_cibles.batiment.label_tag }}
{{ bornes_cibles.batiment }}
{{ bornes_cibles.batiment.errors }}
</div>
<div class="six columns">
{{ bornes_cibles.borne.label_tag }}
{{ bornes_cibles.borne }}
{{ bornes_cibles.borne.errors }}
</div>
</div>
<input type="hidden" value={{ option }} name="option" />
{% endif %}
<footer>
<input type="submit" value="Valider les changements"></td></tr>
</footer>
</form>
{% endblock %}
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