updated to Symfony 4.2 (#710)
This commit is contained in:
@@ -51,29 +51,26 @@
|
||||
{% set isVisible = activity.project.customer.visible %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% set label = '' %}
|
||||
{% if not activity.project is null %}
|
||||
{% set label = activity.project.customer.name ~ ': ' ~ activity.project.name %}
|
||||
{% endif %}
|
||||
{{ macro.label(activity.name, (isVisible ? 'primary' : 'default'), label) }}
|
||||
{% set type = (isVisible ? 'primary' : 'default') %}
|
||||
<span class="label label-{{ type }}">{{ activity.name }}</span>
|
||||
{% endmacro %}
|
||||
|
||||
{% macro label_project(project) %}
|
||||
{% import _self as macro %}
|
||||
{% set type = 'default' %}
|
||||
{% if project.visible and project.customer.visible %}
|
||||
{{ macro.label(project.name, 'primary', project.customer.name) }}
|
||||
{% else %}
|
||||
{{ macro.label(project.name, 'default', project.customer.name) }}
|
||||
{% set type = 'primary' %}
|
||||
{% endif %}
|
||||
<span class="label label-{{ type }}">{{ project.name }}</span>
|
||||
{% endmacro %}
|
||||
|
||||
{% macro label_customer(customer) %}
|
||||
{% import _self as macro %}
|
||||
{% set type = 'default' %}
|
||||
{% if customer.visible %}
|
||||
{{ macro.label(customer.name, 'primary') }}
|
||||
{% else %}
|
||||
{{ macro.label(customer.name, 'default') }}
|
||||
{% set type = 'primary' %}
|
||||
{% endif %}
|
||||
<span class="label label-{{ type }}">{{ customer.name }}</span>
|
||||
{% endmacro %}
|
||||
|
||||
{% macro badge_counter(count, url) %}
|
||||
@@ -86,7 +83,7 @@
|
||||
|
||||
{% macro label(title, type, tooltip) %}
|
||||
{# success, warning, danger, primary #}
|
||||
<span {% if tooltip %}title="{{ tooltip }}" {% endif %}class="label label-{{ type|default('success') }}">{{ title|trans }}</span>
|
||||
<span {% if tooltip %}data-tooltip="{{ tooltip }}" {% endif %}class="label label-{{ type|default('success') }}">{{ title|trans }}</span>
|
||||
{% endmacro %}
|
||||
|
||||
{% macro badge(title, color) %}
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
</a>
|
||||
<ul class="dropdown-menu">
|
||||
<li class="header">
|
||||
{{ 'active.entries'|transchoice(entries|length) }}
|
||||
{{ 'active.entries'|trans({'%count%':(entries|length)}) }}
|
||||
</li>
|
||||
<li>
|
||||
{% if entries is not empty %}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<span class="label label-success">{{ entries|length }}</span>
|
||||
</a>
|
||||
<ul class="dropdown-menu">
|
||||
<li class="header">{{ 'recent.activities'|transchoice(entries|length) }}</li>
|
||||
<li class="header">{{ 'recent.activities'|trans({'%count%':(entries|length)}) }}</li>
|
||||
<li>
|
||||
<ul class="menu">
|
||||
{% for timesheet in entries %}
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
{% if entries.count == 0 %}
|
||||
{{ widgets.callout('warning', 'error.no_entries_found') }}
|
||||
{% else %}
|
||||
{% set canSeeRate = is_granted('view_rate_own_timesheet') %}
|
||||
{% set columns = {'date': ''} %}
|
||||
|
||||
{% if not duration_only %}
|
||||
@@ -25,7 +26,7 @@
|
||||
|
||||
{% set columns = columns|merge({'duration': ''}) %}
|
||||
|
||||
{% if is_granted('view_rate_own_timesheet') %}
|
||||
{% if canSeeRate %}
|
||||
{% set columns = columns|merge({'rate': 'hidden-xs'}) %}
|
||||
{% endif %}
|
||||
|
||||
@@ -50,7 +51,7 @@
|
||||
{% set day = entry.begin|date_short %}
|
||||
{% endif %}
|
||||
{% if showSummary and day is not same as(entry.begin|date_short) %}
|
||||
{{ timesheet.summary(day, dayDuration, dayRate, columns) }}
|
||||
{{ timesheet.summary(day, dayDuration, dayRate, columns, canSeeRate) }}
|
||||
{% set day = entry.begin|date_short %}
|
||||
{% set dayDuration = 0 %}
|
||||
{% set dayRate = {} %}
|
||||
@@ -67,7 +68,7 @@
|
||||
<td class="text-nowrap {{ tables.data_table_column_class(tableName, columns, 'endtime') }}">{{ entry.end|time }}</td>
|
||||
{% endif %}
|
||||
<td class="text-nowrap {{ tables.data_table_column_class(tableName, columns, 'duration') }}">{{ entry.duration|duration }}</td>
|
||||
{% if is_granted('view_rate', entry) %}
|
||||
{% if canSeeRate %}
|
||||
<td class="text-nowrap {{ tables.data_table_column_class(tableName, columns, 'rate') }}">{{ entry.rate|money(entry.project.customer.currency) }}</td>
|
||||
{% endif %}
|
||||
{% else %}
|
||||
@@ -75,7 +76,7 @@
|
||||
<td class="text-nowrap {{ tables.data_table_column_class(tableName, columns, 'endtime') }}">‐</td>
|
||||
{% endif %}
|
||||
<td class="text-nowrap {{ tables.data_table_column_class(tableName, columns, 'duration') }}"><i>{{ entry|duration }}</i></td>
|
||||
{% if is_granted('view_rate', entry) %}
|
||||
{% if canSeeRate %}
|
||||
<td class="{{ tables.data_table_column_class(tableName, columns, 'rate') }}">‐</td>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
@@ -98,7 +99,7 @@
|
||||
{% endfor %}
|
||||
|
||||
{% if showSummary %}
|
||||
{{ timesheet.summary(day, dayDuration, dayRate, columns) }}
|
||||
{{ timesheet.summary(day, dayDuration, dayRate, columns, canSeeRate) }}
|
||||
{% endif %}
|
||||
|
||||
{{ tables.data_table_footer(entries, 'timesheet_paginated') }}
|
||||
@@ -120,13 +121,13 @@
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
||||
{% macro summary(day, duration, dayRates, columns) %}
|
||||
{% macro summary(day, duration, dayRates, columns, canSeeRate) %}
|
||||
<tr class="summary info">
|
||||
<td class="text-nowrap">{{ day }}</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td class="text-nowrap">{{ duration|duration }}</td>
|
||||
{% if is_granted('view_rate_own_timesheet') %}
|
||||
{% if canSeeRate %}
|
||||
<td class="text-nowrap">
|
||||
{% for currency, rate in dayRates %}
|
||||
{{ rate|money(currency) }}
|
||||
|
||||
Reference in New Issue
Block a user