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
4bb831f1
Commit
4bb831f1
authored
Oct 07, 2016
by
Dalahro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Modification du paginateur
Factorisation du machin
parent
b1aecb6f
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
31 additions
and
48 deletions
+31
-48
cotisations/templates/cotisations/aff_cotisations.html
cotisations/templates/cotisations/aff_cotisations.html
+3
-14
machines/models.py
machines/models.py
+1
-1
machines/serializers.py
machines/serializers.py
+1
-1
machines/templates/machines/aff_machines.html
machines/templates/machines/aff_machines.html
+3
-14
machines/urls.py
machines/urls.py
+1
-1
machines/views.py
machines/views.py
+2
-3
templates/pagination.html
templates/pagination.html
+17
-0
users/templates/users/aff_users.html
users/templates/users/aff_users.html
+3
-14
No files found.
cotisations/templates/cotisations/aff_cotisations.html
View file @
4bb831f1
{% if facture_list.paginator %}
<ul
class=
"pagination nav navbar-nav"
>
{% if facture_list.has_previous %}
<li><a
href=
"?page={{ facture_list.previous_page_number }}"
>
Suivantes
</a></li>
{% endif %}
{% for page in facture_list.paginator.page_range %}
<li
class=
"{% if facture_list.number == page %}active{% endif %}"
><a
href=
"?page={{page }}"
>
{{ page }}
</a></li>
{% endfor %}
{% if facture_list.has_next %}
<li>
<a
href=
"?page={{ facture_list.next_page_number }}"
>
Précédentes
</a></li>
{% endif %}
</ul>
{% endif %}
{% if facture_list.paginator %}
{% include "pagination.html" with list=facture_list %}
{% endif %}
<table
class=
"table table-striped"
>
<thead>
...
...
machines/models.py
View file @
4bb831f1
...
...
@@ -66,4 +66,4 @@ def interface_post_save(sender, **kwargs):
@
receiver
(
post_delete
,
sender
=
Interface
)
def
interface_post_delete
(
sender
,
**
kwargs
):
user
=
kwargs
[
'instance'
].
machine
.
user
user
.
ldap_sync
(
base
=
False
,
access_refresh
=
False
,
mac_refresh
=
True
)
#
user.ldap_sync(base=False, access_refresh=False, mac_refresh=True)
machines/serializers.py
View file @
4bb831f1
...
...
@@ -4,7 +4,7 @@ from machines.models import Interface
class
InterfaceSerializer
(
serializers
.
ModelSerializer
):
class
Meta
:
model
=
Interface
fields
=
(
'ipv4'
,
'mac_address'
,
'dns'
)
fields
=
(
'ipv4'
,
'mac_address'
,
'dns'
,
'type'
)
machines/templates/machines/aff_machines.html
View file @
4bb831f1
{% if machines_list.paginator %}
<ul
class=
"pagination nav navbar-nav"
>
{% if machines_list.has_previous %}
<li><a
href=
"?page={{ machines_list.previous_page_number }}"
>
Suivants
</a></li>
{% endif %}
{% for page in machines_list.paginator.page_range %}
<li
class=
"{% if machines_list.number == page %}active{% endif %}"
><a
href=
"?page={{page }}"
>
{{ page }}
</a></li>
{% endfor %}
{% if machines_list.has_next %}
<li>
<a
href=
"?page={{ machines_list.next_page_number }}"
>
Précédents
</a></li>
{% endif %}
</ul>
{% endif %}
{% if machines_list.paginator %}
{% include "pagination.html" with list=machines_list %}
{% endif %}
<table
class=
"table table-striped"
>
<thead>
...
...
machines/urls.py
View file @
4bb831f1
...
...
@@ -22,5 +22,5 @@ urlpatterns = [
url
(
r
'^history/(?P<object>extension)/(?P<id>[0-9]+)$'
,
views
.
history
,
name
=
'history'
),
url
(
r
'^$'
,
views
.
index
,
name
=
'index'
),
url
(
r
'^rest/mac-ip/$'
,
views
.
mac_ip
,
name
=
'mac-ip'
),
url
(
r
'^rest/
dns-ip/$'
,
views
.
dns_ip
,
name
=
'dns-ip
'
),
url
(
r
'^rest/
mac-ip-dns/$'
,
views
.
mac_ip_dns
,
name
=
'mac-ip-dns
'
),
]
machines/views.py
View file @
4bb831f1
...
...
@@ -415,8 +415,7 @@ def mac_ip(request):
s
.
pop
(
'dns'
)
return
JSONResponse
(
seria
)
def
dns_ip
(
request
):
def
mac_ip_dns
(
request
):
seria
=
interface_list
(
request
)
for
s
in
seria
:
s
.
pop
(
'mac_address'
)
return
JSONResponse
(
seria
)
templates/pagination.html
0 → 100644
View file @
4bb831f1
<ul
class=
"pagination nav navbar-nav"
>
{% if list.has_previous %}
<li><a
href=
"?page=1"
>
<
<
</
a
></li>
<li><a
href=
"?page={{ list.previous_page_number }}"
>
<
</
a
></li>
{% endif %}
{% for page in list.paginator.page_range %}
{% if list.number
<
=
page
|
add:
"3"
and
list.number
>
= page|add:"-3" %}
<li
class=
"{% if list.number == page %}active{% endif %}"
><a
href=
"?page={{page }}"
>
{{ page }}
</a></li>
{% endif %}
{% endfor %}
{% if list.has_next %}
<li><a
href=
"?page={{ list.next_page_number }}"
>
>
</a></li>
<li><a
href=
"?page={{ list.paginator.page_range|length }}"
>
>>
</a></li>
{% endif %}
</ul>
users/templates/users/aff_users.html
View file @
4bb831f1
{% if users_list.paginator %}
<ul
class=
"pagination nav navbar-nav"
>
{% if users_list.has_previous %}
<li><a
href=
"?page={{ users_list.previous_page_number }}"
>
Suivants
</a></li>
{% endif %}
{% for page in users_list.paginator.page_range %}
<li
class=
"{% if users_list.number == page %}active{% endif %}"
><a
href=
"?page={{page }}"
>
{{ page }}
</a></li>
{% endfor %}
{% if users_list.has_next %}
<li>
<a
href=
"?page={{ users_list.next_page_number }}"
>
Précédents
</a></li>
{% endif %}
</ul>
{% endif %}
{% if users_list.paginator %}
{% include "pagination.html" with list=users_list %}
{% endif %}
<table
class=
"table table-striped"
>
<thead>
...
...
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