0
0
mirror of https://github.com/kevinpapst/kimai2.git synced 2024-10-31 06:08:11 +00:00
kevinpapst_kimai2/templates/bundles/TablerBundle/components/avatar_image.html.twig

10 lines
550 B
Twig

{% macro avatar_image(user) %}
{% if user.avatar is not empty and kimai_config.themeAllowAvatarUrls %}
{% set avatar = asset(user.avatar, 'avatars') %}
<span class="avatar" style="background-image:url({{ avatar }})" title="{{ user.displayName }}">&nbsp;</span>
{% else %}
{% set color = user.color|colorize(user.displayName) %}
<span class="avatar" style="background-color: {{ color }}; color: {{ color|font_contrast }}" title="{{ user.displayName }}">{{ user.initials }}</span>
{% endif %}
{% endmacro %}