templates/Front/Main/homepage.html.twig line 1

Open in your IDE?
  1. {% extends "Global/layout.html.twig" %}
  2. {% block title %}{{ services.getSetting("website_description_" ~ (app.request.get('_locale') ? app.request.get('_locale') : app.request.defaultLocale)) }}{% endblock %}
  3. {% block content %}
  4.     {% if herosettings.content == "events" and herosettings.events|length %}
  5.     <section class="section-main">
  6.         <div class="owl-init slider-main homepage-slider owl-carousel" data-items="1" data-dots="true" data-nav="true" data-autoplay="true" data-rtl="true">
  7.             {% for event in herosettings.events %}
  8.                 <div class="item-slide img-lazy-load" data-src="{{ event.imageName ? asset(event.getImagePath) : event.getImagePlaceholder }}">
  9.                     <div class="loader"></div>
  10.                     <div class="content-container">
  11.                         <div class="{{ services.getSetting("app_layout") }}">
  12.                             <div class="row-sm">
  13.                                 <div class="col-md-12">
  14.                                     <h2 class="text-light mb-4">{{ event.name }}</h2>
  15.                                     {% if event.getFirstOnSaleEventDate %}
  16.                                         <h5 class="text-light mb-2"><i class="fas fa-map-marker-alt fa-fw"></i>
  17.                                             {% if event.getFirstOnSaleEventDate.venue %}
  18.                                                 {{ event.getFirstOnSaleEventDate.venue.name }}: {{ event.getFirstOnSaleEventDate.venue.city ~ ', ' ~ event.getFirstOnSaleEventDate.venue.country.name }}
  19.                                             {% else %}
  20.                                                 {{ "Online"|trans }}
  21.                                             {% endif %}
  22.                                         </h5>
  23.                                         {% if event.getFirstOnSaleEventDate.startdate %}
  24.                                             <h5 class="text-light mb-4"><i class="fas fa-clock fa-fw"></i> {{ event.getFirstOnSaleEventDate.startdate|localizeddate('none', 'none', app.request.locale, date_timezone, date_format) }}</h5>
  25.                                         {% endif %}
  26.                                     {% endif %}
  27.                                     <a href="{{ path('event', { slug : event.slug }) }}" class="btn btn-light btn-lg"><i class="fas fa-ticket-alt fa-fw"></i> {{ "Buy tickets"|trans }}</a>
  28.                                 </div>
  29.                             </div>
  30.                         </div>
  31.                     </div>
  32.                 </div>
  33.             {% endfor %}
  34.         </div>
  35.     </section>
  36.     {% endif %}
  37.         {% if herosettings.content == "organizers" and herosettings.organizers|length %}
  38.         <section class="section-main">
  39.             <div class="owl-init slider-main homepage-slider owl-carousel" data-items="1" data-dots="true" data-nav="true" data-autoplay="true">
  40.                 {% for user in herosettings.organizers %}
  41.                     {% if user.organizer.coverName %}
  42.                         <div class="item-slide img-lazy-load" data-src="{{ asset(user.organizer.getCoverPath) }}">
  43.                             <div class="loader"></div>
  44.                             <div class="content-container">
  45.                                 <div class="{{ services.getSetting("app_layout") }}">
  46.                                     <div class="row-sm">
  47.                                         <div class="col-md-12">
  48.                                             <h2 class="text-light mb-4">{{ user.organizer.name }}</h2>
  49.                                             {% if user.organizer.description %}
  50.                                                 <p class="text-light mb-4">{{ user.organizer.description|striptags }}</p>
  51.                                             {% endif %}
  52.                                             <a href="{{ path('events', { organizer : user.organizer.slug }) }}" class="btn btn-light btn-lg"><i class="fas fa-ticket-alt fa-fw"></i> {{ "Buy tickets"|trans }}</a>
  53.                                         </div>
  54.                                     </div>
  55.                                 </div>
  56.                             </div>
  57.                         </div>
  58.                     {% endif %}
  59.                 {% endfor %}
  60.             </div>
  61.         </section>
  62.         {% endif %}
  63.             {% if herosettings.content == "custom" %}
  64.             <section class="section-intro bg-dark text-white text-center">
  65.                 <div class="homepage-custom-hero-background d-flex flex-column img-lazy-load" {% if herosettings.customBackgroundName %}data-src="{{ herosettings.getCustomBackgroundPath }}"{% endif %}>
  66.                     <div class="{{ services.getSetting("app_layout") }} my-auto">
  67.                         <div class="row">
  68.                             <div class="col-lg-8 col-sm-12 text-center mx-auto">
  69.                                 {% if herosettings.title %}
  70.                                     <h2 class="display-4 mt-3 mb-3">{{ herosettings.title }}</h2>
  71.                                 {% endif %}
  72.                                 {% if herosettings.paragraph %}
  73.                                     <h3 class="mb-5 font-weight-lighter">{{ herosettings.paragraph }}</h3>
  74.                                 {% endif %}
  75.                             </div>
  76.                         </div>
  77.                         {% if herosettings.showSearchBox %}
  78.                             <div class="row">
  79.                                 <div class="col-lg-9 col-md-8 col-sm-12 mx-auto">
  80.                                     <div class="card">
  81.                                         <div class="card-body p30">
  82.                                             <form action="{{ path('events') }}">
  83.                                                 <div class="form-row text-left">
  84.                                                     <div class="col-lg-3 col-sm-12">
  85.                                                         <label for="hero-search-category" class="form-label text-dark">{{ "Looking for"|trans }}</label>
  86.                                                         <select id="hero-search-category" class="select2" name="category" data-sort-options="1">
  87.                                                             <option value>{{ "Anything"|trans }}</option>
  88.                                                             {% for category in services.getCategories({}).getQuery().getResult() %}
  89.                                                                 <option value="{{ category.slug }}">{{ category.name }}</option>
  90.                                                             {% endfor %}
  91.                                                         </select>
  92.                                                     </div>
  93.                                                     <div class="col-lg-3 col-sm-12">
  94.                                                         <label for="hero-search-country" class="form-label text-dark">{{ "In"|trans }}</label>
  95.                                                         <select id="hero-search-country" class="select2" name="country" data-sort-options="1">
  96.                                                             <option value>{{ "Anywhere"|trans }}</option>
  97.                                                             {% for country in services.getCountries({}).getQuery().getResult() %}
  98.                                                                 <option value="{{ country.slug }}">{{ country.name }}</option>
  99.                                                             {% endfor %}
  100.                                                         </select>
  101.                                                     </div>
  102.                                                     <div class="col-lg-3 col-sm-12">
  103.                                                         <label for="hero-search-stardate" class="form-label text-dark">{{ "When"|trans }}</label>
  104.                                                         <select id="hero-search-stardate" class="select2" name="startdate">
  105.                                                             <option value>{{ "Anytime"|trans }}</option>
  106.                                                             <option value="today">{{ "Today"|trans }}</option>
  107.                                                             <option value="tomorrow">{{ "Tomorrow"|trans }}</option>
  108.                                                             <option value="thisweekend">{{ "This weekend"|trans }}</option>
  109.                                                             <option value="thisweek">{{ "This week"|trans }}</option>
  110.                                                             <option value="nextweek">{{ "Next week"|trans }}</option>
  111.                                                             <option value="thismonth">{{ "This month"|trans }}</option>
  112.                                                             <option value="nextmonth">{{ "Next month"|trans }}</option>
  113.                                                         </select>
  114.                                                     </div>
  115.                                                     <div class="col-lg-3 col-sm-12 my-auto">
  116.                                                         <button class="btn btn-light btn-block" type="submit"><i class="fas fa-search"></i> {{ "Search"|trans }}</button>
  117.                                                     </div>
  118.                                                 </div>
  119.                                             </form>
  120.                                         </div>
  121.                                     </div>
  122.                                 </div>
  123.                             </div>
  124.                         {% endif %}
  125.                     </div>
  126.                 </div>
  127.             </section>
  128.             {% endif %}
  129.                 {% if services.getSetting('homepage_show_search_box') == "yes" %}
  130.                     <section>
  131.                         <form action="{{ path('events') }}">
  132.                             <div class="row bg-gray m-0">
  133.                                 <div class="col-md-4 p30 border-right-white">
  134.                                     <div class="form-group">
  135.                                         <label for="search-category" class="form-label text-dark">{{ "Looking for"|trans }}</label>
  136.                                         <select id="search-category" class="select2 bg-white" name="category" data-sort-options="1">
  137.                                             <option value>{{ "Anything"|trans }}</option>
  138.                                             {% for category in services.getCategories({}).getQuery().getResult() %}
  139.                                                 <option value="{{ category.slug }}">{{ category.name }}</option>
  140.                                             {% endfor %}
  141.                                         </select>
  142.                                     </div>
  143.                                 </div>
  144.                                 <div class="col-md-4 p30 border-right-white">
  145.                                     <div class="form-group">
  146.                                         <label for="search-country" class="form-label text-dark">{{ "In"|trans }}</label>
  147.                                         <select id="search-country" class="select2 bg-white" name="country" data-sort-options="1">
  148.                                             <option value>{{ "Anywhere"|trans }}</option>
  149.                                             {% for country in services.getCountries({}).getQuery().getResult() %}
  150.                                                 <option value="{{ country.slug }}">{{ country.name }}</option>
  151.                                             {% endfor %}
  152.                                         </select>
  153.                                     </div>
  154.                                 </div>
  155.                                 <div class="col-md-4 p30">
  156.                                     <div class="form-group">
  157.                                         <label for="search-startdate" class="form-label text-dark">{{ "When" }}</label>
  158.                                         <select id="search-startdate" class="select2 bg-white" name="startdate">
  159.                                             <option value>{{ "Anytime"|trans }}</option>
  160.                                             <option value="today">{{ "Today"|trans }}</option>
  161.                                             <option value="tomorrow">{{ "Tomorrow"|trans }}</option>
  162.                                             <option value="thisweekend">{{ "This weekend"|trans }}</option>
  163.                                             <option value="thisweek">{{ "This week"|trans }}</option>
  164.                                             <option value="nextweek">{{ "Next week"|trans }}</option>
  165.                                             <option value="thismonth">{{ "This month"|trans }}</option>
  166.                                             <option value="nextmonth">{{ "Next month"|trans }}</option>
  167.                                         </select>
  168.                                     </div>
  169.                                 </div>
  170.                                 <div class="col-12 text-center mb-5">
  171.                                     <button class="btn btn-light" type="submit"><i class="fas fa-search"></i> {{ "Search"|trans }}</button>
  172.                                 </div>
  173.                             </div>
  174.                         </form>
  175.                     </section>
  176.                 {% endif %}
  177.                 {% if services.getSetting('homepage_events_number') %}
  178.                     {% set homepageEvents = services.getEvents({"limit": services.getSetting('homepage_events_number')}).getQuery().getResult() %}
  179.                     {% if homepageEvents|length > 0 %}
  180.                         <section class="section-content padding-y-lg bg-white">
  181.                             <div class="{{ services.getSetting("app_layout") }}">
  182.                                 <header class="section-headin mb-5">
  183.                                     <h4 class="title-section text-center text-muted text-uppercase">{{'Upcoming events' | trans}}</h4>
  184.                                 </header>
  185.                                 <div class="row-sm">
  186.                                     {% for event in homepageEvents %}
  187.                                         <div class="col-12 col-sm-6 col-lg-4">
  188.                                             {% include "Global/event-card.html.twig" with {event: event} %}
  189.                                         </div>
  190.                                     {% endfor %}
  191.                                 </div>
  192.                             </div>
  193.                         </section>
  194.                     {% endif %}
  195.                 {% endif %}
  196.                 {% if services.getSetting('homepage_categories_number') > 0 %}
  197.                     <section class="section-content padding-y-lg">
  198.                         <div class="{{ services.getSetting("app_layout") }}">
  199.                             <header class="section-headin mb-5">
  200.                                 <h4 class="title-section text-center text-muted text-uppercase">{{'Featured categories' | trans}}</h4>
  201.                             </header>
  202.                             <div class="row-sm">
  203.                                 {% for category in services.getCategories({ "featured": true, "limit": services.getSetting('homepage_categories_number') }).getQuery().getResult() %}
  204.                                     <div class="col-md-3 col-sm-3">
  205.                                         {% include "Global/category-card.html.twig" %}
  206.                                     </div>
  207.                                 {% endfor %}
  208.                             </div>
  209.                         </div>
  210.                     </section>
  211.                 {% endif %}
  212.                 {% if services.getSetting('homepage_blogposts_number') > 0 %}
  213.                     {% set latestblogposts = services.getBlogPosts({"limit": services.getSetting('homepage_blogposts_number')}).getQuery().getResult() %}
  214.                     {% if latestblogposts|length %}
  215.                         <section class="section-content padding-y-lg bg-white">
  216.                             <div class="{{ services.getSetting("app_layout") }}">
  217.                                 <header class="section-headin mb-5">
  218.                                     <h4 class="title-section text-center text-muted text-uppercase">{{'Lastest blog posts' | trans}}</h4>
  219.                                 </header>
  220.                                 <div class="row">
  221.                                     <div class="col-12">
  222.                                         <div class="owl-init owl-carousel" data-margin="15" data-items="5" data-dots="true" data-nav="false" data-autoplay="false">
  223.                                             {% for blogpost in latestblogposts %}
  224.                                                 {% include "Global/blog-card.html.twig" with {blogpost: blogpost, thumbnailsize: [241, 241]} %}
  225.                                             {% endfor %}
  226.                                         </div>
  227.                                     </div>
  228.                                 </div>
  229.                             </div>
  230.                         </section>
  231.                     {% endif %}
  232.                 {% endif %}
  233.                 {% if services.getSetting('homepage_show_call_to_action') == "yes" %}
  234.                     <section class="section-intro padding-y-lg">
  235.                         <div class="{{ services.getSetting("app_layout") }}">
  236.                             <div class="row">
  237.                                 <div class="col-md-10 text-center">
  238.                                     <article class="text-dark text-center text-lg-left mb-3">
  239.                                         <h3>{{ "Are you ready to take your"|trans }} <b class="rotate-words">{% for category in services.getCategories({ "featured": true, "limit": 9 }).getQuery().getResult() %}{{ category.name|lower }}{% if not loop.last %}|{% endif %}{% endfor %}</b> {{ "event to the next level ?"|trans }}</h3>
  240.                                     </article>
  241.                                 </div>
  242.                                 <div class="col-md-2 text-center text-lg-right">
  243.                                     <a href="{{ path('dashboard_organizer_event_add') }}" class="btn btn-light"><i class="fas fa-calendar-plus"></i> {{ "Create my event"|trans }}</a>
  244.                                 </div>
  245.                             </div>
  246.                         </div>
  247.                     </section>
  248.                 {% endif %}
  249.                 {% endblock %}