Template source: listing/_listing_sort_toggle.html

{% load add_query %}{% load i18n %}
{# Template to toggle between sort types #}
{% if listing_view_style != 'mapview' %}
    <span class="hidden-tablet inline-block appendright-5">{% trans 'Sort' %}: </span>
    <div class="btn-group dropdown">
        <a class="btn btn-large dropdown-toggle appendright-10" data-toggle="dropdown" href="#">
            {% if results.sort_by == 'expires_at' %}{% trans 'Closing Soon' %}{% endif %}
            {% if results.sort_by == '-rank' %}{% trans 'Newest' %}{% endif %}
             <i class="ss-dropdown ss-large appendleft-5"></i>
        </a>
        <ul class="dropdown-menu" role="menu">
          {% if results.sort_by != 'expires_at' %}<li class="text-left light small"><a href="{{ request.get_full_path|add_query:"sort_by=expires_at" }}" class="no-background">{% trans "Closing Soon" %}</a></li>{% endif %}
          {% if results.sort_by != '-rank' %}<li class="text-left light small"><a href="{{ request.get_full_path|add_query:"sort_by=-rank" }}" class="no-background">{% trans "Newest" %}</a></li>{% endif %}
        </ul>
    </div>
{% endif %}