- formatDistance/formatSpeed: km/km/h only, no mi/mph - Replay button hidden on mobile (d-none d-sm-table-cell) - Action column header hidden on mobile to match - data_table macro supports optional 'class' on column headers Co-authored-by: Copilot <[email protected]>
32 lines
1.4 KiB
HTML
32 lines
1.4 KiB
HTML
{% macro data_table(id, columns, empty_title, empty_message) %}
|
|
<div class="data-list" id="{{ id }}" data-data-list>
|
|
<div class="table-responsive data-list-table" data-data-list-table hidden>
|
|
<table class="table table-hover align-middle mb-0">
|
|
<thead>
|
|
<tr>
|
|
{% for column in columns %}
|
|
<th scope="col"{% if column.class %} class="{{ column.class }}"{% endif %}{% if column.sortable %} aria-sort="none"{% endif %}>
|
|
{% if column.sortable %}
|
|
<button class="data-list-sort" type="button" data-sort-key="{{ column.key }}">
|
|
{{ column.label }}
|
|
<i class="fas fa-sort" aria-hidden="true"></i>
|
|
</button>
|
|
{% else %}
|
|
{{ column.label }}
|
|
{% endif %}
|
|
</th>
|
|
{% endfor %}
|
|
</tr>
|
|
</thead>
|
|
{# Each injected row must define data-<column.key> for sortable columns. #}
|
|
<tbody data-data-list-body></tbody>
|
|
</table>
|
|
</div>
|
|
<div class="data-list-empty text-center" data-data-list-empty>
|
|
<i class="fas fa-inbox fa-2x text-gray-300 mb-3" aria-hidden="true"></i>
|
|
<h6 class="text-dark mb-1">{{ empty_title }}</h6>
|
|
<p class="text-muted mb-0">{{ empty_message }}</p>
|
|
</div>
|
|
</div>
|
|
{% endmacro %}
|