src/StartPlatz/Bundle/StyleBundle/Resources/views/Navigation/_nav.public.tailwind.html.twig line 1

Open in your IDE?
  1. {# Tailwind Public Navigation — STARTPLATZ #}
  2. {# Port of _nav.homepage.bootstrap4.html.twig using Tailwind + Alpine.js #}
  3. {# Data source: menuLinksAndPhrases (Twig global via MenuTranslationExtension) #}
  4. {% set menuLinks      = menuLinksAndPhrases.menuLinks %}
  5. {% set menuPhrases    = menuLinksAndPhrases.menuPhrases %}
  6. {% set targetPath     = menuLinksAndPhrases.targetPath %}
  7. {% set lang           = menuLinksAndPhrases.lang %}
  8. {% set menuLinksDe2En = menuLinksAndPhrases.menuLinksDe2En %}
  9. {% set menuLinksEn2De = menuLinksAndPhrases.menuLinksEn2De %}
  10. {% set menuLinksDe2Fr = menuLinksAndPhrases.menuLinksDe2Fr %}
  11. {% set menuLinksFr2De = menuLinksAndPhrases.menuLinksFr2De %}
  12. {% set menuLinksEn2Fr = menuLinksAndPhrases.menuLinksEn2Fr %}
  13. {% set menuLinksFr2En = menuLinksAndPhrases.menuLinksFr2En %}
  14. <nav x-data="{ mobileOpen: false }" class="fixed top-0 left-0 right-0 z-50 bg-gray-900 text-white shadow-lg" style="padding-bottom: 2px;">
  15.     <div class="flex items-center justify-center px-4 py-2">
  16.         {# Logo #}
  17.         <a href="https://www.startplatz.de" class="flex-shrink-0 mr-4" title="Home for the innovative people in Rheinland">
  18.             <img src="https://res.cloudinary.com/startplatz/image/upload/c_scale,w_107/v1614775778/logos/STARTPLATZ_Logos/STARTPLATZ_Logo_wei%C3%9F.png"
  19.                  alt="STARTPLATZ" class="h-8">
  20.         </a>
  21.         {# Mobile Toggle #}
  22.         <button @click="mobileOpen = !mobileOpen" class="lg:hidden ml-auto p-2 text-white">
  23.             <svg x-show="!mobileOpen" class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  24.                 <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h16"/>
  25.             </svg>
  26.             <svg x-show="mobileOpen" class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  27.                 <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"/>
  28.             </svg>
  29.         </button>
  30.         {# Desktop + Mobile Menu #}
  31.         <ul class="hidden lg:flex items-center space-x-1 text-sm mt-1"
  32.             :class="{ '!flex flex-col absolute top-full left-0 right-0 bg-gray-900 p-4 space-x-0 space-y-1 max-h-[90vh] overflow-y-auto': mobileOpen, 'hidden': !mobileOpen }"
  33.             style="max-width: 920px;">
  34.             {# ── AI Hub ── #}
  35.             {% set aiHubUrl = (lang == 'EN') ? 'https://startplatz-ai-hub.de/en/' : 'https://startplatz-ai-hub.de' %}
  36.             <li class="my-1">
  37.                 <a href="{{ aiHubUrl }}"
  38.                    class="block px-3 py-1.5 rounded-[10px] text-white text-center hover:text-black hover:bg-[#aacf61]"
  39.                    style="background-color: rgba(142,86,255,1.0); min-width: 75px;">
  40.                     AI Hub
  41.                 </a>
  42.             </li>
  43.             {# ── Startups ── #}
  44.             <li x-data="{ open: false }" @click.away="open = false" @mouseenter="open = true" @mouseleave="open = false" class="relative my-1">
  45.                 <button @click="open = !open"
  46.                         class="flex items-center px-2 py-1.5 text-white hover:bg-[#aacf61] hover:text-black hover:rounded">
  47.                     Startups
  48.                     <svg class="w-3 h-3 ml-1" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7"/></svg>
  49.                 </button>
  50.                 <div x-show="open" x-transition class="lg:absolute left-0 mt-1 w-56 bg-[#eae9e9] rounded shadow-lg py-1 z-50">
  51.                     <hr class="my-1 mx-3 border-gray-400">
  52.                     <a href="{{ attribute(menuLinks, '/memberships') }}" class="block px-4 py-2 text-sm text-gray-800 hover:bg-[#aacf61]">
  53.                         {{ attribute(menuPhrases, 'memberships') }}
  54.                     </a>
  55.                     <hr class="my-1 mx-3 border-gray-400">
  56.                     <a href="/accelerator/" class="block px-4 py-2 text-sm text-gray-800 hover:bg-[#aacf61]">Accelerator</a>
  57.                     <a href="{{ attribute(menuLinks, '/rheinland-pitch') }}" class="block px-4 py-2 text-sm text-gray-800 hover:bg-[#aacf61]">
  58.                         {{ attribute(menuPhrases, 'rheinland-pitch') }}
  59.                     </a>
  60.                     <a href="{{ attribute(menuLinks, '/gruenderstipendium') }}" class="block px-4 py-2 text-sm text-gray-800 hover:bg-[#aacf61]">
  61.                         {{ attribute(menuPhrases, 'gruenderstipendium') }}
  62.                     </a>
  63.                 </div>
  64.             </li>
  65.             {# ── Unternehmen / Corporates ── #}
  66.             {% set corporateHighlight = false %}
  67.             {% if lang == 'DE' %}
  68.                 {% if 'fuer-unternehmen' in targetPath or '/fuer-unternehmen-1' in targetPath %}
  69.                     {% set corporateHighlight = true %}
  70.                 {% endif %}
  71.             {% else %}
  72.                 {% if 'en/corporate-innovation' in targetPath or 'en/corporate-innovation-1' in targetPath %}
  73.                     {% set corporateHighlight = true %}
  74.                 {% endif %}
  75.             {% endif %}
  76.             <li x-data="{ open: false }" @click.away="open = false" @mouseenter="open = true" @mouseleave="open = false" class="relative my-1 {{ corporateHighlight ? 'border-b-[3px] border-[#AACF61]' : '' }}">
  77.                 <button @click="open = !open"
  78.                         class="flex items-center px-2 py-1.5 text-white hover:bg-[#aacf61] hover:text-black hover:rounded">
  79.                     {{ attribute(menuPhrases, 'corporate') }}
  80.                     <svg class="w-3 h-3 ml-1" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7"/></svg>
  81.                 </button>
  82.                 <div x-show="open" x-transition class="lg:absolute left-0 mt-1 w-56 bg-[#eae9e9] rounded shadow-lg py-1 z-50">
  83.                     <a href="{{ attribute(menuLinks, '/innovation-partnerschaften') }}" class="block px-4 py-2 text-sm text-gray-800 hover:bg-[#aacf61]">
  84.                         {{ attribute(menuPhrases, 'innovation-partnerschaften') }}
  85.                     </a>
  86.                     <a href="{{ attribute(menuLinks, '/ki-weiterbildung') }}" class="block px-4 py-2 text-sm text-gray-800 hover:bg-[#aacf61]">
  87.                         {{ attribute(menuPhrases, 'ki-weiterbildung') }}
  88.                     </a>
  89.                 </div>
  90.             </li>
  91.             {# ── Büros / Offices ── #}
  92.             <li x-data="{ open: false }" @click.away="open = false" @mouseenter="open = true" @mouseleave="open = false" class="relative my-1">
  93.                 <button @click="open = !open"
  94.                         class="flex items-center px-2 py-1.5 text-white hover:bg-[#aacf61] hover:text-black hover:rounded">
  95.                     {{ attribute(menuPhrases, 'coworking-offices') }}
  96.                     <svg class="w-3 h-3 ml-1" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7"/></svg>
  97.                 </button>
  98.                 <div x-show="open" x-transition class="lg:absolute right-0 mt-1 w-64 bg-[#eae9e9] rounded shadow-lg py-1 z-50">
  99.                     <a href="{{ attribute(menuLinks, '/offices-cologne') }}" class="block px-4 py-2 text-sm text-gray-800 hover:bg-[#aacf61]">
  100.                         {{ attribute(menuPhrases, 'offices-cologne') }}
  101.                     </a>
  102.                     <a href="{{ attribute(menuLinks, '/offices-duesseldorf') }}" class="block px-4 py-2 text-sm text-gray-800 hover:bg-[#aacf61]">
  103.                         {{ attribute(menuPhrases, 'offices-duesseldorf') }}
  104.                     </a>
  105.                     <a href="{{ attribute(menuLinks, '/coworking-cologne') }}" class="block px-4 py-2 text-sm text-gray-800 hover:bg-[#aacf61]">
  106.                         {{ attribute(menuPhrases, 'coworking-cologne') }}
  107.                     </a>
  108.                     <a href="{{ attribute(menuLinks, '/coworking-duesseldorf') }}" class="block px-4 py-2 text-sm text-gray-800 hover:bg-[#aacf61]">
  109.                         {{ attribute(menuPhrases, 'coworking-duesseldorf') }}
  110.                     </a>
  111.                     <a href="{{ attribute(menuLinks, '/geschaeftsadresse-cologne') }}" class="block px-4 py-2 text-sm text-gray-800 hover:bg-[#aacf61]">
  112.                         {{ attribute(menuPhrases, 'geschaeftsadresse-cologne') }}
  113.                     </a>
  114.                     <a href="{{ attribute(menuLinks, '/geschaeftsadresse-duesseldorf') }}" class="block px-4 py-2 text-sm text-gray-800 hover:bg-[#aacf61]">
  115.                         {{ attribute(menuPhrases, 'geschaeftsadresse-duesseldorf') }}
  116.                     </a>
  117.                 </div>
  118.             </li>
  119.             {# ── Konferenzräume ── #}
  120.             <li x-data="{ open: false }" @click.away="open = false" @mouseenter="open = true" @mouseleave="open = false" class="relative my-1">
  121.                 <button @click="open = !open"
  122.                         class="flex items-center px-2 py-1.5 text-white hover:bg-[#aacf61] hover:text-black hover:rounded">
  123.                     {{ attribute(menuPhrases, 'tagen') }}
  124.                     <svg class="w-3 h-3 ml-1" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7"/></svg>
  125.                 </button>
  126.                 <div x-show="open" x-transition class="lg:absolute right-0 mt-1 w-64 bg-[#eae9e9] rounded shadow-lg py-1 z-50">
  127.                     <a href="{{ attribute(menuLinks, '/tagungsraum-koeln') }}" class="block px-4 py-2 text-sm text-gray-800 hover:bg-[#aacf61]">
  128.                         {{ attribute(menuPhrases, 'tagungsraum-koeln') }}
  129.                     </a>
  130.                     <a href="{{ attribute(menuLinks, '/tagungsraum-dus') }}" class="block px-4 py-2 text-sm text-gray-800 hover:bg-[#aacf61]">
  131.                         {{ attribute(menuPhrases, 'tagungsraum-dus') }}
  132.                     </a>
  133.                 </div>
  134.             </li>
  135.             {# ── Events ── #}
  136.             <li class="my-1 {{ 'events' in targetPath ? 'border-b-[3px] border-[#AACF61]' : '' }}">
  137.                 <a href="{{ attribute(menuLinks, '/events') }}"
  138.                    class="block px-2 py-1.5 text-white hover:bg-[#aacf61] hover:text-black hover:rounded">
  139.                     {{ attribute(menuPhrases, 'events') }}
  140.                 </a>
  141.             </li>
  142.             {# ── Über uns ── #}
  143.             {% set aboutHighlight = false %}
  144.             {% if lang == 'DE' %}
  145.                 {% if 'presse' in targetPath or 'standorte' in targetPath or 'startplatz-team' in targetPath
  146.                     or 'partner' in targetPath or 'startups' in targetPath or 'jobs' in targetPath or 'software' in targetPath
  147.                     or 'sprechstunden' in targetPath or 'referenzen' in targetPath or 'carrer' in targetPath %}
  148.                     {% set aboutHighlight = true %}
  149.                 {% endif %}
  150.             {% else %}
  151.                 {% if '/en/presse' in targetPath or '/en/standorte' in targetPath or '/en/startplatz-team' in targetPath
  152.                     or '/en/partner' in targetPath or '/en/startups' in targetPath or '/en/jobs' in targetPath or '/en/software' in targetPath
  153.                     or '/en/sprechstunden' in targetPath or '/en/referenzen' in targetPath or '/en/carrer' in targetPath %}
  154.                     {% set aboutHighlight = true %}
  155.                 {% endif %}
  156.             {% endif %}
  157.             <li x-data="{ open: false }" @click.away="open = false" @mouseenter="open = true" @mouseleave="open = false" class="relative my-1 {{ aboutHighlight ? 'border-b-[3px] border-[#AACF61]' : '' }}">
  158.                 <button @click="open = !open"
  159.                         class="flex items-center px-2 py-1.5 text-white hover:bg-[#aacf61] hover:text-black hover:rounded">
  160.                     {{ attribute(menuPhrases, 'ueber-uns') }}
  161.                     <svg class="w-3 h-3 ml-1" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7"/></svg>
  162.                 </button>
  163.                 <div x-show="open" x-transition class="lg:absolute right-0 mt-1 w-56 bg-[#eae9e9] rounded shadow-lg py-1 z-50">
  164.                     <a href="{{ attribute(menuLinks, '/ueber-startplatz') }}" class="block px-4 py-2 text-sm text-gray-800 hover:bg-[#aacf61]">
  165.                         {{ attribute(menuPhrases, 'ueber-startplatz') }}
  166.                     </a>
  167.                     <a href="{{ attribute(menuLinks, '/standorte') }}" class="block px-4 py-2 text-sm text-gray-800 hover:bg-[#aacf61]">
  168.                         {{ attribute(menuPhrases, 'standorte') }}
  169.                     </a>
  170.                     <a href="{{ attribute(menuLinks, '/startplatz-team') }}" class="block px-4 py-2 text-sm text-gray-800 hover:bg-[#aacf61]">
  171.                         {{ attribute(menuPhrases, 'startplatz-team') }}
  172.                     </a>
  173.                     {# Partner link → new /partners route #}
  174.                     <a href="{{ lang == 'EN' ? '/en/partners' : '/partners' }}" class="block px-4 py-2 text-sm text-gray-800 hover:bg-[#aacf61]">
  175.                         {{ attribute(menuPhrases, 'partner') }}
  176.                     </a>
  177.                     <a href="{{ attribute(menuLinks, '/startups') }}" class="block px-4 py-2 text-sm text-gray-800 hover:bg-[#aacf61]">
  178.                         {{ attribute(menuPhrases, 'startups') }}
  179.                     </a>
  180.                     <a href="{{ attribute(menuLinks, '/referenzen') }}" class="block px-4 py-2 text-sm text-gray-800 hover:bg-[#aacf61]">
  181.                         {{ attribute(menuPhrases, 'referenzen') }}
  182.                     </a>
  183.                     <a href="{{ attribute(menuLinks, '/career') }}" class="block px-4 py-2 text-sm text-gray-800 hover:bg-[#aacf61]">
  184.                         {{ attribute(menuPhrases, 'career') }}
  185.                     </a>
  186.                 </div>
  187.             </li>
  188.             {# ── Blog ── #}
  189.             <li class="my-1">
  190.                 <a href="{{ attribute(menuLinks, '/blog') }}"
  191.                    class="block px-2 py-1.5 text-white hover:bg-[#aacf61] hover:text-black hover:rounded">
  192.                     {{ attribute(menuPhrases, 'blog') }}
  193.                 </a>
  194.             </li>
  195.             {# ── Language Switcher ── #}
  196.             <li x-data="{ open: false }" @click.away="open = false" @mouseenter="open = true" @mouseleave="open = false" class="relative my-1">
  197.                 <button @click="open = !open"
  198.                         class="flex items-center px-2 py-1.5 text-white hover:bg-[#aacf61] hover:text-black hover:rounded">
  199.                     <svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 12a9 9 0 01-9 9m9-9a9 9 0 00-9-9m9 9H3m9 9a9 9 0 01-9-9m9 9c1.657 0 3-4.03 3-9s-1.343-9-3-9m0 18c-1.657 0-3-4.03-3-9s1.343-9 3-9m-9 9a9 9 0 019-9"/></svg>
  200.                     <svg class="w-3 h-3 ml-1" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7"/></svg>
  201.                 </button>
  202.                 <div x-show="open" x-transition class="lg:absolute right-0 mt-1 w-16 bg-[#eae9e9] rounded shadow-lg py-1 z-50">
  203.                     {# German #}
  204.                     {% if attribute(menuLinksEn2De, targetPath) is defined %}
  205.                         <a class="block px-3 py-2 hover:bg-[#aacf61]" href="{{ attribute(menuLinksEn2De, targetPath) }}">
  206.                             <img src="/bundles/startplatzstyle/images/german_language.png" class="h-5" alt="Deutsch">
  207.                         </a>
  208.                     {% elseif attribute(menuLinksFr2De, targetPath) is defined %}
  209.                         <a class="block px-3 py-2 hover:bg-[#aacf61]" href="{{ attribute(menuLinksFr2De, targetPath) }}">
  210.                             <img src="/bundles/startplatzstyle/images/german_language.png" class="h-5" alt="Deutsch">
  211.                         </a>
  212.                     {% else %}
  213.                         <a class="block px-3 py-2 hover:bg-[#aacf61]" href="/">
  214.                             <img src="/bundles/startplatzstyle/images/german_language.png" class="h-5" alt="Deutsch">
  215.                         </a>
  216.                     {% endif %}
  217.                     {# English #}
  218.                     {% if attribute(menuLinksDe2En, targetPath) is defined %}
  219.                         <a class="block px-3 py-2 hover:bg-[#aacf61]" href="{{ attribute(menuLinksDe2En, targetPath) }}">
  220.                             <img src="/bundles/startplatzstyle/images/english_language.png" class="h-5" alt="English">
  221.                         </a>
  222.                     {% elseif attribute(menuLinksFr2En, targetPath) is defined %}
  223.                         <a class="block px-3 py-2 hover:bg-[#aacf61]" href="{{ attribute(menuLinksFr2En, targetPath) }}">
  224.                             <img src="/bundles/startplatzstyle/images/english_language.png" class="h-5" alt="English">
  225.                         </a>
  226.                     {% else %}
  227.                         <a class="block px-3 py-2 hover:bg-[#aacf61]" href="/en">
  228.                             <img src="/bundles/startplatzstyle/images/english_language.png" class="h-5" alt="English">
  229.                         </a>
  230.                     {% endif %}
  231.                     {# French #}
  232.                     {% if attribute(menuLinksDe2Fr, targetPath) is defined %}
  233.                         <a class="block px-3 py-2 hover:bg-[#aacf61]" href="{{ attribute(menuLinksDe2Fr, targetPath) }}">
  234.                             <img src="/bundles/startplatzstyle/images/french_language.png" class="h-5" alt="Français">
  235.                         </a>
  236.                     {% elseif attribute(menuLinksEn2Fr, targetPath) is defined %}
  237.                         <a class="block px-3 py-2 hover:bg-[#aacf61]" href="{{ attribute(menuLinksEn2Fr, targetPath) }}">
  238.                             <img src="/bundles/startplatzstyle/images/french_language.png" class="h-5" alt="Français">
  239.                         </a>
  240.                     {% else %}
  241.                         <a class="block px-3 py-2 hover:bg-[#aacf61]" href="/fr/">
  242.                             <img src="/bundles/startplatzstyle/images/french_language.png" class="h-5" alt="Français">
  243.                         </a>
  244.                     {% endif %}
  245.                 </div>
  246.             </li>
  247.             {# ── User / Login ── #}
  248.             {% if app.user %}
  249.                 <li x-data="{ open: false }" @click.away="open = false" @mouseenter="open = true" @mouseleave="open = false" class="relative my-1 ml-3">
  250.                     {# Desktop: Avatar circle #}
  251.                     <button @click="open = !open" class="hidden lg:block w-[45px] h-[45px] rounded-full overflow-hidden bg-gray-200">
  252.                         <img src="{{ app.user.member.imageLink }}"
  253.                              alt="" class="w-full h-full object-cover rounded-full border-2 border-white shadow-inner">
  254.                     </button>
  255.                     {# Mobile: Text link #}
  256.                     <button @click="open = !open" class="lg:hidden flex items-center px-2 py-1.5 text-white hover:bg-[#aacf61] hover:text-black hover:rounded">
  257.                         <svg class="w-4 h-4 mr-1" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z"/></svg>
  258.                         {{ app.user }}
  259.                     </button>
  260.                     <div x-show="open" x-transition class="lg:absolute right-0 mt-1 w-48 bg-[#eae9e9] rounded shadow-lg py-1 z-50">
  261.                         <span class="block px-4 py-2 text-sm font-semibold text-gray-800" style="background-color: rgba(170,207,97,0.6);">
  262.                             {{ app.user.username }}
  263.                         </span>
  264.                         <a href="{{ path('connect_member_show') }}" class="block px-4 py-2 text-sm text-gray-800 hover:bg-[#aacf61]">My Profile</a>
  265.                         <a href="{{ path('x_home') }}" class="block px-4 py-2 text-sm text-gray-800 hover:bg-[#aacf61]">SP-Connect</a>
  266.                         {% if is_granted('ROLE_ADMIN') %}
  267.                             <a href="{{ path('allmeda_home') }}" class="block px-4 py-2 text-sm text-gray-800 hover:bg-[#aacf61]">Allmeda</a>
  268.                         {% endif %}
  269.                         <hr class="my-1 border-gray-400">
  270.                         <a href="{{ path('logout') }}" class="block px-4 py-2 text-sm text-gray-800 hover:bg-[#aacf61]">Logout</a>
  271.                     </div>
  272.                 </li>
  273.             {% else %}
  274.                 <li class="my-1 ml-4">
  275.                     <a href="{{ path('login') }}"
  276.                        class="block px-4 py-1.5 text-white rounded bg-[#7ab800] hover:bg-[#5a8c00] transition-colors">
  277.                         Login
  278.                     </a>
  279.                 </li>
  280.             {% endif %}
  281.         </ul>
  282.     </div>
  283. </nav>