101 lines
4.5 KiB
Twig
101 lines
4.5 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 "macros/actions.html.twig" as actions %}
|
|
|
|
{% set tableName = 'timesheet_admin' %}
|
|
{% set columns = {
|
|
'date': 'alwaysVisible',
|
|
} %}
|
|
|
|
{% if showStartEndTime %}
|
|
{% set columns = columns|merge({
|
|
'starttime': 'hidden-xs',
|
|
'endtime': 'hidden-xs'
|
|
}) %}
|
|
{% endif %}
|
|
|
|
{% set columns = columns|merge({
|
|
'duration': '',
|
|
'rate': '',
|
|
'customer': 'hidden-xs hidden-sm hidden-md',
|
|
'project': 'hidden-xs hidden-sm hidden-md',
|
|
'activity': 'hidden-xs hidden-sm',
|
|
'username': 'hidden-xs',
|
|
'description': 'hidden-xs hidden-sm',
|
|
'tags': 'hidden-xs hidden-sm',
|
|
'actions': 'actions alwaysVisible',
|
|
}) %}
|
|
|
|
{% block page_title %}{{ 'admin_timesheet.title'|trans }}{% endblock %}
|
|
{% block page_subtitle %}{{ 'admin_timesheet.subtitle'|trans }}{% endblock %}
|
|
{% block page_actions %}{{ actions.timesheets_team('index') }}{% endblock %}
|
|
|
|
{% block main_before %}
|
|
{{ toolbar.toolbar(toolbarForm, 'collapseTimesheetAdmin', showFilter) }}
|
|
{{ 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.timesheetUpdate') }}
|
|
|
|
{% for entry in entries %}
|
|
<tr{% if is_granted('edit', entry) %} class="modal-ajax-form open-edit" data-href="{{ path('admin_timesheet_edit', {'id': entry.id}) }}"{% endif %}>
|
|
<td class="text-nowrap {{ tables.data_table_column_class(tableName, columns, 'date') }}">{{ entry.begin|date_short }}</td>
|
|
|
|
{% if showStartEndTime %}
|
|
<td class="text-nowrap {{ tables.data_table_column_class(tableName, columns, 'starttime') }}">{{ entry.begin|time }}</td>
|
|
<td class="text-nowrap {{ tables.data_table_column_class(tableName, columns, 'endtime') }}">
|
|
{% if entry.end %}
|
|
{{ entry.end|time }}
|
|
{% else %}
|
|
‐
|
|
{% endif %}
|
|
</td>
|
|
{% endif %}
|
|
|
|
{% if entry.end %}
|
|
<td class="text-nowrap {{ tables.data_table_column_class(tableName, columns, 'duration') }}">{{ entry.duration|duration }}</td>
|
|
{% else %}
|
|
<td class="text-nowrap {{ tables.data_table_column_class(tableName, columns, 'duration') }}">
|
|
<i data-since="{{ entry.begin.format(constant('DATE_ISO8601')) }}" data-format="{{ get_format_duration() }}">{{ entry|duration }}</i>
|
|
</td>
|
|
{% endif %}
|
|
|
|
<td class="text-nowrap {{ tables.data_table_column_class(tableName, columns, 'rate') }}">
|
|
{% if not entry.end or not is_granted('view_rate', entry) %}
|
|
‐
|
|
{% else %}
|
|
{{ entry.rate|money(entry.project.customer.currency) }}
|
|
{% endif %}
|
|
</td>
|
|
<td class="{{ tables.data_table_column_class(tableName, columns, 'customer') }}">
|
|
{{ widgets.label_customer(entry.project.customer) }}
|
|
</td>
|
|
<td class="{{ tables.data_table_column_class(tableName, columns, 'project') }}">
|
|
{{ widgets.label_project(entry.project) }}
|
|
</td>
|
|
<td class="{{ tables.data_table_column_class(tableName, columns, 'activity') }}">
|
|
{{ widgets.label_activity(entry.activity) }}
|
|
</td>
|
|
<td class="{{ tables.data_table_column_class(tableName, columns, 'username') }}">
|
|
{{ widgets.label_user(entry.user) }}
|
|
</td>
|
|
<td class="{{ tables.data_table_column_class(tableName, columns, 'description') }}">{{ entry.description|nl2br }}</td>
|
|
<td class="{{ tables.data_table_column_class(tableName, columns, 'tags') }}">{{ widgets.tag_list(entry.tags) }}</td>
|
|
<td class="actions">
|
|
{{- actions.timesheet_team(entry, 'index') -}}
|
|
</td>
|
|
</tr>
|
|
{% endfor %}
|
|
|
|
{{ tables.data_table_footer(entries, 'admin_timesheet_paginated') }}
|
|
{% endif %}
|
|
|
|
{% endblock %}
|