WIP Improve dates table layout

This commit is contained in:
Björn Fromme
2021-10-13 16:17:37 +02:00
parent ce107a4aa6
commit 00bcddf98b
@@ -40,31 +40,32 @@
</f:if>
</f:if>
<table class="w-full border-collapse mb-4">
<table class="w-full border border-gray-300 border-collapse mb-4">
<thead>
<tr>
<th class="p-1 text-left">
<tr class="bg-gray-100">
<th class="border border-gray-300 px-2 py-1 md:p-2 text-left text-sm md:text-base">
Termin
</th>
<th class="p-1 text-left">
<th class="border border-gray-300 px-2 py-1 md:p-2 text-sm md:text-base">
Nächte
</th>
<th class="p-1 text-left">
<th class="border border-gray-300 px-2 py-1 md:p-2 text-sm md:text-base">
inklusive
</th>
<th class="p-1 text-left">
Preis
<th class="border border-gray-300 px-2 py-1 md:p-2 text-sm md:text-base">
ab
</th>
<th></th>
</tr>
</thead>
<tbody>
<f:for each="{dates}" as="row" iteration="iteration">
<tr class="odd:bg-gray-100{f:if(condition: '{iteration.cycle} > 5', then: ' hidden')}"
<tr class="hover:bg-gray-100{f:if(condition: '{iteration.cycle} > 5', then: ' hidden')}"
data-pricetable-target="row">
<td class="px-2 py-1 md:p-2">
<td class="border border-gray-300 px-2 py-1 md:p-2">
<f:if condition="{bookable} && {row.available} && {row.showBookingButton}">
<f:then>
<button class="text-left text-ep-primary-light text-sm md:text-base whitespace-nowrap"
<button class="text-left text-ep-primary-light text-sm md:text-base"
data-action="product-details#loadPrices"
data-date-uid="{row.dateUid}">
{row.dateStart} - {row.dateEnd}
@@ -74,81 +75,78 @@
<span class="block text-sm md:text-base{f:if(condition: row.available, else: ' line-through')}">
{row.dateStart} - {row.dateEnd}
</span>
<f:if condition="{row.available}">
<f:else>
<span class="block text-sm">ausgebucht</span>
</f:else>
</f:if>
</f:else>
</f:if>
</td>
<td class="px-2 py-1 md:p-2">
<td class="border border-gray-300 px-2 py-1 md:p-2 text-center">
<span class="block text-sm md:text-base">
{row.nights}
</span>
</td>
<td class="px-2 py-1 md:p-2">
<div class="flex items-center space-x-2">
<td class="border border-gray-300 px-2 p-1">
<div class="flex flex-wrap items-center">
<f:if condition="{row.busIncluded}">
<span data-cooltipz-dir="top"
aria-label="Busfahrt"
<span class="block p-1"
data-cooltipz-dir="top"
aria-label="Busfahrt inklusive"
role="tooltip"
data-pricetable-target="busIcon"
data-bus-included="{row.busIncluded}"
data-bus-price="{row.busPrice}">
<svg class="w-5 h-5">
<svg class="w-4 h-4 md:w-5 md:h-5">
<use href="#icon-bus"></use>
</svg>
</span>
</f:if>
<f:if condition="{row.skipassIncluded}">
<span data-cooltipz-dir="top"
<span class="block p-1"
data-cooltipz-dir="top"
aria-label="{f:if(condition: row.summer, then: 'Bergbahnticket inklusive', else: 'Skipass inklusive')}"
role="tooltip">
<svg class="w-5 h-5">
<svg class="w-4 h-4 md:w-5 md:h-5">
<use href="#icon-tag"></use>
</svg>
</span>
</f:if>
<button type="button"
<button class="text-ep-primary col-span-2 text-sm md:text-base text-left leading-none whitespace-nowrap p-1"
type="button"
data-action="pricetable#openModal"
data-type="services"
data-uid="{row.dateUid}"
data-cooltipz-dir="top"
aria-label="Alle Inklusivleistungen anzeigen">
<svg class="w-5 h-5">
<use href="#icon-info-circle"></use>
</svg>
Details &gt;
</button>
</div>
</td>
<td class="px-2 py-1 md:p-2">
<td class="border border-gray-300 px-2 py-1 md:p-2 text-center">
<f:if condition="{row.pseudoPrice}">
<span class="block text-sm line-through">
{row.pseudoPrice} €
</span>
</f:if>
<span class="font-bold normal-case whitespace-nowrap"
data-pricetable-target="price"
data-room="{row.minPrice}"
data-bus="{row.busPrice}"
data-discount="{row.discount}">
{row.minPrice}
</span>
</td>
<td class="border border-gray-300 px-2 py-1 md:p-2 text-center">
<f:if condition="{row.showBookingButton}">
<f:then>
<button type="button"
class="button w-full{f:if(condition: row.available, then: '', else: ' button--muted line-through')}"
class="button button--small{f:if(condition: row.available, then: '', else: ' button--muted')}"
data-action="product-details#loadPrices"
data-date-uid="{row.dateUid}">
<f:if condition="{row.pseudoPrice}">
<span class="block text-sm line-through">
ab {row.pseudoPrice} €
</span>
</f:if>
<span class="font-bold normal-case whitespace-nowrap">
ab
<span data-pricetable-target="price"
data-room="{row.minPrice}"
data-bus="{row.busPrice}"
data-discount="{row.discount}">
{row.minPrice}
</span>
</span>
Details
</button>
</f:then>
<f:else>
<a href="{f:uri.typolink(parameter: settings.travelAlertPageUid)}"
title="Reisen-Alert"
class="button button--small bg-gray-300">
class="button button--small button--muted">
Reisen-Alert
</a>
</f:else>