{% macro sortable_header_cell(request, column, sorting_helper) %} {% set current_ordering = sorting_helper.get_current_ordering(request, column.get_sorting_key()) %} {% set ordering_index = sorting_helper.get_current_ordering_index(request, column.get_sorting_key()) %} {% set next_ordering_url = sorting_helper.get_url(request, column.get_sorting_key()) %} {% set should_show_index = sorting_helper.should_show_index(request) %} {{ column.label }} {% if current_ordering == 'asc' %} {{ icon('arrow-narrow-down') }} {% elif current_ordering == 'desc' %} {{ icon('arrow-narrow-up') }} {% else %} {{ icon('arrows-sort') }} {% endif %} {% if should_show_index and ordering_index %} {{ ordering_index }} {% endif %} {% endmacro %} {% macro header_cell(request, column) %} {% if column.sortable %} {{ sortable_header_cell(request, column, sorting_helper) }} {% else %} {{ column.label }} {% endif %} {% endmacro %} {{ header_cell(request, column) }}