{% extends '@StartPlatzStyleBundle/Bootstrap4/base.homepage.oneColumn.html.twig' %}{% block title %}{{ pageTitle }}{% endblock %}{% block additionalHead %} <link rel="stylesheet" href="{{ asset('bundles/startplatzstyle/css/startplatz.accelerator.css') }}">{% endblock %}{% block navigation %} {# Use menu from WordPress (loaded by controller) #} {{ menu|raw }}{% endblock %}{% block content %}<div class="container with-program-banner"> <div class="text-center mb-5 pt-5"> <h1 class="display-4">{{ pageTitle }}</h1> <p class="lead">{{ pageDescription }}</p> </div> {# Filter buttons #} <div class="row mb-4"> <div class="col-12 text-center"> <div class="btn-group" role="group"> <button type="button" class="btn btn-primary filter-btn" data-filter="all"> {{ isEnglish ? 'All' : 'Alle' }} </button> <button type="button" class="btn btn-outline-primary filter-btn" data-filter="tech-development"> Tech & Development </button> <button type="button" class="btn btn-outline-primary filter-btn" data-filter="business-strategy"> Business & Strategy </button> <button type="button" class="btn btn-outline-primary filter-btn" data-filter="sales-marketing"> Sales & Marketing </button> <button type="button" class="btn btn-outline-primary filter-btn" data-filter="finance-legal"> Finance & Legal </button> <button type="button" class="btn btn-outline-primary filter-btn" data-filter="product-design"> Product & Design </button> </div> </div> </div> {# Search bar #} <div class="row mb-4"> <div class="col-md-6 mx-auto"> <form method="get"> <div class="input-group"> <input type="text" name="search" class="form-control" placeholder="Mentor suchen..." value="{{ searchQuery }}"> <div class="input-group-append"> <button class="btn btn-primary" type="submit"> <i class="fas fa-search"></i> Suchen </button> </div> </div> </form> </div> </div> {# Mentor cards grid #} <div class="row" id="mentors-grid"> {% if mentors is empty %} <div class="col-12 text-center"> <p class="text-muted">Noch keine Mentoren verfügbar. Neue Mentoren werden bald hinzugefügt!</p> </div> {% else %} {% for mentor in mentors %} <div class="col-md-4 mb-4 mentor-col"> {% include '@StartPlatzMentors/Public/_accelerator-mentor-card.html.twig' with {'mentor': mentor, 'language': isEnglish ? 'en' : 'de'} %} </div> {% endfor %} {% endif %} </div> {# No results message (hidden by default) #} <div class="row" id="no-results" style="display: none;"> <div class="col-12 text-center"> <p class="text-muted"> {{ isEnglish ? 'No mentors found for this category.' : 'Keine Mentoren in dieser Kategorie gefunden.' }} </p> </div> </div></div>{% endblock %}{% block javascripts %} {{ parent() }} <script> // Filter functionality document.addEventListener('DOMContentLoaded', function() { const filterButtons = document.querySelectorAll('.filter-btn'); const mentorCols = document.querySelectorAll('.mentor-col'); const noResultsMessage = document.getElementById('no-results'); filterButtons.forEach(button => { button.addEventListener('click', function() { // Update button states filterButtons.forEach(btn => { btn.classList.remove('btn-primary'); btn.classList.add('btn-outline-primary'); }); this.classList.remove('btn-outline-primary'); this.classList.add('btn-primary'); // Get selected filter const filter = this.dataset.filter; // Filter mentor cards let visibleCount = 0; mentorCols.forEach(col => { const card = col.querySelector('.mentor-card'); if (card) { const categories = card.dataset.categories ? card.dataset.categories.split(',') : []; if (filter === 'all' || categories.includes(filter)) { col.style.display = 'block'; visibleCount++; } else { col.style.display = 'none'; } } }); // Show/hide no results message if (visibleCount === 0) { noResultsMessage.style.display = 'block'; } else { noResultsMessage.style.display = 'none'; } }); }); // Trigger click on "All" button to initialize const allButton = document.querySelector('.filter-btn[data-filter="all"]'); if (allButton) { allButton.click(); } }); </script> <script src="{{ asset('bundles/startplatzstyle/js/startplatz.accelerator.js') }}"></script>{% endblock %}