Display meta-fields in datatables (#1116)
This commit is contained in:
@@ -102,6 +102,12 @@
|
||||
</span>
|
||||
{% endmacro %}
|
||||
|
||||
{% macro color_dot(color, tooltip) %}
|
||||
<span class="label-color" data-toggle="tooltip" data-placement="top" title="{{ tooltip }}">
|
||||
<span class="dot" style="background-color:{{ color }}"></span>
|
||||
</span>
|
||||
{% endmacro %}
|
||||
|
||||
{% macro badge_counter(count, url) %}
|
||||
{% if url %}
|
||||
<a href="{{ url }}"><span class="badge bg-blue">{{ count }}</span></a>
|
||||
@@ -294,3 +300,40 @@
|
||||
{{ macro.badge(tag.name , 'green') }}
|
||||
{% endfor %}
|
||||
{% endmacro %}
|
||||
|
||||
{% macro form_type_value(type, value, entity) %}
|
||||
{% import _self as widgets %}
|
||||
{% if '\\ColorPickerType' in type %}
|
||||
{{ widgets.color_dot(value, value) }}
|
||||
{% elseif '\\DurationType' in type %}
|
||||
{{ value|duration }}
|
||||
{% elseif '\\YesNoType' in type or '\\CheckBoxType' in type %}
|
||||
{{ widgets.label_boolean(value) }}
|
||||
{% elseif '\\DatePickerType' in type %}
|
||||
{{ value|date_short }}
|
||||
{% elseif '\\DateTimePickerType' in type %}
|
||||
{{ value|date_full }}
|
||||
{% elseif '\\CountryType' in type %}
|
||||
{{ value|country }}
|
||||
{% elseif '\\CurrencyType' in type %}
|
||||
{{ value|currency }}
|
||||
{% elseif '\\LanguageType' in type %}
|
||||
{{ value|language }}
|
||||
{% elseif '\\MoneyType' in type %}
|
||||
{% if entity is null %}
|
||||
{{ value }}
|
||||
{% elseif class_name(entity) == 'App\\Entity\\Timesheet' %}
|
||||
{{ value|money(entity.project.customer.currency) }}
|
||||
{% elseif class_name(entity) == 'App\\Entity\\Customer' %}
|
||||
{{ value|money(entity.currency) }}
|
||||
{% elseif class_name(entity) == 'App\\Entity\\Project' %}
|
||||
{{ value|money(entity.customer.currency) }}
|
||||
{% elseif class_name(entity) == 'App\\Entity\\Activity' and entity.project is not null %}
|
||||
{{ value|money(entity.project.customer.currency) }}
|
||||
{% else %}
|
||||
{{ value }}
|
||||
{% endif %}
|
||||
{% else %}
|
||||
{{ value }}
|
||||
{% endif %}
|
||||
{% endmacro %}
|
||||
|
||||
Reference in New Issue
Block a user