Display meta-fields in datatables (#1116)

This commit is contained in:
Kevin Papst
2019-09-19 20:28:31 +02:00
committed by GitHub
parent 24cbe3d281
commit 5aa422dde1
71 changed files with 1461 additions and 212 deletions

View File

@@ -9,10 +9,17 @@
'customer': 'hidden-xs',
'comment': 'hidden-xs hidden-sm',
'orderNumber': 'hidden-xs hidden-sm',
} %}
{% for field in metaColumns %}
{% set columns = columns|merge({
(field.name): {'title': field.label, 'class': 'hidden-xs hidden-sm', 'orderBy': false}
}) %}
{% endfor %}
{% set columns = columns|merge({
'team': {'class': '', 'orderBy': false},
'visible': {'class': '', 'orderBy': false},
'actions': 'actions alwaysVisible',
} %}
}) %}
{% set tableName = 'project_admin' %}
@@ -39,6 +46,11 @@
</td>
<td class="{{ tables.data_table_column_class(tableName, columns, 'comment') }}">{{ entry.comment|comment2html }}</td>
<td class="{{ tables.data_table_column_class(tableName, columns, 'orderNumber') }}">{{ entry.orderNumber }}</td>
{% for field in metaColumns %}
<td class="text-nowrap {{ tables.data_table_column_class(tableName, columns, field.name) }}">
{{ tables.datatable_meta_column(entry, field) }}
</td>
{% endfor %}
<td class="{{ tables.data_table_column_class(tableName, columns, 'team') }}">
{% if entry.teams|length > 0 %}
{{ widgets.badge_counter(entry.teams|length) }}