style: show all back links the same way above the page title

This commit is contained in:
fromme committed 2026-11-12 11:36:18 +01:00
1 parent 3c19401d8b
commit e9b0de44f1
14 files changed
+25 -55

No files matched your search

+8
View File
@@ -0,0 +1,8 @@
{#
The link back to where a page was opened from, always first in the content, above the title.
Expects `url`; `label` defaults to "zurück" and may name the destination ("zurück zur Matrix").
#}
<a href="{{ url }}" class="inline-flex items-center gap-x-1 pb-4 text-sm font-bold text-brand hover:text-brand-dark"{{ qa_attribute('back-link') }}>
{{ icon('arrow-left', 'w-4 h-4 shrink-0') }}
<span>{{ label|default('zurück') }}</span>
</a>
+1 -4
View File
@@ -6,10 +6,7 @@
{% block root %} {% block root %}
{% set back = item.children|filter(child => child.extras.back is defined)|first %} {% set back = item.children|filter(child => child.extras.back is defined)|first %}
{% if back %} {% if back %}
<a href="{{ back.uri }}" class="inline-flex items-center gap-x-1 pb-4 text-sm font-bold text-brand hover:text-brand-dark"> {{ include('_partials/_back_link.html.twig', { 'url': back.uri, 'label': back.label }) }}
{{ icon('arrow-left', 'w-4 h-4 shrink-0') }}
<span>{{ back.label|raw }}</span>
</a>
{% endif %} {% endif %}
<nav aria-label="Bereiche" class="flex overflow-x-auto border-b border-line mb-8"> <nav aria-label="Bereiche" class="flex overflow-x-auto border-b border-line mb-8">
{% for child in item.children|filter(child => child.displayed and child.extras.divider is not defined and child.extras.back is not defined) %} {% for child in item.children|filter(child => child.displayed and child.extras.divider is not defined and child.extras.back is not defined) %}
@@ -22,17 +22,13 @@
{% endmacro %} {% endmacro %}
{% block content %} {% block content %}
<div class="flex items-start justify-between pb-8"> {{ include('_partials/_back_link.html.twig', { 'url': returnUrl }) }}
<h1 class="text-2xl font-bold"> <h1 class="text-2xl font-bold pb-8">
{{ submission.formLabel }} {{ submission.formLabel }}
{% if submission.lastName or submission.firstName %} {% if submission.lastName or submission.firstName %}
- {{ [submission.firstName, submission.lastName]|filter(part => part is not empty)|join(' ') }} - {{ [submission.firstName, submission.lastName]|filter(part => part is not empty)|join(' ') }}
{% endif %} {% endif %}
</h1> </h1>
<a href="{{ returnUrl }}" class="btn btn--small btn--secondary">
zurück
</a>
</div>
<div class="grid lg:grid-cols-2 gap-x-8 gap-y-4 pb-8"> <div class="grid lg:grid-cols-2 gap-x-8 gap-y-4 pb-8">
<dl class="divide-y divide-gray-100"> <dl class="divide-y divide-gray-100">
+2 -6
View File
@@ -3,14 +3,10 @@
{% block title %}Mailing{% endblock %} {% block title %}Mailing{% endblock %}
{% block content %} {% block content %}
<div class="flex items-start justify-between pb-4"> {{ include('_partials/_back_link.html.twig', { 'url': returnUrl, 'label': 'zurück zur Teamübersicht' }) }}
<h1 class="text-2xl font-bold"> <h1 class="text-2xl font-bold pb-4">
Mailing an das Team Mailing an das Team
</h1> </h1>
<a href="{{ returnUrl }}" class="btn btn--small btn--secondary shrink-0">
Zurück zur Teamübersicht
</a>
</div>
<div class="pb-6"> <div class="pb-6">
{{ include('admin/teamer/_mailing_filter_summary.html.twig', { 'filterDto': filterDto }) }} {{ include('admin/teamer/_mailing_filter_summary.html.twig', { 'filterDto': filterDto }) }}
@@ -13,10 +13,7 @@
{% block content %} {% block content %}
{% set status = status_labels[assignment.status] ?? status_labels[assignment.staffingStatus] ?? null %} {% set status = status_labels[assignment.status] ?? status_labels[assignment.staffingStatus] ?? null %}
<a href="{{ returnUrl }}" class="inline-flex items-center gap-x-1 pb-4 text-sm font-bold text-brand hover:text-brand-dark"> {{ include('_partials/_back_link.html.twig', { 'url': returnUrl }) }}
{{ icon('arrow-left', 'w-4 h-4 shrink-0') }}
<span>zurück</span>
</a>
<div class="flex flex-wrap items-start justify-between gap-4 pb-6"> <div class="flex flex-wrap items-start justify-between gap-4 pb-6">
<div> <div>
<p class="text-xs font-bold uppercase tracking-wide text-muted">Einsatz ID {{ assignment.id }}</p> <p class="text-xs font-bold uppercase tracking-wide text-muted">Einsatz ID {{ assignment.id }}</p>
@@ -3,14 +3,10 @@
{% block title %}Mail an Teamer:innen{% endblock %} {% block title %}Mail an Teamer:innen{% endblock %}
{% block content %} {% block content %}
<div class="flex items-start justify-between pb-4"> {{ include('_partials/_back_link.html.twig', { 'url': returnUrl, 'label': 'zurück zur Einsatzübersicht' }) }}
<h1 class="text-2xl font-bold"> <h1 class="text-2xl font-bold pb-4">
Mail an die Teamer:innen von Einsätzen Mail an die Teamer:innen von Einsätzen
</h1> </h1>
<a href="{{ returnUrl }}" class="btn btn--small btn--secondary shrink-0">
Zurück zur Einsatzübersicht
</a>
</div>
<div class="grid lg:grid-cols-2 gap-8 items-start"> <div class="grid lg:grid-cols-2 gap-8 items-start">
<div> <div>
@@ -4,10 +4,7 @@
{% block content %} {% block content %}
{% set context = response.context %} {% set context = response.context %}
<a href="{{ returnUrl }}" class="inline-flex items-center gap-x-1 pb-4 text-sm font-bold text-brand hover:text-brand-dark"> {{ include('_partials/_back_link.html.twig', { 'url': returnUrl }) }}
{{ icon('arrow-left', 'w-4 h-4 shrink-0') }}
<span>zurück</span>
</a>
<h1 class="text-2xl font-bold pb-1"> <h1 class="text-2xl font-bold pb-1">
{{ definition.title }}{% if response.leg %}: {{ response.leg.label }}{% endif %} {{ definition.title }}{% if response.leg %}: {{ response.leg.label }}{% endif %}
</h1> </h1>
@@ -4,10 +4,7 @@
{% block content %} {% block content %}
<div class="max-w-3xl"> <div class="max-w-3xl">
<a href="{{ returnUrl }}" class="inline-flex items-center gap-x-1 pb-4 text-sm font-bold text-brand hover:text-brand-dark"> {{ include('_partials/_back_link.html.twig', { 'url': returnUrl }) }}
{{ icon('arrow-left', 'w-4 h-4 shrink-0') }}
<span>zurück</span>
</a>
<h1 class="text-2xl font-bold pb-2"> <h1 class="text-2xl font-bold pb-2">
Vorschau Reiseleitungsfeedback Vorschau Reiseleitungsfeedback
</h1> </h1>
@@ -4,10 +4,7 @@
{% block content %} {% block content %}
<div class="max-w-3xl"> <div class="max-w-3xl">
<a href="{{ returnUrl }}" class="inline-flex items-center gap-x-1 pb-4 text-sm font-bold text-brand hover:text-brand-dark"> {{ include('_partials/_back_link.html.twig', { 'url': returnUrl }) }}
{{ icon('arrow-left', 'w-4 h-4 shrink-0') }}
<span>zurück</span>
</a>
<h1 class="text-2xl font-bold pb-2"> <h1 class="text-2xl font-bold pb-2">
Vorschau Hausleitungsfeedback Vorschau Hausleitungsfeedback
</h1> </h1>
@@ -3,6 +3,7 @@
{% block title %}Saisoneinsatz{% endblock %} {% block title %}Saisoneinsatz{% endblock %}
{% block content %} {% block content %}
{{ include('_partials/_back_link.html.twig', { 'url': returnUrl }) }}
<div class="flex items-start justify-between pb-4"> <div class="flex items-start justify-between pb-4">
<h1 class="text-2xl font-bold"> <h1 class="text-2xl font-bold">
Saisoneinsatz Saisoneinsatz
@@ -14,9 +15,6 @@
<a href="{{ path('app_administrative_season_assignment_edit', { 'uuid': seasonAssignment.uuid, 'r': return_url() }) }}" class="btn btn--small"> <a href="{{ path('app_administrative_season_assignment_edit', { 'uuid': seasonAssignment.uuid, 'r': return_url() }) }}" class="btn btn--small">
bearbeiten bearbeiten
</a> </a>
<a href="{{ returnUrl }}" class="btn btn--small btn--secondary">
zurück
</a>
</div> </div>
</div> </div>
@@ -3,14 +3,12 @@
{% block title %}Einstellungen - Besetzungsmatrix - Vorschau{% endblock %} {% block title %}Einstellungen - Besetzungsmatrix - Vorschau{% endblock %}
{% block content %} {% block content %}
{{ include('_partials/_back_link.html.twig', { 'url': path('app_administrative_system_staffing_rule_index'), 'label': 'zurück zur Matrix' }) }}
<div class="flex items-center justify-between pb-8"> <div class="flex items-center justify-between pb-8">
<h1 class="text-2xl font-bold"> <h1 class="text-2xl font-bold">
Besetzungsmatrix – Vorschau Besetzungsmatrix – Vorschau
</h1> </h1>
<div class="flex items-center space-x-2"> <div class="flex items-center space-x-2">
<a href="{{ path('app_administrative_system_staffing_rule_index') }}" class="btn">
Zurück zur Matrix
</a>
<a href="{{ path('app_administrative_system_staffing_rule_export') }}" class="btn"> <a href="{{ path('app_administrative_system_staffing_rule_export') }}" class="btn">
Excel-Export Excel-Export
</a> </a>
+1 -4
View File
@@ -3,10 +3,7 @@
{% block title %}Einsatzübersicht{% endblock %} {% block title %}Einsatzübersicht{% endblock %}
{% block content %} {% block content %}
<a href="{{ returnUrl }}" class="inline-flex items-center gap-x-1 pb-4 text-sm font-bold text-brand hover:text-brand-dark"> {{ include('_partials/_back_link.html.twig', { 'url': returnUrl }) }}
{{ icon('arrow-left', 'w-4 h-4 shrink-0') }}
<span>zurück</span>
</a>
<div class="pb-6"> <div class="pb-6">
<h1 class="text-2xl font-bold">{{ assignment.jobProfile.name }}</h1> <h1 class="text-2xl font-bold">{{ assignment.jobProfile.name }}</h1>
<p class="text-muted"> <p class="text-muted">
@@ -4,6 +4,7 @@
{% block content %} {% block content %}
{% set assignment = disposition.assignment %} {% set assignment = disposition.assignment %}
{{ include('_partials/_back_link.html.twig', { 'url': returnUrl }) }}
<h1 class="text-2xl font-bold pb-8"> <h1 class="text-2xl font-bold pb-8">
{% if workflow_has_marked_place(disposition, 'ended') or workflow_has_marked_place(disposition, 'completed') %} {% if workflow_has_marked_place(disposition, 'ended') or workflow_has_marked_place(disposition, 'completed') %}
Dein Einsatz ist abgeschlossen Dein Einsatz ist abgeschlossen
@@ -232,11 +233,6 @@
</a> </a>
{% endif %} {% endif %}
<div class="pt-4">
<a href="{{ returnUrl }}" class="underline">
zurück
</a>
</div>
</div> </div>
</div> </div>
{% endblock %} {% endblock %}
@@ -51,7 +51,7 @@ class DetailControllerTest extends WebTestCase
$this->assertSame(Response::HTTP_OK, $this->client->getResponse()->getStatusCode()); $this->assertSame(Response::HTTP_OK, $this->client->getResponse()->getStatusCode());
// "zurück" goes where the reviewer came from. // "zurück" goes where the reviewer came from.
$this->assertSame(self::LIST_URL, $crawler->filter('a.btn')->first()->attr('href')); $this->assertSame(self::LIST_URL, $crawler->filter('[data-qa-back-link]')->attr('href'));
foreach (['send-receipt', 'send-follow-up'] as $action) { foreach (['send-receipt', 'send-follow-up'] as $action) {
$button = $crawler->filter(sprintf('button[hx-get*="%s"]', $action)); $button = $crawler->filter(sprintf('button[hx-get*="%s"]', $action));
@@ -77,7 +77,7 @@ class DetailControllerTest extends WebTestCase
$this->assertSame(Response::HTTP_OK, $this->client->getResponse()->getStatusCode()); $this->assertSame(Response::HTTP_OK, $this->client->getResponse()->getStatusCode());
// Dropped rather than emitted empty, so the controllers fall back to the list route. // Dropped rather than emitted empty, so the controllers fall back to the list route.
$this->assertStringNotContainsString('r=', $crawler->filter('button[hx-get*="send-receipt"]')->attr('hx-get')); $this->assertStringNotContainsString('r=', $crawler->filter('button[hx-get*="send-receipt"]')->attr('hx-get'));
$this->assertSame(self::LIST_URL, $crawler->filter('a.btn')->first()->attr('href')); $this->assertSame(self::LIST_URL, $crawler->filter('[data-qa-back-link]')->attr('href'));
} }
private function submission(): ApplicationFormSubmission private function submission(): ApplicationFormSubmission