{% 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 %} {% block page_title %}{{ 'timesheet.title'|trans }}{% endblock %} {% block page_subtitle %}{{ 'timesheet.subtitle'|trans }}{% endblock %} {% block page_actions %}{{ widgets.page_actions({'filter': '#collapseTimesheet', 'visibility': '#modal_timesheet', 'create': path('timesheet_create')}) }}{% endblock %} {% block main_before %} {{ toolbar.toolbar(toolbarForm, 'collapseTimesheet') }} {% endblock %} {% block main %} {% if entries.count == 0 %} {{ widgets.callout('warning', 'error.no_entries_found') }} {% endif %} {% set columns = {'date': 'alwaysVisible'} %} {% if not duration_only %} {% set columns = columns|merge({'starttime': '', 'endtime': ''}) %} {% endif %} {% set columns = columns|merge({ 'duration': 'hidden-xs', 'rate': 'hidden-xs', 'activity': 'hidden-xs hidden-sm', 'description': 'hidden-xs hidden-sm', 'actions': 'alwaysVisible', }) %} {% set tableName = 'timesheet' %} {{ tables.data_table_header(tableName, columns) }} {% for entry in entries %} {{ entry.begin|date_short }} {% if not duration_only %} {{ entry.begin|date("H:i") }} {% endif %} {% if entry.end %} {% if not duration_only %} {{ entry.end|date("H:i") }} {% endif %} {{ entry.duration|duration }} {{ entry.rate|money(entry.activity.project.customer.currency) }} {% else %} {% if not duration_only %} ‐ {% endif %} {{ entry|duration }} ‐ {% endif %} {{ widgets.label_activity(entry.activity) }} {{ entry.description }} {% set actionButtons = {'edit': path('timesheet_edit', {'id' : entry.id, 'page': page})} %} {% if entry.end %} {% if is_granted('start', entry.activity) %} {% set actionButtons = {'repeat': path('timesheet_start', {'id' : entry.activity.id})}|merge(actionButtons) %} {% endif %} {% else %} {% if is_granted('stop', entry) %} {% set actionButtons = {'stop': path('timesheet_stop', {'id' : entry.id})}|merge(actionButtons) %} {% endif %} {% endif %} {% set actionButtons = actionButtons|merge({'trash': path('timesheet_delete', {'id' : entry.id, 'page': page})}) %} {{ widgets.button_group(actionButtons) }} {% endfor %} {{ tables.data_table_footer(entries, 'timesheet_paginated') }} {% endblock %}