Files
kimai2/templates/timesheet/index.html.twig
Kevin Papst 6eef9f6f37 Mobile alignments and toolbar #151 (#157)
* improved toolbar position #151
* fixed alignments on mobile #151
* fixed moment js #151
2018-06-05 23:15:25 +02:00

82 lines
3.1 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 %}
{% block page_title %}{{ 'timesheet.title'|trans }}{% endblock %}
{% block page_subtitle %}{{ 'timesheet.subtitle'|trans }}{% endblock %}
{% block page_actions %}{{ widgets.page_actions({'filter': '#collapseTimesheet', 'plus-square': 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 = {'label.date': ''} %}
{% if not duration_only %}
{% set columns = columns|merge({'label.starttime': '', 'label.endtime': ''}) %}
{% endif %}
{% set columns = columns|merge({
'label.duration': 'hidden-xs',
'label.rate': 'hidden-xs',
'label.activity': 'hidden-xs hidden-sm',
'label.description': 'hidden-xs hidden-sm',
'label.actions': '',
}) %}
{{ tables.data_table_header(columns) }}
{% for entry in entries %}
<tr>
<td>{{ entry.begin|date(kimai_context.date_1) }}</td>
{% if not duration_only %}
<td>{{ entry.begin|date("H:i") }}</td>
{% endif %}
{% if entry.end %}
{% if not duration_only %}
<td>{{ entry.end|date("H:i") }}</td>
{% endif %}
<td class="hidden-xs">{{ entry.duration|duration }}</td>
<td class="hidden-xs">{{ entry.rate|money(entry.activity.project.customer.currency) }}</td>
{% else %}
{% if not duration_only %}
<td>&dash;</td>
{% endif %}
<td class="hidden-xs"><i>{{ entry|duration }}</i></td>
<td class="hidden-xs">&dash;</td>
{% endif %}
<td class="hidden-xs hidden-sm">{{ widgets.label_activity(entry.activity) }}</td>
<td class="hidden-xs hidden-sm">{{ entry.description }}</td>
<td>
{% 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) }}
</td>
</tr>
{% endfor %}
{{ tables.data_table_footer(entries, 'timesheet_paginated') }}
{% endblock %}