wip: initial commit

This commit is contained in:
Björn Fromme
2024-11-20 18:32:09 +01:00
parent ae964198e9
commit d4c4e69d09
91 changed files with 32685 additions and 144 deletions
+4 -2
View File
@@ -1,5 +1,5 @@
<!DOCTYPE html>
<html>
<html lang="de">
<head>
<meta charset="UTF-8">
<title>{% block title %}Welcome!{% endblock %}</title>
@@ -12,6 +12,8 @@
{% endblock %}
</head>
<body>
{% block body %}{% endblock %}
<div class="container">
{% block body %}{% endblock %}
</div>
</body>
</html>
+77
View File
@@ -0,0 +1,77 @@
{% extends 'layout.html.twig' %}
{% block content %}
{{ form_start(form) }}
{% for child in form.participants %}
{% set participant = child.vars.data %}
<details{% if not child.vars.valid %} open{% endif %}>
<summary role="button" class="outline">
Teilnehmer {{ participant.index }}
</summary>
<div class="grid">
<div>
<strong>
Unterkunft
</strong>
<br>
{{ booking.roomForParticipant(participant.index).label }}
</div>
<div>
<strong>
Preis
</strong>
<br>
{{ booking.priceForParticipant(participant.index)|format_currency('EUR') }}
</div>
</div>
<hr>
<fieldset class="grid">
{{ form_row(child.firstName) }}
{{ form_row(child.lastName) }}
{{ form_row(child.gender) }}
</fieldset>
<fieldset class="grid">
{{ form_row(child.dateOfBirth) }}
{{ form_row(child.nationality) }}
</fieldset>
<fieldset class="grid">
{{ form_row(child.email) }}
{{ form_row(child.mobile) }}
</fieldset>
<fieldset class="grid">
{{ form_row(child.height) }}
{{ form_row(child.shoeSize) }}
{{ form_row(child.weight) }}
</fieldset>
<fieldset class="grid">
{{ form_row(child.courses) }}
{{ form_row(child.skiPass) }}
</fieldset>
<fieldset class="grid">
{{ form_row(child.additionalServices) }}
{{ form_row(child.board) }}
</fieldset>
<fieldset class="grid">
{{ form_row(child.rentals) }}
</fieldset>
<fieldset class="grid">
{{ form_row(child.transportationServiceTo) }}
{{ form_row(child.transportationServiceFro) }}
</fieldset>
</details>
{% endfor %}
{{ form_rest(form) }}
<button type="submit">
Aktualisieren
</button>
{{ form_end(form) }}
<p>
<button type="button"
hx-get="{{ path('app_bookings') }}"
hx-target="#app"
hx-swap="innerHTML show:top"
hx-indicator="#loading-indicator">
zurück
</button>
</p>
{% endblock %}
+81
View File
@@ -0,0 +1,81 @@
{% extends 'layout.html.twig' %}
{% block content %}
<table>
<thead>
<tr>
<th scope="col">
Buchungsdatum
</th>
<th scope="col">
Reisedatum
</th>
<th scope="col">
Reise
</th>
<th scope="col">
Vorgangsnr.
</th>
<th scope="col">
Preis
</th>
<th scope="col">
offen
</th>
<th scope="col">
Status
</th>
<th scope="col"></th>
</tr>
</thead>
<tbody>
{% for booking in bookings %}
<tr>
<td>
{{ booking.bookingDate | date('d.m.Y') }}
</td>
<td>
{{ booking.travelDate | date('d.m.Y') }}
</td>
<td>
{{ booking.travel }}
</td>
<td>
{{ booking.bookingNumber }}
</td>
<td>
{{ booking.price|format_currency('EUR') }}
</td>
<td>
{{ booking.balance ? booking.balance|format_currency('EUR') : '-' }}
</td>
<td>
{{ booking.status }}
</td>
<td>
{% if booking.editable %}
<button type="button"
hx-get="{{ path('app_booking_edit', { 'id': booking.id }) }}"
hx-target="#app"
hx-indicator="#loading-indicator">
bearbeiten
</button>
{% endif %}
<a href="{{ path('app_booking_confirmation', { 'id': booking.id }) }}" target="_blank">
Bestätigung
</a>
<a href="{{ path('app_booking_documents', { 'id': booking.id }) }}" target="_blank">
Reisedokumente
</a>
</td>
</tr>
{% else %}
<tr>
<td>
Keine Daten
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endblock %}
+62
View File
@@ -0,0 +1,62 @@
{% use 'form_div_layout.html.twig' %}
{%- block form_widget_simple -%}
{%- set type = type|default('text') -%}
{%- if type == 'range' or type == 'color' -%}
{# Attribute "required" is not supported #}
{%- set required = false -%}
{%- endif -%}
{%- if errors|length > 0 -%}
{% set attr = attr|merge({ 'aria-invalid': 'true', 'aria-describedby': 'error-' ~ id }) %}
{%- endif -%}
<input type="{{ type }}" {{ block('widget_attributes') }} {% if value is not empty %}value="{{ value }}" {% endif %}/>
{%- endblock form_widget_simple -%}
{%- block form_row -%}
<fieldset{% with {attr: row_attr} %}{{ block('attributes') }}{% endwith %}>
<legend>
<strong>
{{- label -}}
</strong>
</legend>
{{- form_widget(form) -}}
{{- form_errors(form) -}}
{{- form_help(form) -}}
</fieldset>
{%- endblock form_row -%}
{%- block form_errors -%}
{%- if errors|length > 0 -%}
<small id="error-{{ id }}">
{%- for error in errors -%}
<div>{{ error.message }}</div>
{%- endfor -%}
</small>
{%- endif -%}
{%- endblock form_errors -%}
{%- block choice_widget_expanded -%}
{%- for child in form %}
{{- form_widget(child) -}}
{% endfor -%}
{%- endblock choice_widget_expanded -%}
{%- block checkbox_widget -%}
<label for="{{ id }}">
{{ parent() }}
{{ label|trans|raw }}
{%- if attr.disabled is defined and attr.disabled == true and attr.checked == true -%}
<input type="hidden" name="{{ form.vars.full_name }}" value="{{ form.vars.value }}">
{%- endif -%}
</label>
{%- endblock checkbox_widget -%}
{%- block radio_widget -%}
<label for="{{ id }}">
{{ parent() }}
{{ label|trans|raw }}
</label>
{%- if attr.disabled is defined and attr.disabled == true and attr.checked == true -%}
<input type="hidden" name="{{ form.vars.full_name }}" value="{{ form.vars.value }}">
{%- endif -%}
{%- endblock radio_widget -%}
+51
View File
@@ -0,0 +1,51 @@
{% extends 'base.html.twig' %}
{% block body %}
<div id="app">
{% if is_granted('ROLE_USER') %}
<nav>
<ul>
<li><strong>MyE&amp;P BETA</strong></li>
</ul>
<ul>
<li>
<a href="#"
class="contrast"
hx-get="{{ path('app_personal_data') }}"
hx-target="#app"
hx-swap="innerHTML"
hx-indicator="#loading-indicator">
Persönliche Daten
</a>
</li>
<li>
<a href="#"
class="contrast"
hx-get="{{ path('app_bookings') }}"
hx-target="#app"
hx-swap="innerHTML"
hx-indicator="#loading-indicator">
Buchungen
</a>
</li>
<li>
<a href="#"
class="contrast"
hx-get="{{ path('app_logout') }}"
hx-target="#app"
hx-swap="innerHTML"
hx-indicator="#loading-indicator">
Logout
</a>
</li>
</ul>
</nav>
{% endif %}
<div id="content">
{% block content %}{% endblock %}
<div id="loading-indicator">
<progress />
</div>
</div>
</div>
{% endblock %}
+30
View File
@@ -0,0 +1,30 @@
{% extends 'layout.html.twig' %}
{% block content %}
<h2>
Persönliche Daten
</h2>
{{ form_start(form) }}
<fieldset class="grid">
{{ form_row(form.gender) }}
{{ form_row(form.firstName) }}
{{ form_row(form.name) }}
{{ form_row(form.dateOfBirth) }}
</fieldset>
<fieldset class="grid">
{{ form_row(form.street) }}
{{ form_row(form.postCode) }}
{{ form_row(form.city) }}
{{ form_row(form.country) }}
</fieldset>
<fieldset class="grid">
{{ form_row(form.email) }}
{{ form_row(form.phone) }}
{{ form_row(form.mobile) }}
</fieldset>
{{ form_rest(form) }}
<button type="submit">
Speichern
</button>
{{ form_end(form) }}
{% endblock %}
+52
View File
@@ -0,0 +1,52 @@
{% extends 'layout.html.twig' %}
{% block content %}
{% if error %}
<div class="flex items-center space-x-1 bg-red-500 text-white p-2 rounded-md mb-6">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-4 h-4">
<path stroke-linecap="round" stroke-linejoin="round" d="M12 9v3.75m9-.75a9 9 0 11-18 0 9 9 0 0118 0zm-9 3.75h.008v.008H12v-.008z" />
</svg>
<span class="flex-1 text-sm">{{ error.messageKey|trans(error.messageData, 'security') }}</span>
</div>
{% endif %}
<form hx-post="{{ path('app_login') }}"
hx-target="#app"
hx-swap="innerHTML"
hx-indicator="#loading-indicator">
<div class="mb-6">
<label for="username" class="block leading-6 text-gray-900">
E-Mail:
</label>
<input type="email"
id="username"
name="_username"
value="{{ last_username }}"
class="mt-2 block w-full rounded-md border-0 py-1.5 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-primary sm:text-sm sm:leading-6"
required
autofocus
autocomplete="username">
</div>
<div class="mb-6">
<label for="password" class="block leading-6 text-gray-900">
Passwort:
</label>
<input type="password"
id="password"
name="_password"
class="mt-2 block w-full rounded-md border-0 py-1.5 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-primary sm:text-sm sm:leading-6"
required
autocomplete="current-password">
</div>
<div class="flex items-start mb-6">
<label for="rememberme" class="flex h-6 items-center">
<input type="checkbox" id="rememberme" name="_remember_me" class="h-4 w-4 rounded text-primary">
<span class="block ml-3 leading-6">angemeldet bleiben</span>
</label>
</div>
<button type="submit" class="btn w-full">
Login
</button>
<input type="hidden" name="_csrf_token" value="{{ csrf_token('authenticate') }}">
</form>
{% endblock %}