Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
intranet
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
2
Issues
2
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nounous-archives
intranet
Commits
2c3a1494
Commit
2c3a1494
authored
Dec 03, 2015
by
Lucas Serrano
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[wifimap] Form un peu moins moche
parent
61c48e9e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
30 deletions
+43
-30
wifimap/forms.py
wifimap/forms.py
+2
-2
wifimap/templates/wifimap/change_conf.html
wifimap/templates/wifimap/change_conf.html
+41
-28
No files found.
wifimap/forms.py
View file @
2c3a1494
...
...
@@ -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
)
wifimap/templates/wifimap/change_conf.html
View file @
2c3a1494
...
...
@@ -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 %}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment