{% load custom_tags_and_filters %}
<span class="pagination-column">
    {% with order_list=order_by|concat:',-'|concat:order_by %}
        {# order_list = "name,-name #}
        {% with order=page.paginator.order_by|cut:order_by|yesno:order_list %}
            {# order = -name if order_by is name and vice versa #}
            <a href="?{{ extra_params }}&o={{ order }}&p={{ page.paginator.page_number }}&pp={{ page.paginator.per_page }}">{{ name }}<span class="{% if not page.paginator.order_by or order_by not in page.paginator.order_by or order_by|length|add:1 < page.paginator.order_by|length %}invisible{% endif %} glyphicon glyphicon-triangle-{% if order == order_by %}bottom{% else %}top{% endif %}"></span></a>
        {% endwith %}
    {% endwith %}
</span>
