{% load i18n %}
{% load core_extras %}
{% with page_obj.number as current_page_nb %}
<div class="pagination-container">
<div class=pagination-total-count>
{% blocktrans with total_count=page_obj.paginator.count %}Total number of term in the request : {{ total_count }}{% endblocktrans %}
</div>
<div class="pagination">
    {% if page_obj.has_previous %}
        <a href="{% append_to_param page=1 %}{{ hashtag }}" class="prev">&lsaquo;&lsaquo;</a><a href="{% append_to_param page=page_obj.previous_page_number %}{{ hashtag }}" class="prev">&nbsp;{% trans "previous" %}</a>
    {% else %}
        <span class="disabled prev">&lsaquo;&lsaquo;&nbsp;{% trans "previous" %}</span>
    {% endif %}
    {% for page in page_obj.visible_page_range %}
        {% if page %}
            {% ifequal page page_obj.number %}
                <span class="current page">{{ page_obj.number }}</span>
            {% else %}
                <a href="{% append_to_param page=page %}{{ hashtag }}" class="page">{{ page }}</a>
            {% endifequal %}
        {% else %}
            ...
        {% endif %}
    {% endfor %}
    {% if page_obj.ellipsis_after %}...{% endif %}
    {% if page_obj.has_next %}
        <a href="{% append_to_param page=page_obj.next_page_number %}{{ hashtag }}" class="next">{% trans "next" %}&nbsp;</a><a href="{% append_to_param page='last' %}{{ hashtag }}" class="next">&rsaquo;&rsaquo;</a>
    {% else %}
        <span class="disabled next">{% trans "next" %}&nbsp;&rsaquo;&rsaquo;</span>
    {% endif %}
</div>
</div>
{% endwith %}
