{% comment %} Table Skeleton Component ======================== Animated skeleton placeholder for data tables while content loads. Purpose: Displays pulsing skeleton table rows for data-heavy pages like admin dashboards, moderation queues, and data exports. Usage Examples: Basic table skeleton: {% include 'components/skeletons/table_skeleton.html' %} Custom dimensions: {% include 'components/skeletons/table_skeleton.html' with rows=10 cols=6 %} With checkbox column: {% include 'components/skeletons/table_skeleton.html' with show_checkbox=True %} With action column: {% include 'components/skeletons/table_skeleton.html' with show_actions=True %} Parameters: Optional: - rows: Number of table rows (default: 5) - cols: Number of data columns (default: 4) - show_header: Show table header row (default: True) - show_checkbox: Show checkbox column (default: False) - show_actions: Show actions column (default: True) - show_avatar: Show avatar in first column (default: False) - striped: Use striped row styling (default: False) - animate: Enable pulse animation (default: True) Dependencies: - Tailwind CSS for styling and animation Accessibility: - Uses role="status" and aria-busy="true" for screen readers {% endcomment %} {% with rows=rows|default:5 cols=cols|default:4 show_header=show_header|default:True show_checkbox=show_checkbox|default:False show_actions=show_actions|default:True show_avatar=show_avatar|default:False striped=striped|default:False animate=animate|default:True %}
{# Table Header #} {% if show_header %} {# Checkbox header #} {% if show_checkbox %} {% endif %} {# Data column headers #} {% for c in "12345678"|slice:cols %} {% endfor %} {# Actions header #} {% if show_actions %} {% endif %} {% endif %} {# Table Body #} {% for r in "12345678901234567890"|slice:rows %} {# Checkbox cell #} {% if show_checkbox %} {% endif %} {# Data cells #} {% for c in "12345678"|slice:cols %} {% endfor %} {# Actions cell #} {% if show_actions %} {% endif %} {% endfor %}
{% if forloop.first and show_avatar %} {# First column with avatar #}
{% else %} {# Regular data cell #}
{% endif %}
Loading table data, please wait...
{% endwith %}