feat: replace some partials with twig components
This commit is contained in:
@@ -30,22 +30,24 @@
|
||||
</div>
|
||||
{% if assignment.pickup %}
|
||||
{% set pickup = assignment.destination.pickup(assignment.pickup) %}
|
||||
<div class="py-6 first:pt-0 last:pb-0 sm:grid sm:grid-cols-3 sm:gap-4">
|
||||
<dt class="text-sm font-bold leading-6 text-gray-900">
|
||||
Busbegleitung
|
||||
</dt>
|
||||
<dd class="mt-1 text-sm leading-6 text-gray-700 sm:col-span-2 sm:mt-0">
|
||||
ab {{ pickup.city }}, {{ pickup.street }}
|
||||
</dd>
|
||||
</div>
|
||||
<div class="py-6 first:pt-0 last:pb-0 sm:grid sm:grid-cols-3 sm:gap-4">
|
||||
<dt class="text-sm font-bold leading-6 text-gray-900">
|
||||
Busabfahrt
|
||||
</dt>
|
||||
<dd class="mt-1 text-sm leading-6 text-gray-700 sm:col-span-2 sm:mt-0">
|
||||
{{ pickup.time }} Uhr
|
||||
</dd>
|
||||
</div>
|
||||
{% if pickup is not null %}
|
||||
<div class="py-6 first:pt-0 last:pb-0 sm:grid sm:grid-cols-3 sm:gap-4">
|
||||
<dt class="text-sm font-bold leading-6 text-gray-900">
|
||||
Busbegleitung
|
||||
</dt>
|
||||
<dd class="mt-1 text-sm leading-6 text-gray-700 sm:col-span-2 sm:mt-0">
|
||||
ab {{ pickup.city }}, {{ pickup.street }}
|
||||
</dd>
|
||||
</div>
|
||||
<div class="py-6 first:pt-0 last:pb-0 sm:grid sm:grid-cols-3 sm:gap-4">
|
||||
<dt class="text-sm font-bold leading-6 text-gray-900">
|
||||
Busabfahrt
|
||||
</dt>
|
||||
<dd class="mt-1 text-sm leading-6 text-gray-700 sm:col-span-2 sm:mt-0">
|
||||
{{ pickup.time }} Uhr
|
||||
</dd>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% if application is defined and application is not null and application.pickup is not null %}
|
||||
<div class="py-6 first:pt-0 last:pb-0 sm:grid sm:grid-cols-3 sm:gap-4">
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
<dl class="divide-y divide-gray-100">
|
||||
{% for item in items %}
|
||||
<div class="py-6 first:pt-0 last:pb-0 sm:grid sm:grid-cols-3 sm:gap-4">
|
||||
<dt class="text-sm font-bold leading-6 text-gray-900">
|
||||
{{ item.type }}
|
||||
</dt>
|
||||
<dd class="mt-1 text-sm leading-6 text-gray-700 sm:col-span-2 sm:mt-0">
|
||||
{{ item.description }}
|
||||
</dd>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</dl>
|
||||
@@ -1,4 +0,0 @@
|
||||
<div class="flex items-start space-x-4 bg-red-600 text-white p-4 rounded-md w-full">
|
||||
{{ icon('alert', 'w-6 h-6 shrink-0') }}
|
||||
<span>{{ message }}</span>
|
||||
</div>
|
||||
@@ -1,4 +0,0 @@
|
||||
<div class="flex items-start space-x-4 bg-primary text-white p-4 rounded-md w-full">
|
||||
{{ icon('info', 'w-6 h-6 shrink-0') }}
|
||||
<span>{{ message }}</span>
|
||||
</div>
|
||||
@@ -1,6 +0,0 @@
|
||||
{% set averageRating = teamer.averageRating %}
|
||||
<div class="inline-flex items-center"{% if teamer.averageRating %}{{ stimulus_controller('tooltip', { content: averageRating|format_rating|raw, placement: 'top' }) }}{% endif %}>
|
||||
{% for grade in range(1, 5) %}
|
||||
{{ icon('star', html_classes('w-4 h-4', { 'text-gray-200': averageRating < grade * 100, 'text-primary': averageRating >= grade * 100 })) }}
|
||||
{% endfor %}
|
||||
</div>
|
||||
@@ -47,7 +47,7 @@
|
||||
<span>{{ application.teamer }}</span>
|
||||
{{ icon('info', 'w-4 h-4') }}
|
||||
</button>
|
||||
{% include '_partials/_rating_stars.html.twig' with { 'teamer': application.teamer } %}
|
||||
<twig:RatingStars averageRating="{{ application.teamer.averageRating }}" />
|
||||
</td>
|
||||
<td>
|
||||
{{ application.pickup|bpn_pickup_label|default('-') }}
|
||||
@@ -138,7 +138,7 @@
|
||||
<span>{{ disposition.teamer }}</span>
|
||||
{{ icon('info', 'w-4 h-4') }}
|
||||
</button>
|
||||
{% include '_partials/_rating_stars.html.twig' with { 'teamer': disposition.teamer } %}
|
||||
<twig:RatingStars averageRating="{{ disposition.teamer.averageRating }}" />
|
||||
</td>
|
||||
<td>
|
||||
{{ disposition.remarks|nl2br|default('-') }}
|
||||
|
||||
@@ -149,40 +149,38 @@
|
||||
hx-target="body"
|
||||
hx-swap="beforeend">
|
||||
<span class="whitespace-nowrap">{{ disposition.teamer }}</span>
|
||||
{% include '_partials/_rating_stars.html.twig' with { 'teamer': disposition.teamer } %}
|
||||
<twig:RatingStars averageRating="{{ disposition.teamer.averageRating }}" />
|
||||
</div>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</td>
|
||||
<td>
|
||||
{% embed '_partials/_dropdown.html.twig' %}
|
||||
{% block items %}
|
||||
<button type="button"
|
||||
class="text-red-500 hover:text-primary block px-4 py-2 text-sm w-full text-left"
|
||||
role="menuitem"
|
||||
tabindex="-1"
|
||||
hx-get="{{ path('app_administrative_assignment_delete', { 'uuid': assignment.uuid }) }}"
|
||||
hx-target="body"
|
||||
hx-swap="beforeend">
|
||||
löschen
|
||||
</button>
|
||||
<a href="{{ path('app_administrative_assignment_duplicate', { 'uuid': assignment.uuid, 'r': return_url() }) }}"
|
||||
<twig:DropDown>
|
||||
<button type="button"
|
||||
class="text-red-500 hover:text-primary block px-4 py-2 text-sm w-full text-left"
|
||||
role="menuitem"
|
||||
tabindex="-1"
|
||||
hx-get="{{ path('app_administrative_assignment_delete', { 'uuid': assignment.uuid }) }}"
|
||||
hx-target="body"
|
||||
hx-swap="beforeend">
|
||||
löschen
|
||||
</button>
|
||||
<a href="{{ path('app_administrative_assignment_duplicate', { 'uuid': assignment.uuid, 'r': return_url() }) }}"
|
||||
class="text-gray-700 hover:text-primary block px-4 py-2 text-sm"
|
||||
role="menuitem"
|
||||
tabindex="-1">
|
||||
duplizieren
|
||||
</a>
|
||||
{% if is_granted('EDIT', assignment) %}
|
||||
<a href="{{ path('app_administrative_assignment_edit', { 'uuid': assignment.uuid, 'r': return_url() }) }}"
|
||||
class="text-gray-700 hover:text-primary block px-4 py-2 text-sm"
|
||||
role="menuitem"
|
||||
tabindex="-1">
|
||||
duplizieren
|
||||
bearbeiten
|
||||
</a>
|
||||
{% if is_granted('EDIT', assignment) %}
|
||||
<a href="{{ path('app_administrative_assignment_edit', { 'uuid': assignment.uuid, 'r': return_url() }) }}"
|
||||
class="text-gray-700 hover:text-primary block px-4 py-2 text-sm"
|
||||
role="menuitem"
|
||||
tabindex="-1">
|
||||
bearbeiten
|
||||
</a>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
{% endembed %}
|
||||
{% endif %}
|
||||
</twig:DropDown>
|
||||
</td>
|
||||
</tr>
|
||||
{% else %}
|
||||
|
||||
@@ -66,7 +66,7 @@
|
||||
{{ icon('user', 'w-10 h-10 text-gray-200') }}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% include '_partials/_rating_stars.html.twig' with { 'teamer': teamer } %}
|
||||
<twig:RatingStars averageRating="{{ teamer.averageRating }}" />
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
{{ icon('user', 'w-32 h-32 text-gray-200') }}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% include '_partials/_rating_stars.html.twig' with { 'teamer': teamer } %}
|
||||
<twig:RatingStars averageRating="{{ teamer.averageRating }}"/>
|
||||
<ul class="pb-8 divide-y divide-gray-200">
|
||||
{% if teamer.communication.phone %}
|
||||
<li class="py-2">
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<div class="hidden group-hover:block absolute right-0 top-0 z-10 w-56 origin-top-right pt-4" role="menu" aria-orientation="vertical" aria-labelledby="menu-button" tabindex="-1">
|
||||
<div class="rounded-md bg-white shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none">
|
||||
<div class="py-1 menu menu--pulldown" role="none">
|
||||
{% block items %}{% endblock %}
|
||||
{% block content %}{% endblock %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,4 @@
|
||||
<div class="{{ html_classes('flex items-start space-x-4 text-white p-4 rounded-md w-full', { 'bg-primary': type != 'error', 'bg-red-500': type == 'error' }) }}">
|
||||
{{ icon(type == 'error' ? 'alert' : 'info', 'w-6 h-6 shrink-0') }}
|
||||
<span>{{ message }}</span>
|
||||
</div>
|
||||
@@ -0,0 +1,5 @@
|
||||
<div class="inline-flex items-center"{% if averageRating %}{{ stimulus_controller('tooltip', { content: averageRating|format_rating|raw, placement: 'top' }) }}{% endif %}>
|
||||
{% for grade in range(1, 5) %}
|
||||
{{ icon('star', html_classes('w-4 h-4', { 'text-gray-200': averageRating < grade * 100, 'text-primary': averageRating >= grade * 100 })) }}
|
||||
{% endfor %}
|
||||
</div>
|
||||
@@ -15,28 +15,20 @@
|
||||
{% include '_partials/_assignment_requirements_info.html.twig' %}
|
||||
<div class="flex flex-col items-start space-y-4">
|
||||
{% if disposition is not null %}
|
||||
{% include '_partials/_infobox.html.twig' with {
|
||||
'message': 'Du wurdest am ' ~ disposition.createdAt|date('d.m.Y') ~ ' für diesen Einsatz eingeteilt.'
|
||||
} %}
|
||||
<twig:MessageBox message="Du wurdest am {{ disposition.createdAt|date('d.m.Y') }} für diesen Einsatz eingeteilt."/>
|
||||
{% elseif application is not null %}
|
||||
{% if application.status == constant('App\\Entity\\Application::STATUS_REJECTED') %}
|
||||
{% include '_partials/_errorbox.html.twig' with {
|
||||
'message': 'Deine Bewerbung wurde leider abgelehnt.'
|
||||
} %}
|
||||
<twig:MessageBox message="Deine Bewerbung wurde leider abgelehnt." type="error"/>
|
||||
{% if application.comment and application.commentVisible %}
|
||||
<strong>Begründung:</strong> {{ application.comment|nl2br}}
|
||||
{% endif %}
|
||||
{% elseif application.status == constant('App\\Entity\\Application::STATUS_PENDING') %}
|
||||
{% include '_partials/_infobox.html.twig' with {
|
||||
'message': 'Deine Bewerbung befindet sich in Bearbeitung.'
|
||||
} %}
|
||||
<twig:MessageBox message="Deine Bewerbung befindet sich in Bearbeitung."/>
|
||||
{% if application.comment and application.commentVisible %}
|
||||
<strong>Begründung:</strong> {{ application.comment|nl2br}}
|
||||
{% endif %}
|
||||
{% else %}
|
||||
{% include '_partials/_infobox.html.twig' with {
|
||||
'message': 'Du hast dich am ' ~ application.createdAt|date('d.m.Y') ~ ' auf diesen Einsatz beworben.'
|
||||
} %}
|
||||
<twig:MessageBox message="Du hast dich am {{ application.createdAt|date('d.m.Y') }} auf diesen Einsatz beworben."/>
|
||||
<button type="button"
|
||||
class="btn btn--secondary"
|
||||
title="Bewerbung zurückziehen"
|
||||
|
||||
@@ -21,10 +21,12 @@
|
||||
</div>
|
||||
{% if assignment.pickup %}
|
||||
{% set pickup = assignment.destination.pickup(assignment.pickup) %}
|
||||
<div class="flex items-start space-x-2">
|
||||
{{ icon('bus', 'w-5 h-5 shrink-0') }}
|
||||
<span>{{ pickup.city }}, {{ pickup.time }} Uhr</span>
|
||||
</div>
|
||||
{% if pickup is not null %}
|
||||
<div class="flex items-start space-x-2">
|
||||
{{ icon('bus', 'w-5 h-5 shrink-0') }}
|
||||
<span>{{ pickup.city }}, {{ pickup.time }} Uhr</span>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</div>
|
||||
<a href="{{ path('app_teamer_disposition_detail', { 'uuid': disposition.uuid, 'r': return_url() }) }}"
|
||||
|
||||
@@ -33,9 +33,7 @@
|
||||
{# Existing upload has been rejected #}
|
||||
{% set contract = disposition.documentByType('contract') %}
|
||||
{% if contract and contract.status == constant('App\\Entity\\Upload::STATUS_REJECTED') %}
|
||||
{% include '_partials/_errorbox.html.twig' with {
|
||||
'message': 'Dein Honorarvertrag muss überarbeitet werden'
|
||||
} %}
|
||||
<twig:MessageBox message="Dein Honorarvertrag muss überarbeitet werden" type="error"/>
|
||||
{% if contract.comment %}
|
||||
<div class="py-2">
|
||||
<strong>Begründung:</strong> {{ contract.comment|nl2br }}
|
||||
@@ -68,7 +66,7 @@
|
||||
{{ form_end(form) }}
|
||||
{% else %}
|
||||
{% for blocker in workflow_transition_blockers(disposition, 'upload_contract') %}
|
||||
{% include '_partials/_infobox.html.twig' with { 'message': blocker.message } %}
|
||||
<twig:MessageBox message="{{ blocker.message }}"/>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
@@ -99,7 +97,7 @@
|
||||
{{ form_end(form) }}
|
||||
{% else %}
|
||||
{% for blocker in workflow_transition_blockers(disposition, 'upload_invoice') %}
|
||||
{% include '_partials/_infobox.html.twig' with { 'message': blocker.message } %}
|
||||
<twig:MessageBox message="{{ blocker.message }}"/>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
@@ -116,9 +114,7 @@
|
||||
{# Existing upload is being checked #}
|
||||
{% set contract = disposition.documentByType('contract') %}
|
||||
{% if contract and contract.status == constant('App\\Entity\\Upload::STATUS_PENDING') %}
|
||||
{% include '_partials/_infobox.html.twig' with {
|
||||
'message': 'Dein Honorarvertrag befindet sich in Bearbeitung'
|
||||
} %}
|
||||
<twig:MessageBox message="Dein Honorarvertrag befindet sich in Bearbeitung"/>
|
||||
{% if contract.comment %}
|
||||
<div class="py-2">
|
||||
<strong>Begründung:</strong> {{ contract.comment|nl2br }}
|
||||
|
||||
Reference in New Issue
Block a user