{% import "macros/form.html" as form %} {% set sort_name = collection.name ~ ":sort" %} {% set sort_value = collection.params.sort %} {% block table %} {% block header %} {% block header_rows %} {% for col in collection.columns.names if col in collection.columns.visible %} {% set is_sortable = col in collection.columns.sortable %} {% set primary_order = collection.columns.get_primary_order(col) %} {% set secondary_order = collection.columns.get_secondary_order(col) %} {% set is_current_order = sort_value == col %} {% endfor %} {% endblock header_rows %} {% endblock header %} {% block body %} {% for record in collection %} {% snippet collection.serializer.record_template, record=record, collection=collection %} {% endfor %} {% endblock body %}
{% block header_cell scoped %} {% if is_sortable %} {{ collection.columns.labels[col] or col }} {% else %} {{ collection.columns.labels[col] or col }} {% endif %} {% endblock header_cell %}
{% endblock table %}