{% from "ui/chip.html" import chip %} {% macro status_badge_form(csrf_token, day, return_to, kind) -%} {% if kind == 'vacation' %}
{% elif kind == 'holiday' %}
{% elif kind == 'sick' %}
{% elif kind == 'overtime' %}
{% endif %} {%- endmacro %} {% macro add_menu_status_form(action_url, csrf_token, day, return_to, label, status='') -%}
{% if status %}{% endif %}
{%- endmacro %} {% macro day_row(day, csrf_token, date_label, return_to='/dashboard', mode='week') -%} {% set is_vacation = day.is_vacation if day.is_vacation is defined else false %} {% set special_status = day.special_status if day.special_status is defined else None %} {% set overtime_adjustment_minutes = day.overtime_adjustment_minutes if day.overtime_adjustment_minutes is defined else 0 %} {% set has_status = is_vacation or special_status in ['holiday', 'sick'] or overtime_adjustment_minutes %} {% set is_weekend = day.is_weekend if day.is_weekend is defined else day.date.weekday() >= 5 %} {% set is_today = today_date is defined and day.date == today_date %} {% set status_edit_url = None %} {% if overtime_adjustment_minutes %} {% set status_edit_url = '/overtime-adjustment/edit?date=' ~ day.date.isoformat() %} {% elif is_vacation %} {% set status_edit_url = '/day-status/edit?date=' ~ day.date.isoformat() ~ '&status=vacation' %} {% elif special_status == 'holiday' %} {% set status_edit_url = '/day-status/edit?date=' ~ day.date.isoformat() ~ '&status=holiday' %} {% elif special_status == 'sick' %} {% set status_edit_url = '/day-status/edit?date=' ~ day.date.isoformat() ~ '&status=sick' %} {% endif %}
{{ date_label }}
{% if day.entry %} {{ chip(minutes_to_hhmm(day.entry.start_minutes) ~ ' → ' ~ minutes_to_hhmm(day.entry.end_minutes), 'time') }} {{ chip('Pause: ' ~ day.entry.break_minutes ~ ' min', 'break') }} {{ chip('Netto: ' ~ minutes_to_hhmm(day.net_minutes), 'net') }} {% else %} {{ chip('Keinen Eintrag', 'empty') }} {% endif %}
{% if is_vacation %}{{ status_badge_form(csrf_token, day, return_to, 'vacation') }}{% endif %} {% if special_status == 'holiday' %}{{ status_badge_form(csrf_token, day, return_to, 'holiday') }}{% endif %} {% if special_status == 'sick' %}{{ status_badge_form(csrf_token, day, return_to, 'sick') }}{% endif %} {% if overtime_adjustment_minutes %}{{ status_badge_form(csrf_token, day, return_to, 'overtime') }}{% endif %} {% if day.entry %}
{% else %} {% if has_status and status_edit_url %} {% endif %}
Zeit {{ add_menu_status_form('/vacation/day/toggle', csrf_token, day, return_to, 'Urlaub (U)') }} {{ add_menu_status_form('/special-day/toggle', csrf_token, day, return_to, 'Feiertag (F)', 'holiday') }} {{ add_menu_status_form('/special-day/toggle', csrf_token, day, return_to, 'Krankheit (K)', 'sick') }} Stundenausgleich (S)
{% endif %}
{%- endmacro %}