{% if pageCount > 1 %}
<ul class="kode_pagination">
{% if previous is defined %}
<li><a class="prve" href="{{ path(route, query|merge({(pageParameterName): previous})) }}">{{ "masjid.pagination.prev"|trans }}<i class="fa fa-arrow-left"></i></a></li>
{% else %}
<li class="disabled">
<a class="prve"><i class="fa fa-arrow-left"></i>{{ "masjid.pagination.prev"|trans }}</a>
</li>
{% endif %}
{% if startPage > 1 %}
<li>
<a href="{{ path(route, query|merge({(pageParameterName): 1})) }}">1</a>
</li>
{% if startPage == 3 %}
<li >
<a href="{{ path(route, query|merge({(pageParameterName): 2})) }}">2</a>
</li>
{% elseif startPage != 2 %}
<li class="disabled">
<a>…</a>
</li>
{% endif %}
{% endif %}
{% for page in pagesInRange %}
{% if page != current %}
<li >
<a href="{{ path(route, query|merge({(pageParameterName): page})) }}">{{ page }}</a>
</li>
{% else %}
<li class="active">
<a >{{ page }}</a>
</li>
{% endif %}
{% endfor %}
{% if pageCount > endPage %}
{% if pageCount > (endPage + 1) %}
{% if pageCount > (endPage + 2) %}
<li class="disabled">
<a >…</a>
</li>
{% else %}
<li >
<a href="{{ path(route, query|merge({(pageParameterName): (pageCount - 1)})) }}">{{ pageCount -1 }}</a>
</li>
{% endif %}
{% endif %}
<li >
<a href="{{ path(route, query|merge({(pageParameterName): pageCount})) }}">{{ pageCount }}</a>
</li>
{% endif %}
{% if next is defined %}
<li><a class="next" href="{{ path(route, query|merge({(pageParameterName): next})) }}">{{ "masjid.pagination.next"|trans }}<i class="fa fa-arrow-right"></i></a></li>
{% else %}
<li class="disabled">
<a class="next">{{ "masjid.pagination.next"|trans }}<i class="fa fa-arrow-right"></i></a>
</li>
{% endif %}
</ul>
{% endif %}