{% extends 'user/layout.html.twig' %} {% import "macros/widgets.html.twig" as widgets %} {% import "macros/charts.html.twig" as charts %} {% 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, firstTimesheet) }} {% endblock %} {% block profile_intro %}{% endblock %} {% block profile_content %} {{ _self.profile_box_horizontal(user, stats) }} {% if workMonths is empty %} {{ widgets.nothing_found() }} {% endif %} {% set monthRoute = null %} {% set canSeeReport = user.enabled and is_granted('view_reporting') and (app.user.id == user.id or is_granted('view_other_timesheet')) %} {%- if canSeeReport -%} {% set monthRoute = path('report_user_month', {'user': user.id, 'date': '__MONTH__'}) %} {% endif %} {{ charts.bar_javascript({'footer': 'footer', 'label': 'tooltip', 'onclick': {'url': monthRoute, 'replacer': {'__MONTH__': 'month'}}}) }} {% for year in workMonths.years|reverse %} {% embed '@AdminLTE/Widgets/box-widget.html.twig' %} {% import "macros/charts.html.twig" as charts %} {% block box_title %}{{ year }}{% endblock %} {% block box_tools %} {%- if canSeeReport -%} {% endif %} {% endblock %} {% block box_body %} {% set dataset = [] %} {% for month in workMonths.year(year) %} {% set monthDate = create_date(year ~ '-' ~ month.date.format('m') ~ '-01') %} {% set dataset = dataset|merge([{'value': month.duration|chart_duration, 'tooltip': month.duration|duration, 'footer': ('label.billable'|trans ~ ': ' ~ month.billableDuration|duration), 'month': monthDate|report_date}]) %} {% endfor %} {{ charts.bar_chart('userProfileChart'~year, month_names(), [dataset], {}) }} {% endblock %} {% endembed %} {% endfor %} {% if user.teams is not empty and (is_granted('teams', user) or is_granted('view_team_member', user)) %} {% 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, firstTimesheet) %} {% 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 %}
{{ 'label.username'|trans }}
{{ user.username }}
{{ 'label.account_number'|trans }}
{{ user.accountNumber }}
{{ 'profile.first_entry'|trans }}
{% if firstTimesheet is not null %}
{{ firstTimesheet|date_short }}
{% else %}
–
{% endif %}
{{ 'profile.registration_date'|trans }}
{{ user.registeredAt|date_short }}
{{ 'label.hourlyRate'|trans }}
{{ user.preferenceValue('hourly_rate') }}