Commit 14e46300 authored by Théo Labetowiez's avatar Théo Labetowiez

[CORE] - Change the display of pagination

parent 411c117f
Pipeline #2029 passed with stage
in 32 minutes and 9 seconds
......@@ -1537,6 +1537,27 @@ textarea {
box-shadow: red 2px 2px 10px;
}
#pagination {
text-align: center;
input {
text-decoration: none;
background-color: #aed6f1;
padding: 15px;
float: none;
color: darkslategray;
font-size: 14px;
border-radius: 5px;
transition-duration: 0.3s;
cursor: pointer;
&:hover {
background-color: #3498DB;
}
}
.current {
background-color: #3498DB;
}
}
/*--------------------------------FOOTER-------------------------------*/
footer {
......
......@@ -114,25 +114,32 @@
{% endmacro %}
{% macro paginate(page_obj, paginator) %}
<div id="pagination">
<form>
{% if page_obj.has_previous() or page_obj.has_next() %}
{% if page_obj.has_previous() %}
<a href="?page={{ page_obj.previous_page_number() }}">{% trans %}Previous{% endtrans %}</a>
<input type="button" value="{% trans %}Previous{% endtrans %}" onclick="window.location.href='?page={{ page_obj.previous_page_number() }}'">
{% else %}
<span class="disabled">{% trans %}Previous{% endtrans %}</span>
<input type="button" value="{% trans %}Previous{% endtrans %}" disabled>
{% endif %}
{% for i in paginator.page_range %}
{% if page_obj.number == i %}
<span class="active">{{ i }} <span class="sr-only">({% trans %}current{% endtrans %})</span></span>
{% else %}
<a href="?page={{ i }}">{{ i }}</a>
<input type="button" value="{{ i }}" class="current" disabled>
{% elif (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 }}'" >
{% 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>
{% endif %}
{% endfor %}
{% if page_obj.has_next() %}
<a href="?page={{ page_obj.next_page_number() }}">{% trans %}Next{% endtrans %}</a>
<input type="button" value="{% trans %}Next{% endtrans %}" onclick="window.location.href='?page={{ page_obj.next_page_number() }}'">
{% else %}
<span class="disabled">{% trans %}Next{% endtrans %}</span>
<input type="button" value="{% trans %}Next{% endtrans %}" disabled>
{% endif %}
{% endif %}
</form>
</div>
{% endmacro %}
{% macro select_all_checkbox(form_id) %}
......
......@@ -338,7 +338,7 @@ SITH_FORUM_PAGE_LENGTH = 30
# SAS variables
SITH_SAS_ROOT_DIR_ID = 4
SITH_SAS_IMAGES_PER_PAGE = 30
SITH_SAS_IMAGES_PER_PAGE = 2
SITH_BOARD_SUFFIX = "-bureau"
SITH_MEMBER_SUFFIX = "-membres"
......
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