Files
stundenfuchs/app/templates/pages/dashboard.html
T
maddin 6fbd1bb3c2
CI / checks (push) Has been cancelled
chore: initialize public repository
2026-03-22 12:57:09 +00:00

46 lines
2.8 KiB
HTML

{% extends "base.html" %}
{% from "ui/day_row.html" import day_row with context %}
{% from "ui/kpi_bar.html" import kpi_bar with context %}
{% from "ui/week_header_bar.html" import week_header_bar with context %}
{% from "ui/icon_button.html" import icon_link with context %}
{% from "ui/warning_components.html" import workhours_target_warning_banner with context %}
{% block title %}Wochenansicht{% endblock %}
{% block body_class %}dashboard-theme{% endblock %}
{% block page_class %}dashboard-page{% endblock %}
{% block content %}
{% set return_to = request.url.path ~ ('?' ~ request.url.query if request.url.query else '') %}
<div class="week-view-shell">
{% call week_header_bar('/dashboard?date=' ~ previous_week.isoformat(), '/dashboard?date=' ~ next_week.isoformat(), 'KW ' ~ week.week_start.isocalendar()[1] ~ ' (' ~ week.week_start.strftime('%d.%m.') ~ ' - ' ~ week.week_end.strftime('%d.%m.%Y') ~ ')') %}
<form method="post" action="/vacation/week/toggle" class="inline-form" data-async-refresh="view">
<input type="hidden" name="csrf_token" value="{{ csrf_token }}" />
<input type="hidden" name="week_start" value="{{ week.week_start.isoformat() }}" />
<input type="hidden" name="week_end" value="{{ week.week_end.isoformat() }}" />
<input type="hidden" name="return_to" value="{{ return_to }}" />
<button type="submit"
class="week-vacation-button {% if week.is_vacation_week %}is-active{% endif %}"
title="Urlaub für ganze Woche umschalten"
aria-label="Urlaub für ganze Woche umschalten">Urlaub</button>
</form>
{{ icon_link('/entry/new?date=' ~ selected_date.isoformat(), '/static/icons/add.svg', 'Tag hinzufügen') }}
{{ icon_link('/bulk-entry?from=' ~ week.week_start.isoformat() ~ '&to=' ~ week.week_end.isoformat(), '/static/icons/batch.svg', 'Mehrere Tage bearbeiten') }}
{{ icon_link('/export', '/static/icons/export.svg', 'Export') }}
{% endcall %}
{{ kpi_bar([
{'label': 'IST', 'value': ('%.2f'|format(week.weekly_ist / 60) )|replace('.00', '')},
{'label': 'SOLL', 'value': ('%.2f'|format(week.weekly_soll / 60))|replace('.00', '')},
{'label': 'DELTA', 'value': ('%.2f'|format(week.weekly_delta / 60))|replace('.00', ''), 'value_class': 'negative' if week.weekly_delta < 0 else 'positive'},
{'label': 'KUMULIERT', 'value': ('%.2f'|format(week.cumulative_delta / 60))|replace('.00', ''), 'value_class': 'negative' if week.cumulative_delta < 0 else 'positive'}
], 'kpi-bar--week') }}
{{ workhours_target_warning_banner(workhours_target_warning) }}
<section class="day-list day-list--week">
{% for day in week.days %}
{{ day_row(day, csrf_token, weekday_name_de(day.date) ~ ', ' ~ day.date.strftime('%d.%m.%Y'), return_to, 'week') }}
{% endfor %}
</section>
</div>
{% endblock %}