oshipka/vm_gen/templates/html/_table.html
Daniel Tsvetkov e7a0d9f6bd pagination
2021-05-08 16:56:42 +02:00

36 lines
1.1 KiB
HTML

<table class="full-width data-table">
<thead>
<tr>
[%- for column in columns %]
{% if "[[ column.name ]]" not in skip_columns %}
<th>{{ _("[[ column.name ]]") }}</th>
{% endif %}
[%- endfor %]
<th>{{ _("Actions") }}</th>
</tr>
</thead>
<tbody>
{% for instance in instances %}
<tr>
[%- for column in columns %]
{% if "[[ column.name ]]" not in skip_columns %}
<td>
[%- if column.type in ['relationship'] %]
[%- if column.multiple %]
{{ instance.[[ column.name|pluralize ]] }}
[%- else %]
{{ instance.[[ column.name ]] }}
[%- endif %]
[%- else %]
{{ instance.[[ column.name ]] }}
[%- endif %]
</td>
{% endif %}
[%- endfor %]
<td>
{% include "[[ name|camel_to_snake ]]/_actions.html" %}
</td>
</tr>
{% endfor %}
</tbody>
</table>