detail pages for customers and projects (#1371)
This commit is contained in:
@@ -4,21 +4,28 @@
|
||||
{% import "macros/toolbar.html.twig" as toolbar %}
|
||||
{% import "user/actions.html.twig" as actions %}
|
||||
|
||||
{% set showVisibility = query.visibility != 1 %}
|
||||
{% set columns = {
|
||||
'alias': 'alwaysVisible',
|
||||
'username': 'hidden-xs',
|
||||
'email': 'hidden-xs hidden-md hidden-sm',
|
||||
'title': 'hidden-xs hidden-sm',
|
||||
} %}
|
||||
{% set columns = columns|merge({
|
||||
'roles': {'class': 'hidden-xs hidden-sm', 'orderBy': false},
|
||||
}) %}
|
||||
{% 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 hidden-sm', 'orderBy': false},
|
||||
'team': {'class': 'hidden-xs', 'orderBy': false},
|
||||
'active': {'class': '', 'orderBy': false},
|
||||
'team': {'class': 'text-center hidden-xs', 'orderBy': false},
|
||||
}) %}
|
||||
{% if showVisibility %}
|
||||
{% set columns = columns|merge({
|
||||
'active': {'class': '', 'orderBy': false},
|
||||
}) %}
|
||||
{% endif %}
|
||||
{% set columns = columns|merge({
|
||||
'actions': 'actions alwaysVisible',
|
||||
}) %}
|
||||
|
||||
@@ -40,19 +47,9 @@
|
||||
{{ 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 %}>
|
||||
<tr{% if is_granted('view', entry) %} class="open-edit alternative-link" data-href="{{ path('user_profile', {'username': entry.username}) }}"{% endif %}>
|
||||
<td>{{ widgets.user_avatar(entry) }} {{ 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') }}">
|
||||
{% set showUserRole = entry.roles|length == 1 %}
|
||||
{% for role in entry.roles %}
|
||||
@@ -61,16 +58,22 @@
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</td>
|
||||
<td class="{{ tables.data_table_column_class(tableName, columns, 'team') }}">
|
||||
{% for team in entry.teams %}
|
||||
{% if entry.isTeamleadOf(team) %}
|
||||
{{ widgets.label_team(team, 'success') }}
|
||||
{% else %}
|
||||
{{ widgets.label_team(team) }}
|
||||
{% 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 %}
|
||||
{% endfor %}
|
||||
</td>
|
||||
{% endfor %}
|
||||
<td class="text-center {{ tables.data_table_column_class(tableName, columns, 'team') }}">
|
||||
{% if entry.teams|length > 0 %}
|
||||
{{ widgets.badge_counter(entry.teams|length) }}
|
||||
{% endif %}
|
||||
</td>
|
||||
<td class="{{ tables.data_table_column_class(tableName, columns, 'active') }}">{{ widgets.label_visible(entry.enabled) }}</td>
|
||||
{% if showVisibility %}
|
||||
<td class="{{ tables.data_table_column_class(tableName, columns, 'active') }}">{{ widgets.label_visible(entry.enabled) }}</td>
|
||||
{% endif %}
|
||||
<td class="actions">
|
||||
{{ actions.user(entry, 'index') }}
|
||||
</td>
|
||||
|
||||
Reference in New Issue
Block a user