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
R
re2o
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Nounous
re2o
Commits
e924e919
Commit
e924e919
authored
Apr 10, 2018
by
Maël Kervella
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move Building and SwitchBay infos on the Stack info page
parent
33a75494
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
60 additions
and
51 deletions
+60
-51
topologie/templates/topologie/index_model_switch.html
topologie/templates/topologie/index_model_switch.html
+17
-27
topologie/templates/topologie/index_stack.html
topologie/templates/topologie/index_stack.html
+24
-7
topologie/views.py
topologie/views.py
+19
-17
No files found.
topologie/templates/topologie/index_model_switch.html
View file @
e924e919
...
...
@@ -29,31 +29,21 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% block title %}Modèles de switches{% endblock %}
{% block content %}
<h2>
Modèles de switches
</h2>
{% can_create ModelSwitch %}
<a
class=
"btn btn-primary btn-sm"
role=
"button"
href=
"{% url 'topologie:new-model-switch' %}"
><i
class=
"fa fa-plus"
></i>
Ajouter un modèle
</a>
<hr>
{% acl_end %}
{% include "topologie/aff_model_switch.html" with model_switch_list=model_switch_list %}
<h2>
Constructeurs de switches
</h2>
{% can_create ConstructorSwitch %}
<a
class=
"btn btn-primary btn-sm"
role=
"button"
href=
"{% url 'topologie:new-constructor-switch' %}"
><i
class=
"fa fa-plus"
></i>
Ajouter un constructeur
</a>
<hr>
{% acl_end %}
{% include "topologie/aff_constructor_switch.html" with constructor_switch_list=constructor_switch_list %}
<h2>
Baie de brassage
</h2>
{% can_create SwitchBay %}
<a
class=
"btn btn-primary btn-sm"
role=
"button"
href=
"{% url 'topologie:new-switch-bay' %}"
><i
class=
"fa fa-plus"
></i>
Ajouter une baie de brassage
</a>
<hr>
{% acl_end %}
{% include "topologie/aff_switch_bay.html" with switch_bay_list=switch_bay_list %}
<h2>
Batiment
</h2>
{% can_create Building %}
<a
class=
"btn btn-primary btn-sm"
role=
"button"
href=
"{% url 'topologie:new-building' %}"
><i
class=
"fa fa-plus"
></i>
Ajouter un bâtiment
</a>
<hr>
{% acl_end %}
{% include "topologie/aff_building.html" with building_list=building_list %}
<br
/>
<br
/>
<br
/>
<h2>
Modèles de switches
</h2>
{% can_create ModelSwitch %}
<a
class=
"btn btn-primary btn-sm"
role=
"button"
href=
"{% url 'topologie:new-model-switch' %}"
>
<i
class=
"fa fa-plus"
></i>
Ajouter un modèle
</a>
<hr>
{% acl_end %}
{% include "topologie/aff_model_switch.html" with model_switch_list=model_switch_list %}
<h2>
Constructeurs de switches
</h2>
{% can_create ConstructorSwitch %}
<a
class=
"btn btn-primary btn-sm"
role=
"button"
href=
"{% url 'topologie:new-constructor-switch' %}"
>
<i
class=
"fa fa-plus"
></i>
Ajouter un constructeur
</a>
<hr>
{% acl_end %}
{% include "topologie/aff_constructor_switch.html" with constructor_switch_list=constructor_switch_list %}
{% endblock %}
topologie/templates/topologie/index_stack.html
View file @
e924e919
...
...
@@ -29,12 +29,29 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% block title %}Stacks{% endblock %}
{% block content %}
<h2>
Stacks
</h2>
{% can_create Stack %}
<a
class=
"btn btn-primary btn-sm"
role=
"button"
href=
"{% url 'topologie:new-stack' %}"
><i
class=
"fa fa-plus"
></i>
Ajouter une stack
</a>
{% acl_end %}
<h2>
Stacks
</h2>
{% can_create Stack %}
<a
class=
"btn btn-primary btn-sm"
role=
"button"
href=
"{% url 'topologie:new-stack' %}"
>
<i
class=
"fa fa-plus"
></i>
Ajouter une stack
</a>
{% acl_end %}
{% include "topologie/aff_stacks.html" with stack_list=stack_list %}
<br
/>
<br
/>
<br
/>
<h2>
Baie de brassage
</h2>
{% can_create SwitchBay %}
<a
class=
"btn btn-primary btn-sm"
role=
"button"
href=
"{% url 'topologie:new-switch-bay' %}"
>
<i
class=
"fa fa-plus"
></i>
Ajouter une baie de brassage
</a>
<hr>
{% acl_end %}
{% include "topologie/aff_switch_bay.html" with switch_bay_list=switch_bay_list %}
<h2>
Batiment
</h2>
{% can_create Building %}
<a
class=
"btn btn-primary btn-sm"
role=
"button"
href=
"{% url 'topologie:new-building' %}"
>
<i
class=
"fa fa-plus"
></i>
Ajouter un bâtiment
</a>
<hr>
{% acl_end %}
{% include "topologie/aff_building.html" with building_list=building_list %}
{% endblock %}
topologie/views.py
View file @
e924e919
...
...
@@ -182,18 +182,36 @@ def index_ap(request):
@
login_required
@
can_view_all
(
Stack
)
@
can_view_all
(
Building
)
@
can_view_all
(
SwitchBay
)
def
index_stack
(
request
):
"""Affichage de la liste des stacks (affiche l'ensemble des switches)"""
stack_list
=
Stack
.
objects
\
.
prefetch_related
(
'switch_set__interface_set__domain__extension'
)
building_list
=
Building
.
objects
.
all
()
switch_bay_list
=
SwitchBay
.
objects
.
select_related
(
'building'
)
stack_list
=
SortTable
.
sort
(
stack_list
,
request
.
GET
.
get
(
'col'
),
request
.
GET
.
get
(
'order'
),
SortTable
.
TOPOLOGIE_INDEX_STACK
)
building_list
=
SortTable
.
sort
(
building_list
,
request
.
GET
.
get
(
'col'
),
request
.
GET
.
get
(
'order'
),
SortTable
.
TOPOLOGIE_INDEX_BUILDING
)
switch_bay_list
=
SortTable
.
sort
(
switch_bay_list
,
request
.
GET
.
get
(
'col'
),
request
.
GET
.
get
(
'order'
),
SortTable
.
TOPOLOGIE_INDEX_SWITCH_BAY
)
return
render
(
request
,
'topologie/index_stack.html'
,
{
'stack_list'
:
stack_list
'stack_list'
:
stack_list
,
'switch_bay_list'
:
switch_bay_list
,
'building_list'
:
building_list
,
})
...
...
@@ -204,8 +222,6 @@ def index_model_switch(request):
""" Affichage de l'ensemble des modèles de switches"""
model_switch_list
=
ModelSwitch
.
objects
.
select_related
(
'constructor'
)
constructor_switch_list
=
ConstructorSwitch
.
objects
switch_bay_list
=
SwitchBay
.
objects
.
select_related
(
'building'
)
building_list
=
Building
.
objects
.
all
()
model_switch_list
=
SortTable
.
sort
(
model_switch_list
,
request
.
GET
.
get
(
'col'
),
...
...
@@ -218,23 +234,9 @@ def index_model_switch(request):
request
.
GET
.
get
(
'order'
),
SortTable
.
TOPOLOGIE_INDEX_CONSTRUCTOR_SWITCH
)
building_list
=
SortTable
.
sort
(
building_list
,
request
.
GET
.
get
(
'col'
),
request
.
GET
.
get
(
'order'
),
SortTable
.
TOPOLOGIE_INDEX_BUILDING
)
switch_bay_list
=
SortTable
.
sort
(
switch_bay_list
,
request
.
GET
.
get
(
'col'
),
request
.
GET
.
get
(
'order'
),
SortTable
.
TOPOLOGIE_INDEX_SWITCH_BAY
)
return
render
(
request
,
'topologie/index_model_switch.html'
,
{
'model_switch_list'
:
model_switch_list
,
'constructor_switch_list'
:
constructor_switch_list
,
'switch_bay_list'
:
switch_bay_list
,
'building_list'
:
building_list
,
})
...
...
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