src/StartPlatz/Bundle/EventBundle/Resources/views/Default/event-single.tailwind.html.twig line 1

Open in your IDE?
  1. {% extends "@StartPlatzStyleBundle/base.tailwind.public.html.twig" %}
  2. {% set currentPath = app.request.get('_route') %}
  3. {# Language Detection - uses event.lang as default if set #}
  4. {% set lang = app.request.get('lang', event.lang|default('de'))|lower %}
  5. {% set isEnglish = lang == 'en' %}
  6. {# Select SEO content based on language with fallback #}
  7. {% set seoTitle = isEnglish and event.seoTitleEn ? event.seoTitleEn : event.seoTitle %}
  8. {% set seoDescription = isEnglish and event.seoDescriptionEn ? event.seoDescriptionEn : event.seoDescription %}
  9. {% set seoKeyword = isEnglish and event.seoKeywordEn ? event.seoKeywordEn : event.seoKeyword %}
  10. {# Sonderseite: batch-level overrides when custom page is active #}
  11. {% set isSonderseite = batch is defined and batch and batch.hasCustomPage() %}
  12. {% if isSonderseite %}
  13.     {% if batch.landingPageTitle %}
  14.         {% set seoTitle = batch.landingPageTitle %}
  15.     {% endif %}
  16.     {% if batch.landingPageDescription %}
  17.         {% set seoDescription = batch.landingPageDescription %}
  18.     {% endif %}
  19. {% endif %}
  20. {% set socialImage = (isSonderseite and batch.landingPageSocialImage) ? batch.landingPageSocialImage : event.imageLink %}
  21. {% block metaData %}
  22.     {# Optimize meta description for archived events #}
  23.     {% if event.status == 'archive' %}
  24.         {% set archivePrefix = isEnglish ? 'Past event from ' ~ event.startDate|date('F j, Y') ~ ': ' : 'Vergangene Veranstaltung vom ' ~ event.startDate|date('d.m.Y') ~ ': ' %}
  25.         <meta name="description" content="{{ archivePrefix }}{{ seoDescription|slice(0, 140) }}">
  26.     {% else %}
  27.         <meta name="description" content="{{ seoDescription }}">
  28.     {% endif %}
  29.     <meta name="keywords" content="{{ seoKeyword }}">
  30.     <meta name="author" content="{{ event.trainer }}">
  31.     {% if app.environment == 'prod' %}
  32.         <meta name="robots" content="index,follow">
  33.         {% if event.seriesTag is not empty %}
  34.             <link rel="canonical" href="{{ path('event_series', {'seriesTag': event.seriesTag, 'lang': lang}) }}" />
  35.         {% else %}
  36.             <link rel="canonical" href="https://www.startplatz.de/event/{{ event.slug | url_encode }}{% if lang == 'en' %}?lang=en{% endif %}" />
  37.         {% endif %}
  38.         {# hreflang tags for bilingual support #}
  39.         {% if event.hasEnglishVersion %}
  40.             <link rel="alternate" hreflang="de" href="https://www.startplatz.de/event/{{ event.slug | url_encode }}?lang=de" />
  41.             <link rel="alternate" hreflang="en" href="https://www.startplatz.de/event/{{ event.slug | url_encode }}?lang=en" />
  42.             <link rel="alternate" hreflang="x-default" href="https://www.startplatz.de/event/{{ event.slug | url_encode }}" />
  43.         {% endif %}
  44.     {% else %}
  45.         <meta name="robots" content="noindex,nofollow">
  46.     {% endif %}
  47.     {# Open Graph with language support #}
  48.     <meta property="og:title" content="{{ seoTitle }}">
  49.     <meta property="og:description" content="{{ seoDescription }}">
  50.     <meta property="og:image" content="{{ socialImage }}">
  51.     <meta property="og:locale" content="{{ lang == 'en' ? 'en_US' : 'de_DE' }}">
  52.     {% if event.hasEnglishVersion %}
  53.         <meta property="og:locale:alternate" content="{{ lang == 'en' ? 'de_DE' : 'en_US' }}">
  54.     {% endif %}
  55.     {# Twitter Card #}
  56.     <meta name="twitter:card" content="summary">
  57.     <meta name="twitter:title" content="{{ seoTitle }}">
  58.     <meta name="twitter:description" content="{{ seoDescription }}">
  59.     <meta name="twitter:image" content="{{ socialImage }}">
  60. {% endblock %}
  61. {% block title %}{{ seoTitle|default(event.seoTitle) }}{% endblock %}
  62. {% block styles %}
  63. {#
  64.    ╔═══════════════════════════════════════════════════════════════════════╗
  65.    ║  DEFAULT STYLES - werden durch event.additionalCss überschrieben      ║
  66.    ║                                                                       ║
  67.    ║  Anpassbar via additionalCss (Beispiel Dark Theme):                   ║
  68.    ║  body { background-color: #0a0a0a; }                                  ║
  69.    ║  .bg-registration { background-color: #171717; }                      ║
  70.    ║  .registration-accent { --registration-accent: #3D9DD6; }             ║
  71.    ║  .bg-tags { background-color: #171717; }                              ║
  72.    ║  .bg-promote { background-color: #171717; }                           ║
  73.    ║  .bg-admin-section { background-color: #171717; }                     ║
  74.    ╚═══════════════════════════════════════════════════════════════════════╝
  75. #}
  76. <style>
  77.     /* Page Background - visible between sections */
  78.     body { background-color: #FFFFFF; }
  79.     /* Registration Section */
  80.     .bg-registration { background-color: #9632FF; }
  81.     .registration-accent { --registration-accent: #9632FF; }
  82.     /* Tags Section */
  83.     .bg-tags { background-color: #F3F4F6; }
  84.     /* Promote This Event Section */
  85.     .bg-promote { background-color: #F3F4F6; }
  86.     /* Admin Section */
  87.     .bg-admin-section { background-color: #F9FAFB; }
  88. </style>
  89. {% endblock %}
  90. {% block additionalHead %}
  91.     {# Custom CSS from Event #}
  92.     {% if event.additionalCss is not empty %}
  93.         <style>
  94.             {{ include(template_from_string(event.additionalCss), {
  95.                 'event': event,
  96.                 'batch': batch,
  97.                 'isMultiBatchEvent': isMultiBatchEvent
  98.             }) }}
  99.         </style>
  100.     {% endif %}
  101.     {# Sonderseite: batch-level CSS overrides #}
  102.     {% if isSonderseite and batch.landingPageCss is not empty %}
  103.         <style>{{ batch.landingPageCss|raw }}</style>
  104.     {% endif %}
  105.     {% include "@StartPlatzStyleBundle/_meta-pixel.html.twig" with { meta_pixel_id: event.metaPixelId|default(null) } only %}
  106. {% endblock %}
  107. {% block content %}
  108.     {# Select content based on language with fallback to German #}
  109.     {% set navbar = isEnglish and event.navbarEn ? event.navbarEn : event.navbar %}
  110.     {% set teaser = isEnglish and event.teaserEn ? event.teaserEn : event.teaser %}
  111.     {% set content = (isSonderseite and batch.landingPageContent) ? batch.landingPageContent : (isEnglish and event.contentEn ? event.contentEn : event.content) %}
  112.     {% set contentTwig = isEnglish and event.contentTwigEn ? event.contentTwigEn : event.contentTwig %}
  113.     {% set postCtaContent = isEnglish and event.postCtaContentEn ? event.postCtaContentEn : event.postCtaContent %}
  114.     {# Navbar Section #}
  115.     {% if navbar %}
  116.         {{ include(template_from_string(navbar), {
  117.             'event': event,
  118.             'batch': batch,
  119.             'isMultiBatchEvent': isMultiBatchEvent,
  120.             'lang': lang,
  121.             'isEnglish': isEnglish,
  122.             'phrases': phrases
  123.         }) }}
  124.     {% endif %}
  125.     {# Teaser Section #}
  126.     {% if teaser %}
  127.         {{ include(template_from_string(teaser), {
  128.             'event': event,
  129.             'batch': batch,
  130.             'isMultiBatchEvent': isMultiBatchEvent,
  131.             'lang': lang,
  132.             'isEnglish': isEnglish,
  133.             'phrases': phrases
  134.         }) }}
  135.     {% endif %}
  136.     {# Archive Banner (SEO-optimized: no redirect) #}
  137.     {% include '@StartPlatzEvent/Default/_event.part.archive-banner.html.twig' with {
  138.         'event': event,
  139.         'isEnglish': isEnglish
  140.     } %}
  141.     {# Flash Messages (Notices) #}
  142.     {% if app.session.flashbag.has('notice') %}
  143.         <section class="bg-gray-100 py-3">
  144.             <div class="max-w-4xl mx-auto px-4">
  145.                 {% for flashMessage in app.session.flashbag.get('notice') %}
  146.                     <div class="text-center py-3 px-4 rounded-lg mb-2 {% if 'SUCCESS' in flashMessage %}bg-green-100 text-green-800{% elseif 'ERROR' in flashMessage %}bg-red-100 text-red-800{% else %}bg-gray-200 text-gray-800{% endif %}">
  147.                         {{ flashMessage|replace({'SUCCESS': ''})|raw }}
  148.                     </div>
  149.                 {% endfor %}
  150.                 {{ editFeedback|raw }}
  151.             </div>
  152.         </section>
  153.     {% endif %}
  154.     {# Application Status Feedback #}
  155.     {% if batch and application and application.applicationStatus %}
  156.         {% include "@StartPlatzEvent/Default/_event.part.feedback-application-process.html.twig" %}
  157.     {% endif %}
  158.     {# Main Content Section #}
  159.     {% if content %}
  160.         {{ include(template_from_string(content), {
  161.             'event': event,
  162.             'batch': batch,
  163.             'isMultiBatchEvent': isMultiBatchEvent,
  164.             'lang': lang,
  165.             'isEnglish': isEnglish,
  166.             'phrases': phrases
  167.         }) }}
  168.     {% endif %}
  169.     {# Dynamic Twig Content #}
  170.     {% if contentTwig %}
  171.         {{ include(template_from_string(contentTwig), {
  172.             'event': event,
  173.             'batch': batch,
  174.             'isMultiBatchEvent': isMultiBatchEvent,
  175.             'futureBatches': futureBatches,
  176.             'allBatches': allBatches,
  177.             'lang': lang,
  178.             'isEnglish': isEnglish,
  179.             'phrases': phrases
  180.         }) }}
  181.     {% endif %}
  182.     {# Registration Section #}
  183.     {% include "@StartPlatzEvent/Default/_registration.batch.tailwind.html.twig" with {
  184.         'event': event,
  185.         'batch': batch,
  186.         'batchIsOpen': batchIsOpen,
  187.         'application': application,
  188.         'settings': settings,
  189.         'isMultiBatchEvent': isMultiBatchEvent,
  190.         'futureBatches': futureBatches,
  191.         'lang': lang,
  192.         'isEnglish': isEnglish,
  193.         'phrases': phrases
  194.     } %}
  195.     {# Tags Section #}
  196.     {% include "@StartPlatzEvent/Default/_section.tags.tailwind.html.twig" %}
  197.     {# Post CTA Content #}
  198.     {% if postCtaContent %}
  199.         {{ include(template_from_string(postCtaContent), {
  200.             'event': event,
  201.             'batch': batch,
  202.             'isMultiBatchEvent': isMultiBatchEvent,
  203.             'lang': lang,
  204.             'isEnglish': isEnglish,
  205.             'phrases': phrases
  206.         }) }}
  207.     {% endif %}
  208.     {# Speakers Section #}
  209.     {% if speakers %}
  210.         {% include "@StartPlatzEvent/Default/_section.speakers-and-partners.winter-2025.html.twig" %}
  211.     {% endif %}
  212.     {# Past Batches Section #}
  213.     {% include "@StartPlatzEvent/Default/_section.past-batches.html.twig" with {
  214.         'event': event,
  215.         'isMultiBatchEvent': isMultiBatchEvent,
  216.         'pastBatches': pastBatches,
  217.         'isEnglish': isEnglish
  218.     } %}
  219.     {# Promote This Event (for logged-in users) #}
  220.     {% if app.user and batch %}
  221.         {% include "@StartPlatzEvent/Default/_section.promote-this-event.tailwind.html.twig" %}
  222.     {% endif %}
  223.     {# Participant List Access #}
  224.     {% if app.user is defined and application is defined and application is not null and application.canReadList %}
  225.         <section class="bg-gray-100 py-6">
  226.             <div class="max-w-4xl mx-auto px-4 text-center">
  227.                 <span class="text-gray-700">{{ isEnglish ? 'You can view the participant list here' : 'Hier kannst Du die Teilnehmerliste einsehen' }}</span>
  228.                 <a class="ml-2 inline-block px-4 py-2 border border-gray-800 rounded-lg hover:bg-gray-800 hover:text-white transition-colors" href="{{ path('admin_event_participants', {id: event.id} ) }}">
  229.                     participants
  230.                 </a>
  231.             </div>
  232.         </section>
  233.     {% endif %}
  234.     {# Admin Section #}
  235.     {% if app.user is defined %}
  236.         {% if app.user.admin is defined and app.user.admin %}
  237.             {% include "@StartPlatzEvent/Default/_section.startplatz-admin-section.tailwind.html.twig" %}
  238.         {% endif %}
  239.     {% endif %}
  240.     {# Language Switcher Component #}
  241.     {% if event.hasEnglishVersion %}
  242.         <div class="fixed top-32 right-5 z-50" x-data="{ hover: false }">
  243.             <div class="bg-white border-2 border-sp-purple rounded-full px-4 py-2 shadow-lg flex items-center gap-2">
  244.                 <a href="?lang=de" class="flex items-center gap-1 px-2 py-1 rounded-full transition-all {{ lang == 'de' ? 'bg-sp-purple text-white' : 'text-gray-800 hover:bg-gray-100' }}" title="Deutsch">
  245.                     <span class="text-xl">DE</span>
  246.                 </a>
  247.                 <span class="text-gray-300">|</span>
  248.                 <a href="?lang=en" class="flex items-center gap-1 px-2 py-1 rounded-full transition-all {{ lang == 'en' ? 'bg-sp-purple text-white' : 'text-gray-800 hover:bg-gray-100' }}" title="English">
  249.                     <span class="text-xl">EN</span>
  250.                 </a>
  251.             </div>
  252.         </div>
  253.     {% endif %}
  254. {% endblock %}
  255. {% block javascripts %}
  256.     {% if event.additionalJs is not empty %}
  257.         <script>
  258.             var eventData = {
  259.                 id: {{ event.id }},
  260.                 title: "{{ event.title|e('js') }}",
  261.                 slug: "{{ event.slug|e('js') }}",
  262.                 lang: "{{ lang }}",
  263.                 isEnglish: {{ isEnglish ? 'true' : 'false' }}
  264.             };
  265.             {{ include(template_from_string(event.additionalJs), {
  266.                 'event': event,
  267.                 'batch': batch,
  268.                 'lang': lang,
  269.                 'isEnglish': isEnglish
  270.             })|raw }}
  271.         </script>
  272.     {% endif %}
  273.     {# Sonderseite: batch-level JS #}
  274.     {% if isSonderseite and batch.landingPageJs is not empty %}
  275.         <script>{{ batch.landingPageJs|raw }}</script>
  276.     {% endif %}
  277. {% endblock %}