Implementing useful UI changes.

This commit is contained in:
Yaro Kasear 2025-09-11 08:12:41 -05:00
parent 7ddfe084ba
commit de5e5b4a43
6 changed files with 181 additions and 38 deletions

View file

@ -1,20 +1,26 @@
<table>
<thead>
<tr>
{% for col in columns %}
<th>{{ col.label }}</th>
{% endfor %}
</tr>
</thead>
<tbody>
{% if rows %}
<thead>
{% for row in rows %}
<tr>
{% if headers %}
{% for header in headers %}<th>{{ header }}</th>{% endfor %}
{% for cell in row.cells %}
{% if cell.href %}
<td class="{{ cell.class or '' }}"><a href="{{ cell.href }}">{{ cell.text if cell.text is not none else '-' }}</a></td>
{% else %}
{% for field in fields if field != "id" %}<th>{{ field }}</th>{% endfor %}
<td class="{{ cell.class or '' }}">{{ cell.text if cell.text is not none else '-' }}</td>
{% endif %}
{% endfor %}
</tr>
</thead>
<tbody>
{% for row in rows %}
<tr>{% for _, cell in row.items() if _ != "id" %}<td>{{ cell if cell else "-" }}</td>{% endfor %}</tr>
{% endfor %}
{% else %}
<tr><th>No data.</th></tr>
{% endif %}
</tbody>
</table>
{% endfor %}
{% else %}
<tr><td colspan="{{ columns|length }}">No data.</td></tr>
{% endif %}
</tbody>
</table>