Commit 0b5a86e9 authored by Théo Labetowiez's avatar Théo Labetowiez

[CORE] Final change on pagination

parent a8316d06
Pipeline #2230 failed with stage
in 9 minutes and 10 seconds
......@@ -1537,13 +1537,21 @@ textarea {
box-shadow: red 2px 2px 10px;
}
#pagination {
.pagination {
text-align: center;
display:flex;
justify-content: center;
margin:0px;
padding: 0px;
div.pages{
padding: 0px;
}
input {
text-decoration: none;
background-color: #e6e6e6;
padding: 15px;
float: none;
margin: 3px;
float: left;
color: darkslategray;
font-size: 14px;
border-radius: 5px;
......@@ -1556,12 +1564,21 @@ textarea {
background-color: #c9c9c9;
color: slategray;
&.current {
background-color: #3cd2ff;
background-color: $primary-light-color;
color: white;
}
}
}
}
@media screen and (max-width: 640px){
.pagination{
div.pages{
display: none;
}
}
}
/*--------------------------------FOOTER-------------------------------*/
......
......@@ -114,36 +114,43 @@
{% endmacro %}
{% macro paginate(page_obj, paginator) %}
<div id="pagination">
<div class="pagination">
<form>
{% if page_obj.has_previous() or page_obj.has_next() %}
<div class="previous">
{% if page_obj.has_previous() %}
<input type="button" value="{% trans %}Previous{% endtrans %}" onclick="window.location.href='?page={{ page_obj.previous_page_number() }}'">
<input type="button" value="{% trans %}Previous{% endtrans %}" onclick="window.location.href='?page={{ page_obj.previous_page_number() }}'"/>
{% else %}
<input type="button" value="{% trans %}Previous{% endtrans %}" disabled>
<input type="button" value="{% trans %}Previous{% endtrans %}" disabled/>
{% endif %}
</div>
<div class="pages">
{% for i in paginator.page_range %}
{% if page_obj.number == i %}
<input type="number" value="{{ i }}" class="current" min="1" max="{{ paginator.num_pages }}">
</div>
<input type="button" class="current" value="{{ i }}" disabled/>
<div class="pages">
{% else %}
{% if paginator.num_pages > 9 %}
{% if (i <= 2 + page_obj.number and i >= page_obj.number - 2) or paginator.num_pages == i or i == 1 %}
<input type="button" value="{{ i }}" onclick="window.location.href='?page={{ i }}'" >
<input type="button" value="{{ i }}" onclick="window.location.href='?page={{ i }}'"/>
{% endif %}
{% if (i == 1 or paginator.num_pages - 1 == i) and (page_obj.number - i > 3 or page_obj.number - i < - 2) %}
<input type="button" value="..." disabled>
<input type="button" value="..." disabled/>
{% endif %}
{% else %}
<input type="button" value="{{ i }}" onclick="window.location.href='?page={{ i }}'" >
<input type="button" value="{{ i }}" onclick="window.location.href='?page={{ i }}'"/>
{% endif %}
{% endif %}
{% endfor %}
</div>
<div class="next">
{% if page_obj.has_next() %}
<input type="button" value="{% trans %}Next{% endtrans %}" onclick="window.location.href='?page={{ page_obj.next_page_number() }}'">
<input type="button" value="{% trans %}Next{% endtrans %}" onclick="window.location.href='?page={{ page_obj.next_page_number() }}'"/>
{% else %}
<input type="button" value="{% trans %}Next{% endtrans %}" disabled>
<input type="button" value="{% trans %}Next{% endtrans %}" disabled/>
{% endif %}
</div>
{% endif %}
</form>
</div>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment