Feat: Streamline layout for teamer

This commit is contained in:
Björn Fromme
2023-10-20 13:54:52 +02:00
parent b0bf854b97
commit 004b189be9
6 changed files with 99 additions and 156 deletions
@@ -43,6 +43,7 @@ class IndexController extends AbstractController
); );
return $this->render('teamer/application/index.html.twig', [ return $this->render('teamer/application/index.html.twig', [
'teamer' => $teamer,
'pagination' => $pagination, 'pagination' => $pagination,
]); ]);
} }
@@ -43,6 +43,7 @@ class RecentController extends AbstractController
); );
return $this->render('teamer/disposition/recent.html.twig', [ return $this->render('teamer/disposition/recent.html.twig', [
'teamer' => $teamer,
'pagination' => $pagination, 'pagination' => $pagination,
]); ]);
} }
@@ -43,6 +43,7 @@ class UpcomingController extends AbstractController
); );
return $this->render('teamer/disposition/upcoming.html.twig', [ return $this->render('teamer/disposition/upcoming.html.twig', [
'teamer' => $teamer,
'pagination' => $pagination, 'pagination' => $pagination,
]); ]);
} }
+39 -71
View File
@@ -6,92 +6,60 @@
<h1 class="text-2xl font-bold pb-8"> <h1 class="text-2xl font-bold pb-8">
Meine offenen Bewerbungen Meine offenen Bewerbungen
</h1> </h1>
<div class="data-table-wrapper"> <div class="grid sm:grid-cols-2 md:grid-cols-3 gap-4 pb-4">
<div class="data-table-wrapper__inner">
<table class="data-table">
<thead>
<tr>
<th>
{{ knp_pagination_sortable(pagination, 'Einsatz&shy;beginn', 'assignment.dateFrom') }}
</th>
<th>
{{ knp_pagination_sortable(pagination, 'Einsatz&shy;ende', 'assignment.dateTo') }}
</th>
<th>
{{ knp_pagination_sortable(pagination, 'Jobprofil', 'assignment.jobProfile') }}
</th>
<th>
{{ knp_pagination_sortable(pagination, 'Destination', 'destination.dateFrom') }}
</th>
<th>
{{ knp_pagination_sortable(pagination, 'Busbegleitung', 'assignment.pickup') }}
</th>
<th>
{{ knp_pagination_sortable(pagination, 'Status', 'application.status') }}
</th>
<th></th>
</tr>
</thead>
<tbody>
{% for application in pagination %} {% for application in pagination %}
{% set assignment = application.assignment %} {% set assignment = application.assignment %}
<tr> <div class="relative flex flex-col justify-between rounded-md border border-gray-200 bg-gray-100 p-4">
<td> <div class="flex flex-col space-y-2 pb-2">
{% set dateFrom = assignment.dateFrom ? assignment.dateFrom : assignment.destination.dateFrom %} <div class="flex items-start space-x-2">
{{ dateFrom|date('d.m.Y') }} {{ icon('flag-' ~ assignment.destination.country, 'w-5 h-5 shrink-0') }}
</td> <span class="flex-1 font-bold">{{ assignment.destination.product }}</span>
<td> </div>
{% set dateTo = assignment.dateTo ? assignment.dateTo : assignment.destination.dateTo %} <div class="flex items-start space-x-2">
{{ dateTo|date('d.m.Y') }} {{ icon('calendar', 'w-5 h-5 shrink-0') }}
</td> <span class="flex-1">{{ assignment.effectivePeriod.start|date('d.m.Y') }} - {{ assignment.effectivePeriod.end|date('d.m.Y') }}</span>
<td> </div>
{{ assignment.jobProfile.name }} <div class="flex items-start space-x-2">
</td> {{ icon('profile', 'w-5 h-5 shrink-0') }}
<td> <span class="flex-1">{{ assignment.jobProfile.name }}</span>
{{ assignment.destination.product }} </div>
<br> <div class="flex items-start space-x-2">
{{ assignment.destination.hotel }} {{ icon('house', 'w-5 h-5 shrink-0') }}
</td> <span class="flex-1">{{ assignment.destination.hotel }}</span>
<td> </div>
{{ assignment.pickup ? assignment.pickup|bpn_pickup_label|default('-') : '-' }} {% if assignment.pickup %}
<br> <div class="flex items-start space-x-2">
{{ assignment.pickupDate ? assignment.pickupDate|date('d.m.Y') : '' }} {{ icon('bus', 'w-5 h-5 shrink-0') }}
</td> <span>{{ assignment.pickup|bpn_pickup_label|default('-') }} {{ assignment.effectivePickupDate ? assignment.effectivePickupDate|date('d.m.Y') : '' }}</span>
<td> </div>
{{ ('label.application.status.' ~ application.status)|trans }}
</td>
<td>
<div class="flex items-center space-x-1 justify-end">
{% if is_granted('VIEW', application) %}
<a href="{{ path('app_teamer_assignment', { 'uuid': assignment.uuid, 'r': return_url() }) }}">
{{ icon('info', 'w-5 h-5') }}
</a>
{% endif %} {% endif %}
</div>
<div class="flex flex-col space-y-2">
<a href="{{ path('app_teamer_assignment', { 'uuid': assignment.uuid, 'r': return_url() }) }}"
class="btn btn--small flex items-center space-x-2">
{{ icon('info', 'w-4 h-4 shrink-0') }}
<span>Details</span>
</a>
{% if is_granted('DELETE', application) %} {% if is_granted('DELETE', application) %}
<button type="button" <button type="button"
title="Bewerbung löschen" title="Bewerbung löschen"
class="btn btn--small bg-red-100 text-red-800 hover:bg-red-50"
{{ stimulus_controller('modal-button', [], [], {'confirmation-modal': '#confirmation-modal'}) }} {{ stimulus_controller('modal-button', [], [], {'confirmation-modal': '#confirmation-modal'}) }}
{{ stimulus_action('modal-button', 'confirmation', null, { {{ stimulus_action('modal-button', 'confirmation', null, {
'title': 'Bist du sicher?', 'title': 'Bist du sicher?',
'content': 'Möchtest du die Bewerbing wirklich zurückziehen/löschen?', 'content': 'Möchtest du die Bewerbing wirklich zurückziehen/löschen?',
'target-url': path('app_teamer_application_delete', { 'uuid': application.uuid }) 'target-url': path('app_teamer_application_delete', { 'uuid': application.uuid })
}) }}> }) }}>
{{ icon('delete', 'w-5 h-5 text-red-500') }} {{ icon('delete', 'w-4 h-4 shrink-0') }}
<span>Löschen</span>
</button> </button>
{% endif %} {% endif %}
</div> </div>
</td> {% if teamer.bookmarks.contains(assignment) %}
</tr> {{ icon('star', 'w-5 h-5 text-yellow-500 absolute top-0 right-0 mt-2 mr-2') }}
{% else %} {% endif %}
<tr> </div>
<td colspan="6">
Keine Daten...
</td>
</tr>
{% endfor %} {% endfor %}
</tbody>
</table>
{{ knp_pagination_render(pagination) }}
</div>
</div> </div>
{{ knp_pagination_render(pagination, 'paginator/sliding_boxes.html.twig') }}
{% endblock %} {% endblock %}
+34 -62
View File
@@ -1,68 +1,40 @@
<div class="data-table-wrapper"> <div class="grid sm:grid-cols-2 md:grid-cols-3 gap-4 pb-4">
<div class="data-table-wrapper__inner">
<table class="data-table">
<thead>
<tr>
<th>
{{ knp_pagination_sortable(pagination, 'Einsatz&shy;beginn', 'assignment.dateFrom') }}
</th>
<th>
{{ knp_pagination_sortable(pagination, 'Einsatz&shy;ende', 'assignment.dateTo') }}
</th>
<th>
{{ knp_pagination_sortable(pagination, 'Jobprofil', 'assignment.jobProfile') }}
</th>
<th>
{{ knp_pagination_sortable(pagination, 'Destination', 'destination.dateFrom') }}
</th>
<th>
{{ knp_pagination_sortable(pagination, 'Busbegleitung ab', 'assignment.pickup') }}
</th>
<th></th>
</tr>
</thead>
<tbody>
{% for disposition in pagination %} {% for disposition in pagination %}
{% set assignment = disposition.assignment %} {% set assignment = disposition.assignment %}
<tr> <div class="relative flex flex-col justify-between rounded-md border border-gray-200 bg-gray-100 p-4">
<td> <div class="flex flex-col space-y-2 pb-2">
{% set dateFrom = assignment.dateFrom ? assignment.dateFrom : assignment.destination.dateFrom %} <div class="flex items-start space-x-2">
{{ dateFrom|date('d.m.Y') }} {{ icon('flag-' ~ assignment.destination.country, 'w-5 h-5 shrink-0') }}
</td> <span class="flex-1 font-bold">{{ assignment.destination.product }}</span>
<td> </div>
{% set dateTo = assignment.dateTo ? assignment.dateTo : assignment.destination.dateTo %} <div class="flex items-start space-x-2">
{{ dateTo|date('d.m.Y') }} {{ icon('calendar', 'w-5 h-5 shrink-0') }}
</td> <span class="flex-1">{{ assignment.effectivePeriod.start|date('d.m.Y') }} - {{ assignment.effectivePeriod.end|date('d.m.Y') }}</span>
<td> </div>
{{ assignment.jobProfile.name }} <div class="flex items-start space-x-2">
</td> {{ icon('profile', 'w-5 h-5 shrink-0') }}
<td> <span class="flex-1">{{ assignment.jobProfile.name }}</span>
{{ assignment.destination.product }} </div>
<br> <div class="flex items-start space-x-2">
{{ assignment.destination.hotel }} {{ icon('house', 'w-5 h-5 shrink-0') }}
</td> <span class="flex-1">{{ assignment.destination.hotel }}</span>
<td> </div>
{{ assignment.pickup ? assignment.pickup|bpn_pickup_label|default('-') : '-' }} {% if assignment.pickup %}
<br> <div class="flex items-start space-x-2">
{{ assignment.pickupDate ? assignment.pickupDate|date('d.m.Y') : '' }} {{ icon('bus', 'w-5 h-5 shrink-0') }}
</td> <span>{{ assignment.pickup|bpn_pickup_label|default('-') }} {{ assignment.effectivePickupDate ? assignment.effectivePickupDate|date('d.m.Y') : '' }}</span>
<td> </div>
<div class="flex items-center space-x-1 justify-end"> {% endif %}
<a href="{{ path('app_teamer_disposition_detail', { 'uuid': disposition.uuid, 'r': return_url() }) }}"> </div>
{{ icon('info', 'w-5 h-5') }} <a href="{{ path('app_teamer_disposition_detail', { 'uuid': disposition.uuid, 'r': return_url() }) }}"
class="btn btn--small flex items-center space-x-2">
{{ icon('info', 'w-4 h-4 shrink-0') }}
<span>Details</span>
</a> </a>
{% if teamer.bookmarks.contains(assignment) %}
{{ icon('star', 'w-5 h-5 text-yellow-500 absolute top-0 right-0 mt-2 mr-2') }}
{% endif %}
</div> </div>
</td>
</tr>
{% else %}
<tr>
<td colspan="6">
Keine Daten...
</td>
</tr>
{% endfor %} {% endfor %}
</tbody>
</table>
{{ knp_pagination_render(pagination) }}
</div>
</div> </div>
{{ knp_pagination_render(pagination, 'paginator/sliding_boxes.html.twig') }}
+2 -2
View File
@@ -58,13 +58,13 @@
{% set label = 'eingeteilt' %} {% set label = 'eingeteilt' %}
{% else %} {% else %}
{% set icon = 'info' %} {% set icon = 'info' %}
{% set class = 'btn--info' %} {% set class = '' %}
{% set url = path('app_teamer_assignment', { 'uuid': assignment.uuid, 'r': return_url() }) %} {% set url = path('app_teamer_assignment', { 'uuid': assignment.uuid, 'r': return_url() }) %}
{% set label = 'bewerben' %} {% set label = 'bewerben' %}
{% endif %} {% endif %}
<a href="{{ url }}" <a href="{{ url }}"
class="btn btn--small flex items-center space-x-2 {{ class }}"> class="btn btn--small flex items-center space-x-2 {{ class }}">
{{ icon(icon, 'w-4 h-4') }} {{ icon(icon, 'w-4 h-4 shrink-0') }}
<span>{{ label }}</span> <span>{{ label }}</span>
</a> </a>
</div> </div>