Files
kimai2/templates/navbar/active-entries.html.twig
2019-04-21 01:41:08 +02:00

46 lines
2.0 KiB
Twig

{% if entries is not empty %}
<li class="dropdown messages-menu">
<a href="#" class="dropdown-toggle ddt-large ticktac" data-toggle="dropdown">
<i class="{{ 'start'|icon }} fa-2x"></i>
<span class="label label-{% if entries|length > soft_limit %}danger{% elseif entries|length == soft_limit %}warning{% else %}primary{% endif %}">{{ entries|length }}</span>
</a>
<ul class="dropdown-menu">
<li class="header">
{{ 'active.entries'|trans({'%count%':(entries|length)}) }}
</li>
<li>
{% if entries is not empty %}
<ul class="menu">
{% for entry in entries %}
<li>
<a href="{{ path('timesheet_stop', {'id' : entry.id}) }}">
<div class="pull-left">
<i class="{{ 'stop-small'|icon }} fa-2x"></i>
</div>
<h4>
<span>{{ entry.activity.name }}</span>
<small><i class="{{ 'timesheet'|icon }}"></i> {{ entry|duration }}</small>
</h4>
<p>{{ entry.project.name }} ({{ entry.project.customer.name }})</p>
</a>
</li>
{% endfor %}
</ul>
{% else %}
<div class="start_record">
<a href="{{ path('timesheet_create') }}"><i class="{{ 'start'|icon }} fa-5x"></i></a>
</div>
{% endif %}
</li>
{% if is_granted('create_own_timesheet') %}
<li class="footer"><a href="{{ path('timesheet_create') }}">{{ 'timesheet.start'|trans }}</a></li>
{% endif %}
</ul>
</li>
{% elseif is_granted('create_own_timesheet') %}
<li class="messages-menu">
<a href="{{ path('timesheet_create') }}" class="ddt-large">
<i class="{{ 'start'|icon }} fa-2x"></i>
</a>
</li>
{% endif %}