Next major version 2 with PHP 8.1, Symfony 6, Tabler UI, 2FA ... (#2902)
This commit is contained in:
27
templates/partials/ticktack.html.twig
Normal file
27
templates/partials/ticktack.html.twig
Normal file
@@ -0,0 +1,27 @@
|
||||
{% set active_timesheets = active_timesheets(app.user) %}
|
||||
{% set hasActiveRecords = active_timesheets is not empty %}
|
||||
{% if not hasActiveRecords %}
|
||||
{# fake entry, because at least one html template node is needed #}
|
||||
{% set active_timesheets = [{'id': '000', 'begin': null, 'activity': {'name': ''}, 'project': {'name': '', 'customer': {'name': ''}}}] %}
|
||||
{% endif %}
|
||||
<div class="nav-item d-flex me-3">
|
||||
<div class="btn-list">
|
||||
{% set class = "btn-outline-white" %}
|
||||
{% if tabler_bundle.isDarkMode() or tabler_bundle.isNavbarOverlapping() %}
|
||||
{% set class = "btn-dark" %}
|
||||
{% endif %}
|
||||
{% set entry = active_timesheets[0] %}
|
||||
<div class="messages-menu" data-api="{{ path('active_timesheet') }}" data-href="{{ path('stop_timesheet', {'id' : '000'}) }}" style="{% if not hasActiveRecords %}display:none{% endif %}">
|
||||
<a data-replacer="url" class="api-link ticktac-running ticktac-stop btn {{ class }}" href="{{ path('stop_timesheet', {'id' : entry.id}) }}" data-event="kimai.timesheetStop kimai.timesheetUpdate" data-method="PATCH" data-msg-error="timesheet.stop.error" data-msg-success="timesheet.stop.success"{% if hasActiveRecords %} accesskey="s"{% endif %}>
|
||||
<i class="icon text-red {{ 'stop-small'|icon(true) }}"></i>
|
||||
<span data-replacer="duration" data-title="true" data-since="{{ entry.begin is null ? '' : entry.begin|date_format(constant('DATE_ISO8601')) }}">{{ entry is iterable ? 0|duration : entry|duration }}</span>
|
||||
</a>
|
||||
</div>
|
||||
<div class="messages-menu-empty" style="{% if hasActiveRecords %}display:none{% endif %}">
|
||||
<a href="{{ path('timesheet_create') }}" class="modal-ajax-form ticktac-start btn {{ class }}" accesskey="n">
|
||||
<i class="icon text-green {{ 'start'|icon(true) }}"></i>
|
||||
<span>{{ 0|duration }}</span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user