Files
kimai2/templates/activity/index.html.twig

61 lines
2.6 KiB
Twig

{% extends 'base.html.twig' %}
{% import "macros/widgets.html.twig" as widgets %}
{% import "macros/datatables.html.twig" as tables %}
{% import "macros/toolbar.html.twig" as toolbar %}
{% import "activity/actions.html.twig" as actions %}
{% set columns = {
'name': 'alwaysVisible',
'customer': 'hidden-xs',
'project': 'hidden-xs',
'comment': 'hidden-xs',
'visible': '',
'actions': 'actions alwaysVisible',
} %}
{% set tableName = 'activity_admin' %}
{% block page_title %}{{ 'admin_activity.title'|trans }}{% endblock %}
{% block page_search %}{{ toolbar.dropDownSearch(toolbarForm) }}{% endblock %}
{% block page_actions %}{{ actions.activities('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.data_table_header(tableName, columns, false, 'kimai.activityUpdate') }}
{% for entry in entries %}
<tr{% if is_granted('edit', entry) %} class="modal-ajax-form open-edit" data-href="{{ path('admin_activity_edit', {'id': entry.id}) }}"{% endif %}>
<td>{{ widgets.label_color_dot('activity', true, entry.name, null, entry.color) }}</td>
<td class="{{ tables.data_table_column_class(tableName, columns, 'customer') }}">
{% if entry.project and entry.project.customer %}
{# only none-global activities have a project and customer assigned #}
{{ widgets.label_customer(entry.project.customer) }}
{% endif %}
</td>
<td class="{{ tables.data_table_column_class(tableName, columns, 'project') }}">
{% if entry.project %}
{# only none-global activities have a project and customer assigned #}
{{ widgets.label_project(entry.project) }}
{% endif %}
</td>
<td class="{{ tables.data_table_column_class(tableName, columns, 'comment') }}">{{ entry.comment|comment2html }}</td>
<td class="{{ tables.data_table_column_class(tableName, columns, 'visible') }}">{{ widgets.label_visible(entry.visible) }}</td>
<td class="actions">
{{ actions.activity(entry, 'index') }}
</td>
</tr>
{% endfor %}
{{ tables.data_table_footer(entries, 'admin_activity_paginated') }}
{% endif %}
{% endblock %}