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
a2e03538
Commit
a2e03538
authored
Oct 26, 2017
by
Gabriel Detraz
Committed by
root
Oct 26, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Gentil paginateur
parent
315560ba
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
0 deletions
+17
-0
topologie/templates/topologie/aff_switch.html
topologie/templates/topologie/aff_switch.html
+4
-0
topologie/templates/topologie/index.html
topologie/templates/topologie/index.html
+1
-0
topologie/views.py
topologie/views.py
+12
-0
No files found.
topologie/templates/topologie/aff_switch.html
View file @
a2e03538
...
@@ -22,6 +22,10 @@ with this program; if not, write to the Free Software Foundation, Inc.,
...
@@ -22,6 +22,10 @@ with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
{% endcomment %}
{% endcomment %}
{% if switch_list.paginator %}
{% include "pagination.html" with list=switch_list %}
{% endif %}
<table
class=
"table table-striped"
>
<table
class=
"table table-striped"
>
<thead>
<thead>
<tr>
<tr>
...
...
topologie/templates/topologie/index.html
View file @
a2e03538
...
@@ -31,6 +31,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
...
@@ -31,6 +31,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<h2>
Switchs
</h2>
<h2>
Switchs
</h2>
{% if is_infra %}
{% if is_infra %}
<a
class=
"btn btn-primary btn-sm"
role=
"button"
href=
"{% url 'topologie:new-switch' %}"
><i
class=
"glyphicon glyphicon-plus"
></i>
Ajouter un switch
</a>
<a
class=
"btn btn-primary btn-sm"
role=
"button"
href=
"{% url 'topologie:new-switch' %}"
><i
class=
"glyphicon glyphicon-plus"
></i>
Ajouter un switch
</a>
<hr>
{% endif %}
{% endif %}
{% include "topologie/aff_switch.html" with switch_list=switch_list %}
{% include "topologie/aff_switch.html" with switch_list=switch_list %}
<br
/>
<br
/>
...
...
topologie/views.py
View file @
a2e03538
...
@@ -89,6 +89,18 @@ def index(request):
...
@@ -89,6 +89,18 @@ def index(request):
request
.
GET
.
get
(
'order'
),
request
.
GET
.
get
(
'order'
),
SortTable
.
TOPOLOGIE_INDEX
SortTable
.
TOPOLOGIE_INDEX
)
)
options
,
_created
=
GeneralOption
.
objects
.
get_or_create
()
pagination_number
=
options
.
pagination_number
paginator
=
Paginator
(
switch_list
,
pagination_number
)
page
=
request
.
GET
.
get
(
'page'
)
try
:
switch_list
=
paginator
.
page
(
page
)
except
PageNotAnInteger
:
# If page is not an integer, deliver first page.
switch_list
=
paginator
.
page
(
1
)
except
EmptyPage
:
# If page is out of range (e.g. 9999), deliver last page of results.
switch_list
=
paginator
.
page
(
paginator
.
num_pages
)
return
render
(
request
,
'topologie/index.html'
,
{
return
render
(
request
,
'topologie/index.html'
,
{
'switch_list'
:
switch_list
'switch_list'
:
switch_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