{# @description Scrollable region around a django-tables2 table, with its heading and footer rows pinned. #} {# @prop table:text | description:"The django-tables2 Table instance to render." #} {# @prop class:text | description:"Extra classes on the scroll region." #} {# @prop label:text | description:"Accessible name for the region. Give it a distinct value on any page with more than one table." #} {# @prop role:text | default:"region" | description:"ARIA role on the scroll region." #} {# @prop empty_state:text | description:"For the empty state drawn when the table has no rows; read from the page when not passed." #} {# @prop refinements:text | description:"For the empty state drawn when the table has no rows; read from the page when not passed." #} {# @prop clear_refinements_url:text | description:"For the empty state drawn when the table has no rows; read from the page when not passed." #} {# @prop directory:text | description:"For the empty state drawn when the table has no rows; read from the page when not passed." #} {# @prop create_form:text | description:"For the empty state drawn when the table has no rows; read from the page when not passed." #} {# @prop model_info:text | description:"For the empty state drawn when the table has no rows; read from the page when not passed." #} {% load i18n %} {% load render_table from django_tables2 %} {% comment %} The scroll handler names the edges that have cells under them, and the stylesheet gives only those a shadow, as the app header has one when stuck. {% endcomment %} {% comment %} role/tabindex/aria-label are variables, not written into the tag: anything hardcoded here would be emitted before {{ attrs }}, and HTML keeps the *first* of a repeated attribute, so a caller's own label would be ignored. {% endcomment %}
{% comment %} The empty state drawn when the table has no rows reads these back off table.context, the context render_table is called in. Bound here, they are there whether or not Cotton isolates this component from the page. {% endcomment %} {% with empty_state=empty_state refinements=refinements clear_refinements_url=clear_refinements_url directory=directory create_form=create_form model_info=model_info %} {% render_table table %} {% endwith %}