{% import "@StartPlatzEventBundle/Default/_macros.registration.html.twig" as registration %}
<section id="{% if lang == 'en' or isEnglish %}registration{% else %}anmeldung{% endif %}" class="bg-registration py-5">
<div class="row">
<div class="col-12">
{# Determine price source - batch takes precedence for multi-batch events #}
{% set displayPrice = null %}
{% set isTaxIncluded = false %}
{% set isFreeForKiCampus = false %}
{% set isFreeForCommunity = false %}
{% if isMultiBatchEvent and batch and batch.priceInEuroCent %}
{% set displayPrice = batch.priceInEuroCent %}
{% set isTaxIncluded = batch.isTaxIncluded %}
{% set isFreeForKiCampus = batch.isFreeForKiCampus %}
{% set isFreeForCommunity = batch.isFreeForCommunity %}
{% elseif event is defined and event and event.priceInEuroCent %}
{% set displayPrice = event.priceInEuroCent %}
{% set isTaxIncluded = event.isTaxIncluded %}
{% set isFreeForKiCampus = event.isFreeForKiCampus %}
{% set isFreeForCommunity = event.isFreeForCommunity %}
{% endif %}
{# Compact Event Details (Horizontal Layout) - Same width as form #}
<div class="row d-flex justify-content-center">
<div class="col-md-8">
{% if event is defined %}
<div class="d-flex justify-content-between mb-4 bg-light p-3" style="border-radius: 8px;">
{# When - INLINE like V2 #}
<div>
<strong>📅 {% if lang == 'DE' %}Wann:{% else %}When:{% endif %}</strong>
{% if isMultiBatchEvent and batch and batch.startDate %}
{{ batch.startDate|date('d.m.Y H:i') }}{% if batch.endDate %} - {{ batch.endDate|date('H:i') }} Uhr{% endif %}
{% else %}
{{ registration.when(event, lang, phrases) }}
{% endif %}
</div>
{# Where - INLINE like V2 #}
<div>
<strong>📍 {% if lang == 'DE' %}Wo:{% else %}Where:{% endif %}</strong> {{ registration.where(event, lang, phrases) }}
</div>
{# Fee - INLINE like V2 #}
<div>
{% if displayPrice %}
<strong>💰 {% if lang == 'DE' %}Gebühr:{% else %}Fee:{% endif %}</strong> {{ (displayPrice/100)|number_format(2, ',', '.') }} € {% if isTaxIncluded %}{% if lang == 'DE' %}inkl. MwSt.{% else %}incl. VAT{% endif %}{% else %}{% if lang == 'DE' %}zzgl. MwSt.{% else %}excl. VAT{% endif %}{% endif %}
{% elseif displayPrice is not null and displayPrice == 0 %}
<strong>💰 {% if lang == 'DE' %}Gebühr:{% else %}Fee:{% endif %}</strong> {% if lang == 'DE' %}kostenlos{% else %}free{% endif %}
{% endif %}
</div>
</div>
{# KI Campus Free Access Box #}
{% if displayPrice and isFreeForKiCampus %}
<div class="mb-3 p-3 bg-light border rounded" style="border-radius: 8px;">
<span class="text-success">
<i class="fas fa-check-circle"></i>
{% if lang == 'DE' %}
Kostenlos für KI Campus Mitglieder
{% else %}
Free for KI Campus members
{% endif %}
</span>
<p class="mb-1 mt-2 small">
{% if lang == 'DE' %}
Werde Mitglied für nur 49€/Monat und erhalte Zugang zu diesem und vielen weiteren kostenlosen KI-Kursen und Events!
{% else %}
Join now for just €49/month and get access to this and many other free AI courses and events!
{% endif %}
</p>
<a target="_blank" href="https://ki-campus.onepage.me/" class="btn btn-sm btn-success mt-2">
{% if lang == 'DE' %}
Jetzt KI Campus Mitglied werden
{% else %}
Become a KI Campus member now
{% endif %}
</a>
</div>
{% endif %}
{# Community Free Access Box #}
{% if displayPrice and isFreeForCommunity %}
<div class="mb-3 p-3 bg-light border rounded" style="border-radius: 8px;">
<span class="text-success">
<i class="fas fa-check-circle"></i>
{% if lang == 'DE' %}
Kostenlos für Community Mitglieder
{% else %}
Free for Community members
{% endif %}
</span>
<p class="mb-1 mt-2 small">
{% if lang == 'DE' %}
Als Community Mitglied erhältst Du kostenlosen Zugang zu diesem Event!
{% else %}
As a Community member, you get free access to this event!
{% endif %}
</p>
</div>
{% endif %}
{# Application Status #}
{% if application.applicationStatus is defined and application.applicationStatus is not empty %}
<div class="alert alert-info" style="border-radius: 8px;">
<strong>{{ phrases.event_phrase_application_status|default('Anmeldestatus:') }}</strong>
<div class="mt-1">
{% if application.applicationStatus == 'started' %}
{{ phrases.event_phrase_status_started|default('Du bist vorgemerkt. Sobald Du Deine E-Mail Adresse bestätigt hast, wird die Anmeldung gültig.') }}
{% elseif application.applicationStatus == 'applied' %}
{% if event is defined and event and event.isFormalLanguage %}
{{ phrases.event_phrase_status_applied_formal|default('Sie sind angemeldet. Wir freuen uns auf Sie!') }}
{% else %}
{{ phrases.event_phrase_status_applied|default('Du bist angemeldet. Wir freuen uns auf Dich!') }}
{% endif %}
{% else %}
{{ phrases.event_phrase_status_other|default('Du bist angemeldet mit dem Status ==') }} {{ application.applicationStatus }}
{% endif %}
</div>
</div>
{% endif %}
{% endif %}
</div>
</div>
{# TICKET AVAILABILITY COUNTER - Configurable via settings #}
{% if settings.showParticipantCounter|default(false) %}
{% set maxParticipants = settings.maxNumber|default(100) %}
{% set countedStatuses = settings.countStatus|default(['applied', 'approved']) %}
{# Calculate count based on configured statuses #}
{% set registered = 0 %}
{% if 'started' in countedStatuses and batch.startedCount is not null %}
{% set registered = registered + batch.startedCount %}
{% endif %}
{% if 'applied' in countedStatuses and batch.appliedCount is not null %}
{% set registered = registered + batch.appliedCount %}
{% endif %}
{% if 'approved' in countedStatuses and batch.approvedCount is not null %}
{% set registered = registered + batch.approvedCount %}
{% endif %}
{% if 'rejected' in countedStatuses and batch.rejectedCount is not null %}
{% set registered = registered + batch.rejectedCount %}
{% endif %}
{% set available = maxParticipants - registered %}
<div class="row d-flex justify-content-center mt-4">
<div class="col-md-8">
<div class="alert bg-light border mb-3" style="background-color: #f8f9fa !important; padding: 12px 20px; border-radius: 6px;">
<div class="text-center" style="font-size: 14px; color: #666;">
{% if lang == 'de' %}
<strong>{{ registered }} von {{ maxParticipants }} Plätzen belegt</strong> |
<strong style="color: #FF6B00;">{{ available }} übrig</strong> – sichere dir deinen Platz
{% else %}
<strong>{{ registered }} of {{ maxParticipants }} seats taken</strong> |
<strong style="color: #FF6B00;">{{ available }} left</strong> – don't miss your spot
{% endif %}
</div>
</div>
</div>
</div>
{% endif %}
{# END TICKET AVAILABILITY COUNTER #}
{# Registration Form - Centered 66% width - INTEGRATED (no more include!) #}
{% if application.applicationStatus is defined and application.applicationStatus is empty %}
<div class="row d-flex justify-content-center">
<div class="col-md-8">
{# Waiting List or Regular Registration #}
{% if settings.maxNumber > 0 and batch.applicationsCount >= settings.maxNumber %}
{% if settings.hasWaitingList %}
<h2 class="text-center mb-4">{{ phrases.event_phrase_all_seats_booked_waiting_list|default('Alle Plätze sind gebucht - Bitte registriere Dich für die Warteliste') }}</h2>
{% else %}
<h2 class="text-center mb-4">{{ phrases.event_phrase_all_seats_booked_no_registration|default('Alle Plätze sind gebucht - Eine Anmeldung ist leider nicht möglich') }}</h2>
{% endif %}
{% endif %}
{# Show form if not full OR has waiting list #}
{% if (settings.maxNumber == 0 or batch.applicationsCount < settings.maxNumber) or (settings.maxNumber > 0 and batch.applicationsCount >= settings.maxNumber and settings.hasWaitingList) %}
{# Flash Messages #}
{% for flashMessage in app.session.flashbag.get('notice') %}
<div class="alert {% if 'SUCCESS' in flashMessage %}alert-success{% elseif 'ERROR' in flashMessage %}alert-danger{% else %}alert-default{% endif %}" role="alert">{{ flashMessage|raw }}</div>
{% endfor %}
{# Form Container with V2 Styling #}
<div class="bg-light p-4 contact-form" style="border-radius: 12px; box-shadow: 0 2px 10px rgba(0,0,0,0.08);">
{{ form_start(form) }}
{{ form_errors(form) }}
{# Name Fields (Side by Side) #}
<div class="form-group row">
<div class="col-md-6 mb-3 mb-md-0">
{{ form_widget(form.firstName, {'attr': {'class': 'form-control', size: "32", max_size: "64",placeholder: phrases.phrase_form_firstName_placeholder ~ ' (*)'} } ) }}
</div>
<div class="col-md-6">
{{ form_widget(form.lastName, {'attr': {'class': 'form-control', size: "32", max_size: "64",placeholder: phrases.phrase_form_lastName_placeholder ~ ' (*)'} } ) }}
</div>
</div>
{# Startup Name (Optional) #}
{% if batch.askForTeam %}
<div class="form-group">
{{ form_widget(form.startupName, {'attr': {'class': 'form-control',placeholder: 'Firma'}, 'required':false } ) }}
</div>
{% endif %}
{# Email #}
<div class="form-group">
{{ form_widget(form.email, {'attr': {'class': 'form-control', size: "32", max_size: "64", placeholder: 'E-mail (*)' } } ) }}
</div>
{# Phone #}
{% if batch.hasIncludePhone %}
<div class="form-group">
{{ form_widget(form.phone, {'attr': {'class': 'form-control', size: "32", max_size: "64"}, 'required':false, placeholder: 'Phone Number' } ) }}
<small class="form-text text-muted">
{{ phrases.request_phone_number_for_updates | default('Bitte gib\' Deine Telefonnummer an, damit wir Dich im Fall von Änderungen erreichen können.') }}
</small>
</div>
{% endif %}
{# LinkedIn #}
{% if batch.hasIncludeLinkedIn %}
<div class="form-group">
{{ form_widget(form.linkedin, {'attr': {'class': 'form-control'}, 'required':false } ) }}
</div>
{% endif %}
{# Extra Fields (Dynamic) #}
{% if attribute(settings, 'extraFields') is defined %}
{% set extraFields = attribute(settings, 'extraFields') %}
{% for extraField in extraFields %}
{% set formField = attribute(form, extraField.field) %}
{% if extraField.type == 'checkbox' %}
<div class="form-group">
<div class="d-flex align-items-start">
<div class="mr-2">
{{ form_widget(formField, {'attr': {'class': 'form-check-input'}, 'required':extraField.required } ) }}
</div>
<div>
<strong class="form-text text-muted">
{{ extraField.label }}
</strong>
</div>
</div>
</div>
{% else %}
<div class="form-group">
{{ form_widget(formField, {'attr': {'class': 'form-control'}, 'required':extraField.required } ) }}
</div>
{% endif %}
{% endfor %}
{% endif %}
{# Applicant Types #}
{% if settings.applicantTypes is defined and settings.applicantTypes %}
<div class="form-group">
{{ form_widget(form.applicantType, {'attr': {'class': 'form-control'}, 'required':false } ) }}
</div>
{% endif %}
{# Newsletter Permission #}
{% if batch.hasIncludeNewsletterPermission %}
<div class="form-group">
<div class="d-flex align-items-start">
<div class="mr-2">
{{ form_widget(form.hasNewsletterPermissionGiven, {'attr': {'class': 'form-check-input'}, 'required':false } ) }}
</div>
<div>
<strong class="form-text text-muted">
{% if application.lang == 'DE' %}
Ja, ich möchte gerne über weitere Veranstaltungen informiert werden.
{% else %}
Yes, I would like to be informed about further events.
{% endif %}
</strong>
</div>
</div>
</div>
{% endif %}
{# Volunteer Consent #}
{% if settings.hasIncludeVolunteerConsent is defined and settings.hasIncludeVolunteerConsent %}
<div class="form-group">
<div class="d-flex align-items-start">
<div class="mr-2">
{{ form_widget(form.hasVolunteerAgreed, {'attr': {'class': 'form-check-input'}, 'required':false } ) }}
</div>
<div>
<strong class="form-text text-muted">
{% if application.lang == 'DE' %}
Ja, ich würde mich gerne als Volunteer, Mentor oder Unterstützer einbringen
{% else %}
Yes, I would like to contribute as a volunteer, mentor, or supporter
{% endif %}
</strong>
</div>
</div>
</div>
{% endif %}
{# Terms Consent #}
{% if batch.hasIncludeTermsConsent %}
<div class="form-group">
<small class="form-text text-muted">
{% if application.lang == 'DE' %}
Bei unseren Veranstaltungen können Aufnahmen für Social Media gemacht werden.
<br>Mit Deiner Anmeldung stimmst Du zu, dass Bildaufnahmen für Social Media verwendet werden dürfen.
{% else %}
At our events, recordings for social media can be made. <br>By registering, you agree that image recordings may be used for social media.
{% endif %}
</small>
</div>
{% endif %}
{# AI Hub Trial Membership Note #}
{% if batch.productId > 322 and batch.productId < 330 %}
<div class="form-group">
<small class="form-text text-muted">
(*) die Probemitgliedschaft im AI Hub verlängert sich nicht automatisch und wird 30 Tage nach Ende der ausgewählten AI-Summer-School-Ausgabe automatisch und ohne zusätzliche Kosten gekündigt.
</small>
</div>
{% endif %}
{# Price Information #}
{% if batch.priceInEuroCent %}
<div class="form-group">
{% if application.lang == 'DE' %}
<strong>Der Standardpreis beträgt {{ application.priceInEuroCent /100 |number_format(0, ',', '.') }}€</strong> (zzgl. MwSt.)
{% if application.discountPercent %}
<br>
Du erhälst einen Discount wegen <i>{{ application.discountReason }}</i> in Höhe von {{ application.discountPercent }}%
und daher beträgt der Preis für Dich {{ application.realPriceinEuroCent /100 |number_format(0, ',', '.') }}€ (zzgl. MwSt.)
{% endif %}
<br>
{% if application.realPriceinEuroCent %}
<small class="text-muted">Mit Klick auf "Jetzt anmelden" wirst Du angemeldet und ein Zahlungsvorgang bei unserem Dienstleister Monsum gestartet </small>
{% endif %}
{% else %}
<strong>The standard price is {{ application.priceInEuroCent /100 |number_format(0, ',', '.') }}€</strong>
{% if application.discountPercent %}
<br>
You will receive a discount due to <i>{{ application.discountReason }}</i> in the amount of {{ application.discountPercent }}%
and therefore the price for you is {{ application.realPriceinEuroCent /100 |number_format(0, ',', '.') }}€
{% endif %}
<br>
{% if application.realPriceinEuroCent %}
<small class="text-muted">By clicking "Register Now" you will be registered and a payment process will be started with our service provider Monsum</small>
{% endif %}
{% endif %}
</div>
{% endif %}
{# Submit Button - Centered & Large (V2 Style) #}
{% set label = phrases.phrase_form_button_call_to_act %}
<div class="form-group text-center mt-4">
{{ form_widget(form.finish, {'attr': {'class': 'btn btn-dark btn-lg px-5 py-3', 'style': 'border-radius: 8px;'}, 'label':label }) }}
</div>
{# CSRF Token #}
{% if not embed|default(false) %}
{{ form_row(form._token) }}
{% endif %}
{{ form_end(form, {'render_rest': false}) }}
{# Meta Pixel Lead Event - Hybrid Approach #}
{% if event is defined and event.slug == 'ai-coding-hackathon-2025' %}
<script>
(function() {
// Find the form element
var form = document.querySelector('form[name="{{ form.vars.name }}"]');
if (!form) return;
var isSubmitting = false;
// Intercept form submission
form.addEventListener('submit', function(e) {
// If we've already fired the pixel and are submitting, let it through
if (isSubmitting) {
return true;
}
// Prevent default form submission
e.preventDefault();
e.stopPropagation();
// Fire Meta Pixel Lead event with Hybrid approach
if (typeof fbq !== 'undefined') {
var submitted = false;
function submitForm() {
if (submitted) return;
submitted = true;
isSubmitting = true;
form.submit();
}
// Try callback (best case - fires when event confirmed)
fbq('track', 'Lead', {}, function() {
console.log('✅ Meta Pixel Lead confirmed');
submitForm();
});
// Fallback timeout (safety net - fires after 1s max)
setTimeout(function() {
console.log('⏱️ Meta Pixel fallback timeout');
submitForm();
}, 1000);
} else {
// If fbq is not loaded, submit immediately
isSubmitting = true;
form.submit();
}
return false;
});
})();
</script>
{% endif %}
{# Reduced Tickets Info #}
{% if batch.priceInEuroCent and attribute(phrases,'phrase_reduced_tickets') is defined %}
<div class="form-group">
<p class="text-muted">{{ phrases.phrase_reduced_tickets }}</p>
</div>
{% endif %}
</div> {# End form container #}
{% endif %} {# End form visibility check #}
</div>
</div>
{% endif %}
</div>
</div>
{# Multi-Batch: Other Dates Section #}
{% if isMultiBatchEvent and futureBatches|length > 1 %}
<div class="row mt-5" id="{{ isEnglish ? 'OtherDates' : 'WeitereTermine' }}">
<div class="col-12">
<h3 class="text-center mb-4">{{ phrases.event_phrase_other_dates|default('Weitere Termine') }}</h3>
<div class="batch-selector">
<div class="list-group">
{% for futureBatch in futureBatches %}
{% if futureBatch.id != batch.id %} {# Don't show the currently selected batch #}
<a href="{{ path('event_show_single_by_date', {'slug': event.slug, 'date': futureBatch.startDate|date('Y-m-d')}) }}"
class="list-group-item list-group-item-action">
<div class="row align-items-center">
<div class="col-md-6">
<h5 class="mb-1">
{% if lang == 'DE' %}
{{ futureBatch.startDate|date('d. F Y', 'Europe/Berlin')|replace({
'January': 'Januar', 'February': 'Februar', 'March': 'März',
'April': 'April', 'May': 'Mai', 'June': 'Juni',
'July': 'Juli', 'August': 'August', 'September': 'September',
'October': 'Oktober', 'November': 'November', 'December': 'Dezember'
}) }}
{% else %}
{{ futureBatch.startDate|date('F d, Y') }}
{% endif %}
</h5>
<p class="mb-1">
{{ futureBatch.startDate|date('H:i') }} -
{% if futureBatch.endDate %}
{{ futureBatch.endDate|date('H:i') }} Uhr
{% else %}
{{ futureBatch.startDate|date_modify('+2 hours')|date('H:i') }} Uhr
{% endif %}
</p>
{% if futureBatch.name and futureBatch.name != batch.name %}
<small class="text-muted">{{ futureBatch.name }}</small>
{% endif %}
</div>
<div class="col-md-6 text-md-right">
{% set isBatchOpen = futureBatch.start and futureBatch.end and date(futureBatch.start) <= date() and date(futureBatch.end) >= date() %}
{% if settings.maxNumber > 0 and futureBatch.applicationsCount >= settings.maxNumber %}
<span class="badge badge-danger">Ausgebucht</span>
{% elseif not isBatchOpen %}
<span class="badge badge-secondary">Anmeldung geschlossen</span>
{% else %}
<span class="badge badge-success">
{% if settings.maxNumber > 0 %}
{{ settings.maxNumber - futureBatch.applicationsCount }} Plätze frei
{% else %}
Plätze verfügbar
{% endif %}
</span>
<button class="btn btn-sm btn-outline-primary ml-2">
Zu diesem Termin →
</button>
{% endif %}
</div>
</div>
</a>
{% endif %}
{% endfor %}
</div>
</div>
{% if selectedDate %}
<div class="mt-3 text-center">
<a href="{{ path('event_show_single', {'slug': event.slug}) }}" class="btn btn-link">
← Alle Termine anzeigen
</a>
</div>
{% endif %}
</div>
</div>
{% endif %}
</section>