wip: extend model, admin crud

This commit is contained in:
Björn Fromme committed 2026-07-16 17:13:15 +02:00
1 parent a6ba4fac0d
commit d9f29a5a5a
38 files changed
+1240 -830

No files matched your search

+45 -57
View File
@@ -1,16 +1,31 @@
{% form_theme form 'forms_admin.html.twig' %}
<h2 class="text-xl font-bold">
Allgemein
</h2>
{{ form_start(form) }}
<div class="grid lg:grid-cols-2 gap-y-4 lg:gap-x-8">
{{ form_row(form.name) }}
{{ form_row(form.code) }}
{{ form_row(form.minPaxSummer) }}
{{ form_row(form.maxAdolescentAge) }}
{{ form_row(form.currency) }}
<div class="grid lg:grid-cols-2 lg:gap-x-8 items-start">
<div class="grid lg:grid-cols-2 gap-y-4 lg:gap-x-4">
<div class="lg:col-span-2">
{{ form_row(form.name) }}
</div>
{{ form_row(form.code) }}
{{ form_row(form.minPaxSummer) }}
{{ form_row(form.maxAdolescentAge) }}
{{ form_row(form.currency) }}
</div>
{% if cmsData is defined and cmsData.name is defined %}
<div class="space-y-4">
{% if cmsData.images.resized.m | length > 0 %}
{% set image = cmsData.images.resized.m[0] %}
<div class="max-w-64">
<img src="{{ image.url }}" alt="{{ image.alt }}" class="block w-full h-auto">
</div>
{% endif %}
<div>
<strong>{{ cmsData.name }}</strong>
<br>
{{ cmsData.address | default('-') | nl2br }}
</div>
</div>
{% endif %}
</div>
<div class="flex justify-between pt-8">
<a href="{{ path('app_admin_accommodation') }}" class="button button--secondary button--small">
@@ -39,16 +54,22 @@
<tr>
<th></th>
<th>
Datums-Bereich
von
</th>
<th>
Preis pro Nacht
bis
</th>
<th>
Preis weitere Person
Saison
</th>
<th>
Mindestbelegung (Nächte)
Pax bis
</th>
<th>
Mindestmiete pro Nacht
</th>
<th>
weitere Personen pro Nacht
</th>
<th>
Unterbelegung
@@ -61,7 +82,16 @@
<tr>
<td></td>
<td>
{{ price.dateFrom | date('d.m.Y') }} - {{ price.dateTo | date('d.m.Y') }}
{{ price.dateFrom | date('d.m.Y') }}
</td>
<td>
{{ price.dateTo | date('d.m.Y') }}
</td>
<td>
{{ price.season.token | trans }}
</td>
<td>
{{ price.includedPax }}
</td>
<td>
{{ (price.effectivePricePerNight / 100) | format_currency(accommodation.currency) }}
@@ -75,9 +105,6 @@
<span class="line-through text-xs">{{ (price.priceAdditionalPerson / 100) | format_currency(accommodation.currency) }}</span>
{% endif %}
</td>
<td>
{{ price.minNights }}
</td>
<td>
{% if price.acceptUndersubscription %}
{{ icon('check', 'w-4 h-4') }}
@@ -259,42 +286,3 @@
neu
</a>
</div>
{% if cmsData is defined and cmsData.success is true %}
<hr class="my-8">
<h2 class="text-xl font-bold">
CMS-Daten
</h2>
<div class="grid lg:grid-cols-2 gap-y-4 lg:gap-x-8">
<div class="space-y-4">
<div>
<h3 class="text-lg font-bold">
Adresse
</h3>
<strong>{{ cmsData.name }}</strong>
<br>
{{ cmsData.address | default('-') | nl2br }}
</div>
<div>
<h3 class="text-lg font-bold">
Beschreibung
</h3>
<div class="[&_p]:pb-4">
{{ cmsData.description | default('-') | raw }}
</div>
</div>
</div>
<div>
<h3 class="text-lg font-bold">
Bilder
</h3>
<div class="grid grid-cols-4 gap-4">
{% for image in cmsData.images.resized.s %}
<img src="{{ image.url }}" alt="{{ image.alt }}" class="block w-full h-auto">
{% endfor %}
</div>
</div>
</div>
{% endif %}