Improve dates table layout

This commit is contained in:
Björn Fromme
2021-09-29 18:15:04 +02:00
parent a33647f374
commit 94520a76c2
3 changed files with 60 additions and 78 deletions
@@ -1,5 +1,5 @@
.button {
@apply inline-flex items-center justify-center space-x-2 px-4 py-2 md:px-8;
@apply inline-flex items-center justify-center space-x-2 px-4 py-2 md:px-8 cursor-pointer;
@apply uppercase leading-none text-center;
@apply transition-colors outline-none focus:outline-none;
@apply bg-ep-secondary text-white;
@@ -12,10 +12,9 @@
<div data-controller="pricetable">
<f:if condition="{hasSurcharge} || {hasDiscount}">
<div class="w-full flex justify-end mb-2">
<f:if condition="{hasSurcharge}">
<button data-action="pricetable#toggleSurcharge"
class="flex items-center space-x-1 focus:outline-none text-ep-primary">
class="flex items-center space-x-1 focus:outline-none text-ep-primary mb-2">
<svg class="w-4 h-4">
<use href="#icon-arrow-circle-right"></use>
</svg>
@@ -28,7 +27,7 @@
</f:if>
<f:if condition="{hasDiscount}">
<button data-action="pricetable#toggleDiscount"
class="flex items-center space-x-1 focus:outline-none text-ep-primary">
class="flex items-center space-x-1 focus:outline-none text-ep-primary mb-2">
<svg class="w-4 h-4">
<use href="#icon-arrow-circle-right"></use>
</svg>
@@ -39,7 +38,6 @@
</span>
</button>
</f:if>
</div>
</f:if>
<table class="w-full border-collapse mb-4">
@@ -55,13 +53,13 @@
</svg>
</span>
</th>
<th class="p-1 text-left whitespace-nowrap">
Preis ab
<th class="p-1 text-left">
ab
</th>
<th class="p-1 text-left">
inkl.
</th>
<th class="hidden lg:table-cell"></th>
<th></th>
</tr>
</thead>
<tbody>
@@ -71,43 +69,31 @@
<td class="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"
<button class="text-left text-ep-primary-light text-xs sm:text-sm md:text-base whitespace-nowrap"
data-action="product-details#loadPrices"
data-date-uid="{row.dateUid}">
{row.dateStart} - {row.dateEnd}
</button>
<div class="md:hidden">
<button class="button button--small sm:hidden"
data-action="product-details#loadPrices"
data-date-uid="{row.dateUid}">
Details
</button>
<a href="{row.bookingUrl}" target="_blank"
class="button button--small bg-green-500 border-green-500 sm:hidden">
Buchen
</a>
</div>
</f:then>
<f:else>
<span class="block text-sm md:text-base">
<span class="block text-xs sm:text-sm md:text-base">
{row.dateStart} - {row.dateEnd}
</span>
<span class="block sm:hidden py-1 text-xs sm:text-sm text-gray-500 uppercase">
ausgebucht
</span>
</f:else>
</f:if>
</td>
<td class="px-2 py-1 md:p-2">
<span class="block text-xs sm:text-sm md:text-base">
{row.nights}
</span>
</td>
<td class="px-2 py-1 md:p-2">
<f:if condition="{row.pseudoPrice}">
<span class="text-sm line-through">
<span class="block text-sm line-through">
{row.pseudoPrice} €
</span>
</f:if>
<span class="font-bold text-sm md:text-base"
<span class="font-bold text-xs sm:text-sm md:text-base whitespace-nowrap"
data-pricetable-target="price"
data-room="{row.minPrice}"
data-bus="{row.busPrice}"
@@ -118,7 +104,6 @@
<td class="px-2 py-1 md:p-2">
<div class="flex items-center space-x-2">
<f:if condition="{row.busIncluded}">
<div class="hidden sm:block">
<span data-cooltipz-dir="top"
aria-label="Busfahrt"
role="tooltip"
@@ -129,10 +114,8 @@
<use href="#icon-bus"></use>
</svg>
</span>
</div>
</f:if>
<f:if condition="{row.skipassIncluded}">
<div class="hidden sm:block">
<span data-cooltipz-dir="top"
aria-label="{f:if(condition: row.summer, then: 'Bergbahnticket inklusive', else: 'Skipass inklusive')}"
role="tooltip">
@@ -140,9 +123,8 @@
<use href="#icon-tag"></use>
</svg>
</span>
</div>
</f:if>
<button class="button button--light button--small hidden md:block"
<button class="button button--small bg-ep-primary hidden md:block"
data-action="pricetable#openModal"
data-type="services"
data-uid="{row.dateUid}"
@@ -161,8 +143,8 @@
</button>
</div>
</td>
<td class="px-2 py-1 md:p-2 hidden sm:table-cell">
<div class="grid grid-cols-2 gap-2">
<td class="px-2 py-1 md:p-2">
<div class="grid grid-cols-1 sm:grid-cols-2 gap-2">
<button class="button button--small"
data-action="product-details#loadPrices"
data-date-uid="{row.dateUid}">
@@ -171,7 +153,7 @@
<f:if condition="{row.available} && {row.showBookingButton}">
<a href="{row.bookingUrl}"
target="_blank"
class="button button--small bg-green-500 border-green-500">
class="button button--small bg-green-500">
Buchen
</a>
</f:if>
@@ -198,7 +180,7 @@
</table>
<f:if condition="{dates -> f:count()} > 5 || {altProductLink}">
<div class="w-full flex justify-between pb-4">
<div class="grid grid-cols-1 md:grid-cols-2 gap-2 pb-4">
<f:if condition="{dates -> f:count()} > 5">
<button class="flex items-center space-x-1 focus:outline-none text-ep-primary"
data-action="pricetable#toggleRows">
+1 -1
View File
@@ -44,7 +44,7 @@ module.exports = {
},
extend: {
fontSize: {
'xs': '.6rem',
'xs': '.8rem',
},
colors: {
overlay: {