src/StartPlatz/Bundle/MentorsBundle/Resources/views/Public/accelerator-mentors.html.twig line 1

Open in your IDE?
  1. {% extends '@StartPlatzStyleBundle/Bootstrap4/base.homepage.oneColumn.html.twig' %}
  2. {% block title %}{{ pageTitle }}{% endblock %}
  3. {% block additionalHead %}
  4.     <link rel="stylesheet" href="{{ asset('bundles/startplatzstyle/css/startplatz.accelerator.css') }}">
  5. {% endblock %}
  6. {% block navigation %}
  7.     {# Use menu from WordPress (loaded by controller) #}
  8.     {{ menu|raw }}
  9. {% endblock %}
  10. {% block content %}
  11. <div class="container with-program-banner">
  12.     <div class="text-center mb-5 pt-5">
  13.         <h1 class="display-4">{{ pageTitle }}</h1>
  14.         <p class="lead">{{ pageDescription }}</p>
  15.     </div>
  16.     {# Filter buttons #}
  17.     <div class="row mb-4">
  18.         <div class="col-12 text-center">
  19.             <div class="btn-group" role="group">
  20.                 <button type="button" class="btn btn-primary filter-btn" data-filter="all">
  21.                     {{ isEnglish ? 'All' : 'Alle' }}
  22.                 </button>
  23.                 <button type="button" class="btn btn-outline-primary filter-btn" data-filter="tech-development">
  24.                     Tech & Development
  25.                 </button>
  26.                 <button type="button" class="btn btn-outline-primary filter-btn" data-filter="business-strategy">
  27.                     Business & Strategy
  28.                 </button>
  29.                 <button type="button" class="btn btn-outline-primary filter-btn" data-filter="sales-marketing">
  30.                     Sales & Marketing
  31.                 </button>
  32.                 <button type="button" class="btn btn-outline-primary filter-btn" data-filter="finance-legal">
  33.                     Finance & Legal
  34.                 </button>
  35.                 <button type="button" class="btn btn-outline-primary filter-btn" data-filter="product-design">
  36.                     Product & Design
  37.                 </button>
  38.             </div>
  39.         </div>
  40.     </div>
  41.     {# Search bar #}
  42.     <div class="row mb-4">
  43.         <div class="col-md-6 mx-auto">
  44.             <form method="get">
  45.                 <div class="input-group">
  46.                     <input type="text" name="search" class="form-control" placeholder="Mentor suchen..." value="{{ searchQuery }}">
  47.                     <div class="input-group-append">
  48.                         <button class="btn btn-primary" type="submit">
  49.                             <i class="fas fa-search"></i> Suchen
  50.                         </button>
  51.                     </div>
  52.                 </div>
  53.             </form>
  54.         </div>
  55.     </div>
  56.     {# Mentor cards grid #}
  57.     <div class="row" id="mentors-grid">
  58.         {% if mentors is empty %}
  59.             <div class="col-12 text-center">
  60.                 <p class="text-muted">Noch keine Mentoren verfügbar. Neue Mentoren werden bald hinzugefügt!</p>
  61.             </div>
  62.         {% else %}
  63.             {% for mentor in mentors %}
  64.                 <div class="col-md-4 mb-4 mentor-col">
  65.                     {% include '@StartPlatzMentors/Public/_accelerator-mentor-card.html.twig' with {'mentor': mentor, 'language': isEnglish ? 'en' : 'de'} %}
  66.                 </div>
  67.             {% endfor %}
  68.         {% endif %}
  69.     </div>
  70.     {# No results message (hidden by default) #}
  71.     <div class="row" id="no-results" style="display: none;">
  72.         <div class="col-12 text-center">
  73.             <p class="text-muted">
  74.                 {{ isEnglish ? 'No mentors found for this category.' : 'Keine Mentoren in dieser Kategorie gefunden.' }}
  75.             </p>
  76.         </div>
  77.     </div>
  78. </div>
  79. {% endblock %}
  80. {% block javascripts %}
  81.     {{ parent() }}
  82.     <script>
  83.         // Filter functionality
  84.         document.addEventListener('DOMContentLoaded', function() {
  85.             const filterButtons = document.querySelectorAll('.filter-btn');
  86.             const mentorCols = document.querySelectorAll('.mentor-col');
  87.             const noResultsMessage = document.getElementById('no-results');
  88.             filterButtons.forEach(button => {
  89.                 button.addEventListener('click', function() {
  90.                     // Update button states
  91.                     filterButtons.forEach(btn => {
  92.                         btn.classList.remove('btn-primary');
  93.                         btn.classList.add('btn-outline-primary');
  94.                     });
  95.                     this.classList.remove('btn-outline-primary');
  96.                     this.classList.add('btn-primary');
  97.                     // Get selected filter
  98.                     const filter = this.dataset.filter;
  99.                     // Filter mentor cards
  100.                     let visibleCount = 0;
  101.                     mentorCols.forEach(col => {
  102.                         const card = col.querySelector('.mentor-card');
  103.                         if (card) {
  104.                             const categories = card.dataset.categories ? card.dataset.categories.split(',') : [];
  105.                             if (filter === 'all' || categories.includes(filter)) {
  106.                                 col.style.display = 'block';
  107.                                 visibleCount++;
  108.                             } else {
  109.                                 col.style.display = 'none';
  110.                             }
  111.                         }
  112.                     });
  113.                     // Show/hide no results message
  114.                     if (visibleCount === 0) {
  115.                         noResultsMessage.style.display = 'block';
  116.                     } else {
  117.                         noResultsMessage.style.display = 'none';
  118.                     }
  119.                 });
  120.             });
  121.             // Trigger click on "All" button to initialize
  122.             const allButton = document.querySelector('.filter-btn[data-filter="all"]');
  123.             if (allButton) {
  124.                 allButton.click();
  125.             }
  126.         });
  127.     </script>
  128.     <script src="{{ asset('bundles/startplatzstyle/js/startplatz.accelerator.js') }}"></script>
  129. {% endblock %}