fix: prevent generating offer links while booking is in draft
This commit is contained in:
@@ -212,42 +212,48 @@
|
||||
|
||||
<div class="mt-6 border-t border-gray-200 pt-6">
|
||||
<h2 class="text-lg font-bold mb-2">Zugangslink</h2>
|
||||
{% if accessLink %}
|
||||
<button type="button"
|
||||
class="button button--secondary button--small"
|
||||
data-controller="clipboard"
|
||||
data-clipboard-content-value="{{ accessLink }}"
|
||||
data-clipboard-label-value="Kopiert!"
|
||||
data-action="clipboard#copy">
|
||||
{{ icon('copy', 'w-4 h-4') }} Link kopieren
|
||||
</button>
|
||||
<p class="text-xs text-gray-500 mt-1">
|
||||
Gültig bis {{ accessLinkExpiresAt | date('d.m.Y') }}
|
||||
{% if accessLinkExpiresAt < date() %}
|
||||
<span class="text-red-600 font-medium">(abgelaufen)</span>
|
||||
{% endif %}
|
||||
{% if not booking.customerAccessible %}
|
||||
<p class="text-sm text-gray-500">
|
||||
Ein Zugangslink wird beim Versand des Angebots erzeugt und kann erst danach erneuert werden.
|
||||
</p>
|
||||
{% else %}
|
||||
<p class="text-sm text-gray-500">Es wurde noch kein Zugangslink generiert.</p>
|
||||
{% endif %}
|
||||
<div class="mt-2 flex items-center gap-2">
|
||||
<button type="button"
|
||||
class="button button--secondary button--small"
|
||||
hx-get="{{ path('app_admin_accommodationbooking_generate_access_link', { id: booking.id }) }}"
|
||||
hx-target="body"
|
||||
hx-swap="beforeend">
|
||||
{{ accessLink ? 'Link erneut generieren' : 'Link generieren' }}
|
||||
</button>
|
||||
{% if accessLink %}
|
||||
<button type="button"
|
||||
class="button button--secondary button--small"
|
||||
hx-get="{{ path('app_admin_accommodationbooking_send_access_link', { id: booking.id }) }}"
|
||||
data-controller="clipboard"
|
||||
data-clipboard-content-value="{{ accessLink }}"
|
||||
data-clipboard-label-value="Kopiert!"
|
||||
data-action="clipboard#copy">
|
||||
{{ icon('copy', 'w-4 h-4') }} Link kopieren
|
||||
</button>
|
||||
<p class="text-xs text-gray-500 mt-1">
|
||||
Gültig bis {{ accessLinkExpiresAt | date('d.m.Y') }}
|
||||
{% if accessLinkExpiresAt < date() %}
|
||||
<span class="text-red-600 font-medium">(abgelaufen)</span>
|
||||
{% endif %}
|
||||
</p>
|
||||
{% else %}
|
||||
<p class="text-sm text-gray-500">Es wurde noch kein Zugangslink generiert.</p>
|
||||
{% endif %}
|
||||
<div class="mt-2 flex items-center gap-2">
|
||||
<button type="button"
|
||||
class="button button--secondary button--small"
|
||||
hx-get="{{ path('app_admin_accommodationbooking_generate_access_link', { id: booking.id }) }}"
|
||||
hx-target="body"
|
||||
hx-swap="beforeend">
|
||||
Link senden
|
||||
{{ accessLink ? 'Link erneut generieren' : 'Link generieren' }}
|
||||
</button>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% if accessLink %}
|
||||
<button type="button"
|
||||
class="button button--secondary button--small"
|
||||
hx-get="{{ path('app_admin_accommodationbooking_send_access_link', { id: booking.id }) }}"
|
||||
hx-target="body"
|
||||
hx-swap="beforeend">
|
||||
Link senden
|
||||
</button>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="flex justify-between pt-8">
|
||||
|
||||
Reference in New Issue
Block a user