wip: implement admin crud
This commit is contained in:
1 parent
c09b46bce9
commit
675e583057
78 files changed
+2555
-101
No files matched your search
@@ -0,0 +1,296 @@
|
||||
{% 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>
|
||||
<div class="flex justify-between pt-8">
|
||||
<a href="{{ path('app_admin_accommodation') }}" class="button button--secondary button--small">
|
||||
zurück
|
||||
</a>
|
||||
<button type="submit" class="button button--primary button--small">
|
||||
speichern
|
||||
</button>
|
||||
</div>
|
||||
{{ form_rest(form) }}
|
||||
{{ form_end(form) }}
|
||||
|
||||
<hr class="my-8">
|
||||
|
||||
<h2 class="text-xl font-bold">
|
||||
Preise
|
||||
</h2>
|
||||
<div class="data-table-wrapper mb-4">
|
||||
<div class="data-table-wrapper__inner text-sm">
|
||||
<table class="data-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th>
|
||||
Datums-Bereich
|
||||
</th>
|
||||
<th>
|
||||
Preis pro Nacht
|
||||
</th>
|
||||
<th>
|
||||
Preise weitere Person
|
||||
</th>
|
||||
<th>
|
||||
Mindestbelegung (Nächte)
|
||||
</th>
|
||||
<th>
|
||||
Unterbelegung
|
||||
</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for price in accommodation.accommodationPrices %}
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>
|
||||
{{ price.dateFrom | date('d.m.Y') }} - {{ price.dateTo | date('d.m.Y') }}
|
||||
</td>
|
||||
<td>
|
||||
{{ (price.effectivePricePerNight / 100) | format_currency(accommodation.currency) }}
|
||||
{% if price.pricePerNightOverride is not null %}
|
||||
<span class="line-through text-xs">{{ (price.pricePerNight / 100) | format_currency(accommodation.currency) }}</span>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>
|
||||
{{ (price.effectivePriceAdditionalPerson / 100) | format_currency(accommodation.currency) }}
|
||||
{% if price.priceAdditionalPersonOverride is not null %}
|
||||
<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') }}
|
||||
{% endif %}
|
||||
</td>
|
||||
<td class="text-right">
|
||||
<twig:dropdown>
|
||||
<twig:dropdown:link url="{{ path('app_admin_accommodationprice_edit', { 'id': price.id }) }}">
|
||||
bearbeiten
|
||||
</twig:dropdown:link>
|
||||
<twig:dropdown:link url="{{ path('app_admin_accommodationprice_duplicate', { 'id': price.id }) }}">
|
||||
duplizieren
|
||||
</twig:dropdown:link>
|
||||
<twig:dropdown:hxbutton url="{{ path('app_admin_accommodationprice_delete', { 'id': price.id }) }}" warning>
|
||||
löschen
|
||||
</twig:dropdown:hxbutton>
|
||||
</twig:dropdown>
|
||||
</td>
|
||||
</tr>
|
||||
{% else %}
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
Keine Daten
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex justify-end">
|
||||
<a href="{{ path('app_admin_accommodationprice_create', { 'id': accommodation.id }) }}" class="button button--primary button--small">
|
||||
neu
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<hr class="my-8">
|
||||
|
||||
<h2 class="text-xl font-bold">
|
||||
Verpflegungsleistungen
|
||||
</h2>
|
||||
<div class="data-table-wrapper mb-4">
|
||||
<div class="data-table-wrapper__inner text-sm">
|
||||
<table class="data-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th>
|
||||
Datums-Bereich
|
||||
</th>
|
||||
<th>
|
||||
Bezeichnung
|
||||
</th>
|
||||
<th>
|
||||
Preis pro Person/Nacht
|
||||
</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody data-controller="sortable" data-sortable-url-value="{{ path('app_admin_boardservice_sort', { 'id': accommodation.id }) }}">
|
||||
{% for service in accommodation.boardServices %}
|
||||
<tr data-sortable-target="item">
|
||||
<td class="cursor-grab w-6" data-sortable-target="handle">
|
||||
{{ icon('draggable', 'w-4 h-4') }}
|
||||
</td>
|
||||
<td>
|
||||
{{ service.dateFrom | date('d.m.Y') }} - {{ service.dateTo | date('d.m.Y') }}
|
||||
</td>
|
||||
<td>
|
||||
{{ service.label }}
|
||||
<input type="hidden" name="sorting[{{ service.id }}]" value="{{ loop.index }}" data-sortable-target="positionField" data-id="{{ service.id }}">
|
||||
</td>
|
||||
<td>
|
||||
{{ (service.price / 100) | format_currency(accommodation.currency) }}
|
||||
</td>
|
||||
<td class="text-right">
|
||||
<twig:dropdown>
|
||||
<twig:dropdown:link url="{{ path('app_admin_boardservice_edit', { 'id': service.id }) }}">
|
||||
bearbeiten
|
||||
</twig:dropdown:link>
|
||||
<twig:dropdown:link url="{{ path('app_admin_boardservice_duplicate', { 'id': service.id }) }}">
|
||||
duplizieren
|
||||
</twig:dropdown:link>
|
||||
<twig:dropdown:hxbutton url="{{ path('app_admin_boardservice_delete', { 'id': service.id }) }}" warning>
|
||||
löschen
|
||||
</twig:dropdown:hxbutton>
|
||||
</twig:dropdown>
|
||||
</td>
|
||||
</tr>
|
||||
{% else %}
|
||||
<tr>
|
||||
<td colspan="5">
|
||||
Keine Daten
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex justify-end">
|
||||
<a href="{{ path('app_admin_boardservice_create', { 'id': accommodation.id }) }}" class="button button--primary button--small">
|
||||
neu
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<hr class="my-8">
|
||||
|
||||
<h2 class="text-xl font-bold">
|
||||
Optionale Zusatzleistungen
|
||||
</h2>
|
||||
<div class="data-table-wrapper mb-4">
|
||||
<div class="data-table-wrapper__inner text-sm">
|
||||
<table class="data-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th>
|
||||
Datums-Bereich
|
||||
</th>
|
||||
<th>
|
||||
Bezeichnung
|
||||
</th>
|
||||
<th>
|
||||
Preistyp
|
||||
</th>
|
||||
<th>
|
||||
Preis
|
||||
</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody data-controller="sortable" data-sortable-url-value="{{ path('app_admin_additionalservice_sort', { 'id': accommodation.id }) }}">
|
||||
{% for service in accommodation.additionalServices %}
|
||||
<tr data-sortable-target="item">
|
||||
<td class="cursor-grab w-6" data-sortable-target="handle">
|
||||
{{ icon('draggable', 'w-4 h-4') }}
|
||||
</td>
|
||||
<td>
|
||||
{{ service.dateFrom | date('d.m.Y') }} - {{ service.dateTo | date('d.m.Y') }}
|
||||
</td>
|
||||
<td>
|
||||
{{ service.label }}
|
||||
<input type="hidden" name="sorting[{{ service.id }}]" value="{{ loop.index }}" data-sortable-target="positionField" data-id="{{ service.id }}">
|
||||
</td>
|
||||
<td>
|
||||
{{ service.type.label | trans }}
|
||||
</td>
|
||||
<td>
|
||||
{{ (service.price / 100) | format_currency(accommodation.currency) }}
|
||||
</td>
|
||||
<td class="text-right">
|
||||
<twig:dropdown>
|
||||
<twig:dropdown:link url="{{ path('app_admin_additionalservice_edit', { 'id': service.id }) }}">
|
||||
bearbeiten
|
||||
</twig:dropdown:link>
|
||||
<twig:dropdown:link url="{{ path('app_admin_additionalservice_duplicate', { 'id': service.id }) }}">
|
||||
duplizieren
|
||||
</twig:dropdown:link>
|
||||
<twig:dropdown:hxbutton url="{{ path('app_admin_additionalservice_delete', { 'id': service.id }) }}" warning>
|
||||
löschen
|
||||
</twig:dropdown:hxbutton>
|
||||
</twig:dropdown>
|
||||
</td>
|
||||
</tr>
|
||||
{% else %}
|
||||
<tr>
|
||||
<td colspan="6">
|
||||
Keine Daten
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex justify-end">
|
||||
<a href="{{ path('app_admin_additionalservice_create', { 'id': accommodation.id }) }}" class="button button--primary button--small">
|
||||
neu
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<hr class="my-8">
|
||||
|
||||
{% if cmsData is defined %}
|
||||
<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 %}
|
||||
|
||||
Reference in new issue
Block a user