Files
kimai2/templates/user/index.html.twig
Kevin Papst d661c8b54e fix closing search dropdown (#1142)
* using a different library for javascript selects, fixing the closing search dropdown
* fix closing dropdown for daterangepicker
* added missing search button for mobile on customer page
* fix meta fields with same names than existing columns
2019-09-25 18:34:25 +02:00

73 lines
3.2 KiB
Twig

{% extends 'base.html.twig' %}
{% import "macros/datatables.html.twig" as tables %}
{% import "macros/widgets.html.twig" as widgets %}
{% import "macros/toolbar.html.twig" as toolbar %}
{% import "user/actions.html.twig" as actions %}
{% set columns = {
'alias': 'alwaysVisible',
'username': 'hidden-xs',
'email': 'hidden-xs hidden-sm',
'title': 'hidden-xs',
} %}
{% for pref in preferences %}
{% set columns = columns|merge({
('mf_' ~ pref.name): {'title': pref.label, 'class': 'hidden-xs hidden-sm', 'orderBy': false}
}) %}
{% endfor %}
{% set columns = columns|merge({
'roles': {'class': 'hidden-xs', 'orderBy': false},
'active': {'class': '', 'orderBy': false},
'actions': 'actions alwaysVisible',
}) %}
{% set tableName = 'user_admin' %}
{% block page_title %}{{ 'admin_user.title'|trans }}{% endblock %}
{% block page_search %}{{ toolbar.dropDownSearch(toolbarForm) }}{% endblock %}
{% block page_actions %}{{ actions.users('index') }}{% endblock %}
{% block main_before %}
{{ tables.data_table_column_modal(tableName, columns) }}
{% endblock %}
{% block main %}
{% if entries.count == 0 %}
{{ widgets.callout('warning', 'error.no_entries_found') }}
{% else %}
{{ tables.datatable_header(tableName, columns, query, {'reload': 'kimai.userUpdate'}) }}
{% for entry in entries %}
<tr{% if is_granted('edit', entry) %} class="open-edit alternative-link" data-href="{{ path('user_profile_edit', {'username': entry.username}) }}"{% endif %}>
<td>{{ widgets.username(entry) }}</td>
<td class="{{ tables.data_table_column_class(tableName, columns, 'username') }}">{{ entry.username }}</td>
<td class="{{ tables.data_table_column_class(tableName, columns, 'email') }}">{{ entry.email }}</td>
<td class="{{ tables.data_table_column_class(tableName, columns, 'title') }}">{{ entry.title }}</td>
{% for pref in preferences %}
<td class="text-nowrap {{ tables.data_table_column_class(tableName, columns, 'mf_' ~ pref.name) }}">
{% set metaField = entry.preference(pref.name) %}
{% if not metaField is null and metaField.value is not null and metaField.value is not empty %}
{{ widgets.form_type_value(pref.type, metaField.value, entry) }}
{% endif %}
</td>
{% endfor %}
<td class="{{ tables.data_table_column_class(tableName, columns, 'roles') }}">
{% for role in entry.roles %}
{% if role != 'ROLE_USER' %}
{{ widgets.label_role(role) }}
{% endif %}
{% endfor %}
</td>
<td class="{{ tables.data_table_column_class(tableName, columns, 'active') }}">{{ widgets.label_visible(entry.enabled) }}</td>
<td class="actions">
{{ actions.user(entry, 'index') }}
</td>
</tr>
{% endfor %}
{{ tables.data_table_footer(entries, 'admin_user_paginated') }}
{% endif %}
{% endblock %}