{% macro icon(icon) %} {% endmacro %} {%- macro page_actions(tools) -%} {% import _self as macro %} {%- endmacro -%} {%- macro entity_actions(tools) -%} {% import _self as macro %} {%- endmacro -%} {% macro page_header(title) %} {% endmacro %} {% macro label_boolean(visible) %} {% import _self as macro %} {% if visible %} {{ macro.label('yes', 'success') }} {% else %} {{ macro.label('no', 'default') }} {% endif %} {% endmacro %} {% macro label_visible(visible) %} {% import _self as macro %} {{ macro.label_boolean(visible) }} {% endmacro %} {% macro label_role(role) %} {% import _self as macro %} {% if role == 'ROLE_SUPER_ADMIN' %} {{ macro.label(role, 'danger') }} {% elseif role == 'ROLE_ADMIN' %} {{ macro.label(role, 'warning') }} {% elseif role == 'ROLE_TEAMLEAD' %} {{ macro.label(role, 'success') }} {% elseif role == 'ROLE_USER' %} {{ macro.label(role, 'gray') }} {% else %} {{ macro.label(role, 'primary') }} {% endif %} {% endmacro %} {% macro username(user) %} {{- user.displayName -}} {% endmacro %} {% macro label_user(user) %} {% import _self as macro %} {{ macro.label(user.displayName, 'primary') }} {% endmacro %} {% macro label_team(team, class) %} {% import _self as macro %} {{ macro.label(team.name, class|default('primary')) }} {% endmacro %} {% macro user_avatar(user, tooltip, class) %} {% set avatar = avatar(user, admin_lte_context.default_avatar) %} {% if tooltip is same as (false) %} {{ user.displayName }} {% else %} {{ user.displayName }} {% endif %} {% endmacro %} {% macro label_activity(activity, url) %} {% import _self as macro %} {% set isVisible = activity.visible %} {% set color = activity.color %} {% if color is empty and activity.project is not null %} {% set color = activity.project.color ?? activity.project.customer.color %} {% endif %} {% if isVisible and not activity.project is null %} {% set isVisible = activity.project.visible %} {% if isVisible and not activity.project.customer is null %} {% set isVisible = activity.project.customer.visible %} {% endif %} {% endif %} {{ macro.label_color_dot('activity', isVisible, activity.name, url, color) }} {% endmacro %} {% macro label_project(project, url) %} {% import _self as macro %} {% set isVisible = false %} {% if project.visible and project.customer.visible %} {% set isVisible = true %} {% endif %} {{ macro.label_color_dot('project', isVisible, project.name, url, (project.color ?? project.customer.color)) }} {% endmacro %} {% macro label_customer(customer, url) %} {% import _self as macro %} {% set isVisible = customer.visible %} {{ macro.label_color_dot('customer', isVisible, customer.name, url, customer.color) }} {% endmacro %} {% macro label_color_dot(type, isVisible, name, url, color) %} {% if url is not empty %} {{ name }} {% else %} {{ name }} {% endif %} {% endmacro %} {% macro color_dot(color, tooltip) %} {% endmacro %} {% macro badge_counter(count, url) %} {% if url %} {{ count }} {% else %} {{ count }} {% endif %} {% endmacro %} {% macro label(title, type, tooltip) %} {# success, warning, danger, primary #} {{ title|trans }} {% endmacro %} {% macro badge(title, color) %} {# black, green, blue, yellow #} {{ title|trans }} {% endmacro %} {% macro alert(type, description, title, icon) %}
{% if title and icon %}

{{ title|trans }}

{{ description|trans }} {% elseif icon %}

{{ description|trans }}

{% else %} {{ description|trans }} {% endif %}
{% endmacro %} {% macro callout(type, description, title, icon) %}
{% if title %}

{% if icon %}{% endif %} {{ title|trans }}

{% endif %}

{{ description|trans }}

{% endmacro %} {% macro info_box_progress(title, description, amount, percentage, icon, color) %}
{{ title|trans }} {{ amount }}
{{ description }}
{% endmacro %} {% macro button_group_dropdown(title, actions) %}
{% endmacro %} {% macro table_actions(actions, class) %} {%- import _self as macro -%} {% if actions|length >= 1 %} {% if class is null %} {% set class = 'btn-sm' %} {% endif %} {% set trash = null %} {% set divider = false %} {% endif %} {% endmacro %} {% macro action_button(icon, values, type) %} {%- import _self as macro -%} {%- apply spaceless -%} {% set id = null %} {% set onclick = null %} {% set modal = null %} {% set toggle = null %} {% set url = null %} {% set target = null %} {% set title = null %} {% set disabled = false %} {% set attr = {} %} {% if type is same as (false) %} {% set class = "" %} {% elseif type is null %} {% set class = "btn btn-default btn-" ~ icon ~ " " %} {% else %} {% set class = "btn btn-" ~ type ~ " btn-" ~ icon ~ " " %} {% endif %} {% if not values is iterable %} {% set url = values %} {% if 'onclick:' in url %} {% set onclick = url|replace({'onclick:': ''}) %} {% set url = '#' %} {% endif %} {% if '#collapse' in url %} {% set toggle = 'collapse' %} {% endif %} {% if '#modal' in url %} {% set modal = url %} {% set url = '#' %} {% endif %} {% else %} {% set disabled = values.disabled ?? false %} {% set url = values.url ?? '#' %} {% set onclick = values.onclick ?? null %} {% set modal = values.modal ?? null %} {% set toggle = values.toggle ?? null %} {% set target = values.target ?? null %} {% set id = values.id ?? null %} {% set title = values.title ?? null %} {% set class = class ~ ( values.class | default("")) %} {% set attr = values.attr ?? {} %} {% endif %} {% if disabled is same as (true) %} {% set class = class ~ " disabled" %} {% endif %} {% if title is not null %}{{ title }}{% else %}{{ macro.icon(icon) }}{% endif %} {% endapply %} {% endmacro %} {% macro button_group(actions, type) %} {%- import _self as macro -%}
{%- apply spaceless -%} {%- for icon,values in actions %} {% if values.children is defined %}
{% else %} {{ macro.action_button(icon, values, type) }} {% endif %} {% endfor -%} {% endapply %}
{% endmacro %} {% macro button_action(icon, url) %} {{ macro.icon(icon) }} {% endmacro %} {% macro tag_list(taglist) %} {% import _self as macro %} {% for tag in taglist %} {{ 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 %} {% macro team_list(teams, showTitle) %} {% if showTitle is null %} {% set showTitle = true %} {% endif %} {% import _self as macro %} {% if showTitle %} {% endif %} {% for team in teams %} {% endfor %}
{{ 'label.team'|trans }} {{ 'label.user'|trans }}
{{ team.name }} {% set userTeamCount = team.users|length %} {{ macro.user_avatar(team.teamlead, ('label.teamlead'|trans ~ ': ' ~ team.teamlead.displayName), 'teamlead') }} {% set teamHiddenId = 'team_' ~ team.id ~ '_hiddenUser' ~ random() %} {% set counter = 0 %} {% for user in team.users %} {% if user != team.teamlead %} {{ macro.user_avatar(user) }} {% set counter = counter + 1 %} {% endif %} {% if userTeamCount > 5 and counter == 4 and not loop.last %} {{ 'label.plus_more'|trans({'%count%': (userTeamCount - 5)}) }} {% endif %} {% endfor %}
{% endmacro %}