{% if pagination.total_pages > 1 %}
    <div class="paginationWrap">
        <ul class="pagination">
            {% if pagination.show_page_x_of_y %}
                <li class="pageXOfY">
                    Page {{ pagination.active_page }} of {{ pagination.total_pages }}
                </li>
            {% endif %}

            {% if pagination.showFirst() %}
                <li class="first">
                    <a href="{{ pagination.pageUrl(1) }}"
                        class="{{ pagination.link_class }}"
                        rel="prev"
                       title="Go to first page"
                    >
                        First Page
                    </a>
                </li>
            {% endif %}

            {% if pagination.showPrevious() %}
                <li class="prev arrows">
                    <a href="{{ pagination.pageUrl(pagination.active_page - 1) }}"
                        class="{{ pagination.link_class }}"
                        rel="prev"
                       title="Previous Page"
                    >
                        <i class="fa fa-arrow-left"></i>
                    </a>
                </li>
            {% endif %}

            {% if pagination.show_page_numbers %}
                {% if pagination.start > 1 %}
                    <li>
                        <a href="{{ pagination.pageUrl(1) }}"
                            class="{{ pagination.link_class }}"
                        >
                            1
                        </a>
                    </li>
                    {% if pagination.start > 2 %}
                        <li class="dots">
                            <span>&hellip;</span>
                        </li>
                    {% endif %}
                {% endif %}

                {% for i in pagination.start..pagination.end %}
                    <li class="{{ i == pagination.active_page ? 'active' : '' }}">
                        <a href="{{ pagination.pageUrl(i) }}"
                            {% if pagination.active_page != i %}
                                rel="{{ pagination.active_page > i ? 'prev' : 'next'  }}"
                            {% endif %}
                            class="{{ i == pagination.active_page ? '' : pagination.link_class }}"
                           title="Navigate To Page {{ i }}"
                        >
                            {{ i }}
                        </a>
                    </li>
                {% endfor %}

                {% if pagination.end < pagination.total_pages %}
                    {% if pagination.end < pagination.total_pages - 1 %}
                        <li class="dots">
                            <span>&hellip;</span>
                        </li>
                    {% endif %}
                    <li>
                        <a href="{{ pagination.pageUrl(pagination.total_pages) }}"
                            class="{{ pagination.link_class }}"
                        >
                            {{ pagination.total_pages }}
                        </a>
                    </li>
                {% endif %}
            {% endif %}

            {% if pagination.showNext() %}
                <li class="next arrows">
                    <a href="{{ pagination.pageUrl(pagination.active_page + 1) }}"
                        rel="next"
                        class="{{ pagination.link_class }}"
                       title="Next Page"
                    >
                        <i class="fa fa-arrow-right"></i>
                    </a>
                </li>
            {% endif %}

            {% if pagination.showLast() %}
                <li class="last">
                    <a href="{{ pagination.pageUrl(pagination.total_pages) }}"
                        rel="next"
                        class="{{ pagination.link_class }}"
                       title="Last Page"
                    >
                        Last Page
                    </a>
                </li>
            {% endif %}
            {% if pagination.showViewAll() %}
                <li class="lastItem">
                    <a href="{{ pagination.viewAllUrl() }}"
                        class="{{ pagination.link_class }}"
                        rel="nofollow"
                    >
                        View All
                    </a>
                </li>
            {% endif %}
        </ul>
    </div> <!-- .paginationWrap -->
{% endif %}
