-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathpagination_list.html
91 lines (83 loc) · 3.06 KB
/
pagination_list.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
{% extends 'base.html' %}
{% load i18n %}
{% block content %}
<div class="row">
<div class="col">
<h1>
{% trans 'List of' %} {{ model_name_plural }}
</h1>
<table class="table table-responsive">
<thead>
<tr>
<th>
{{ model_name_plural }}
</th>
</tr>
</thead>
<tbody>
{% for element in list %}
<tr>
<td>
{% if element.slug %}
<a href="{% url detail_url_name element.slug %}">{{ element }}</a>
{% else %}
<a href="{% url detail_url_name element.id %}">{{ element }}</a>
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
<div class="row">
<div class="col-xs-6 col-xs-offset-3 col-lg-6 col-lg-offset-3">
<nav aria-label="Page navigation">
<ul class="pagination">
{% if list.has_previous %}
<li class="page-item">
<a href="?page={{ list.previous_page_number }}" class="page-link">
<i class="fa fa-arrow-left"></i>
</a>
</li>
{% endif %}
{% for i in range %}
{% if i == list.number %}
<li class="active black page-item">
<a href="#!" class="page-link">
{{ i }}
</a>
</li>
{% else %}
<li class="page-item">
<a href="?page={{ i }}" class="page-link">
{{ i }}
</a>
</li>
{% endif %}
{% endfor %}
{% if list.has_next %}
<li class="page-item">
<a href="?page={{ list.next_page_number }}" class="page-link">
<i class="fa fa-arrow-right"></i>
</a>
</li>
{% endif %}
</ul>
</nav>
</div>
</div>
<div class="row">
<div class="col-xs-12">
<div class="actions">
{% if create_object_reversed_url %}
<a href="{{ create_object_reversed_url }}">
<button class="btn btn-success">
{% trans 'Create' %}
</button>
</a>
{% endif %}
</div>
</div>
</div>
{% endblock %}