{% extends "client_portal/base.html" %} {% from "components/ui.html" import page_header %} {% block title %}{{ _('Client Portal') }} - {{ client.name }}{% endblock %} {% block content %} {% set breadcrumbs = [ {'text': _('Client Portal'), 'url': url_for('client_portal.dashboard')} ] %} {{ page_header( icon_class='fas fa-building', title_text=_('Client Portal'), subtitle_text=_('Welcome, %(client_name)s', client_name=client.name), breadcrumbs=breadcrumbs ) }}

{{ _('Active Projects') }}

{{ total_projects }}

{{ _('Total Hours') }}

{{ "%.2f"|format(total_hours) }}

{{ _('Total Invoices') }}

{{ total_invoices }}

{{ _('Outstanding') }}

{{ "%.2f"|format(unpaid_invoice_amount) }} {{ invoices[0].currency_code if invoices else 'EUR' }}

{{ _('Projects') }}

{{ _('View All') }}
{% if projects %}
{% for project in projects[:5] %}

{{ project.name }}

{% if project.description %}

{{ project.description[:50] }}{% if project.description|length > 50 %}...{% endif %}

{% endif %}
{{ project.status|capitalize }}
{% endfor %}
{% else %}

{{ _('No projects found.') }}

{% endif %}

{{ _('Recent Invoices') }}

{{ _('View All') }}
{% if invoices %}
{% for invoice in invoices[:5] %}
{{ invoice.invoice_number }}

{{ invoice.issue_date.strftime('%Y-%m-%d') }}

{{ "%.2f"|format(invoice.total_amount) }} {{ invoice.currency_code }}

{{ invoice.payment_status|replace('_', ' ')|title }}
{% endfor %}
{% else %}

{{ _('No invoices found.') }}

{% endif %}

{{ _('Recent Time Entries') }}

{{ _('View All') }}
{% if recent_time_entries %}
{% for entry in recent_time_entries[:10] %} {% endfor %}
{{ _('Date') }} {{ _('Project') }} {{ _('User') }} {{ _('Duration') }} {{ _('Description') }}
{{ entry.start_time.strftime('%Y-%m-%d') }} {{ entry.project.name if entry.project else _('N/A') }} {{ entry.user.display_name if entry.user else _('N/A') }} {{ "%.2f"|format(entry.duration_hours) }}h {{ entry.description[:50] if entry.description else '-' }}{% if entry.description and entry.description|length > 50 %}...{% endif %}
{% else %}

{{ _('No time entries found.') }}

{% endif %}
{% endblock %}