{% extends 'user/layout.html.twig' %} {% import "macros/widgets.html.twig" as widgets %} {% block stylesheets %} {{ parent() }} {{ encore_entry_link_tags('chart') }} {% endblock %} {% block head %} {{ parent() }} {{ encore_entry_script_tags('chart') }} {% endblock %} {% block profile_navbar %} {{ _self.about_me(user, stats) }} {% endblock %} {% block profile_intro %}{% endblock %} {% block profile_content %} {{ _self.profile_box_horizontal(user, stats) }} {% if years is empty %} {{ widgets.nothing_found() }} {% endif %} {% for year, yearStat in years %} {% embed '@AdminLTE/Widgets/box-widget.html.twig' %} {% block box_title %}{{ year }}{% endblock %} {% block box_body %}
{% endblock %} {% endembed %} {% endfor %} {% if user.teams is not empty and (is_granted('teams', user) or (app.user == user and is_granted('view_team_member'))) %} {% embed '@AdminLTE/Widgets/box-widget.html.twig' %} {% import "macros/widgets.html.twig" as widgets %} {% block box_title %}{{ 'label.my_teams'|trans }}{% endblock %} {% block box_body %} {{ widgets.team_list(user.teams) }} {% endblock %} {% endembed %} {% endif %} {% endblock %} {% block javascripts %} {{ parent() }} {% endblock %} {% macro about_me(user, stats) %} {% embed '@AdminLTE/Widgets/box-widget.html.twig' %} {% import "macros/widgets.html.twig" as widgets %} {% block box_title %} {{ widgets.icon('mail') }} {{ 'profile.about_me'|trans }} {% endblock %} {% block box_body %}

{{ 'profile.first_entry'|trans }}
{# FIXME use a configuration for it #} {{ stats.firstEntry|date_short }}

{{ 'profile.registration_date'|trans }}
{{ user.registeredAt|date_short }}

{% if is_granted('hourly-rate', user) and user.preferenceValue('hourly_rate') is not null %}

{{ 'label.hourlyRate'|trans }}
{{ user.preferenceValue('hourly_rate') }}

{% endif %} {% endblock %} {% endembed %} {% endmacro %} {% macro profile_box_vertical(user, stats) %} {% embed '@AdminLTE/Widgets/box-widget.html.twig' %} {% import "macros/widgets.html.twig" as widgets %} {% block box_body_class %}box-profile box-user-profile{% endblock %} {% block box_body %}
{{ widgets.user_avatar(user) }}

{{ widgets.username(user) }}

{{ user.title }}

{% set seeOwnRate = is_granted('view_rate_own_timesheet') %} {% if seeOwnRate %} {# TODO which currency shall we use here? #} {% endif %} {% if seeOwnRate %} {# TODO which currency shall we use here? #} {% endif %}
{{ 'stats.durationMonth'|trans }} {{ stats.durationThisMonth|duration }}
{{ 'stats.amountMonth'|trans }}{{ stats.amountThisMonth|money }}
{{ 'stats.durationTotal'|trans }} {{ stats.durationTotal|duration }}
{{ 'stats.amountTotal'|trans }}{{ stats.amountTotal|money }}
{% endblock %} {% endembed %} {% endmacro %} {% macro profile_box_horizontal(user, stats) %} {% import "@AdminLTE/Macros/default.html.twig" as macro %} {% import "macros/widgets.html.twig" as widgets %} {% set color = kimai_context.chart.background_color %} {% set event = trigger('user.profile_background', {'color': color, 'font': color|font_contrast, 'user': user, 'image': null}) %} {% set config = event.payload %}

{{ widgets.username(user) }}

{{ user.title }}
{{ widgets.user_avatar(user) }}
{% endmacro %}