templates/front/index.html.twig line 1

Open in your IDE?
  1. {% extends 'base_front.html.twig' %}
  2. {% block meta %}
  3.     <title>Préparez votre vacance sur Hobbiinn</title>
  4.     {# <meta name="description" content="Providders permet de mettre en relation des prestataires et futurs mariés. Actuellement, {{ productsCount }} services sont disponibles parmis les évènements {% for category in categories %}{{ category.name }}{% endfor %}"> #}
  5. {% endblock %}
  6. {% block style %}
  7.     <link href="{{ asset('css/jquery-ui.css') }}" rel="stylesheet">
  8.     <link href="{{ asset('css/providders.css') }}" rel="stylesheet">
  9.     <link rel="stylesheet" href="{{ asset('css/jquery.datetimepicker.min.css') }}">
  10.     <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/notyf@3/notyf.min.css">
  11.     <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/notyf@3/notyf.min.css">
  12.     {# Daterangepicker style #}
  13.     <link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/daterangepicker/daterangepicker.css" />
  14.     <style>
  15.         /** DateTimePicker Style */
  16.         .xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_default, .xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_current, .xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_time_box>div>div.xdsoft_current {
  17.             background: #FE7708;
  18.             box-shadow: #FE7708 1px 3px 0 inset;
  19.             color: #fff;
  20.             font-weight: 700;
  21.         }
  22.         .xdsoft_datetimepicker .xdsoft_calendar td:hover, .xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_time_box>div>div:hover {
  23.             color: #fff !important;
  24.             background: #FE7708 !important;
  25.             box-shadow: none !important;
  26.         }
  27.         .alert.alert-danger {
  28.             display: none;
  29.         }
  30.         {# Custom style daterangepicker #}
  31.         .drp-buttons .btn {
  32.             height: 30px;
  33.         }
  34.         @media screen and (max-width: 563px) {            
  35.             .drp-buttons .cancelBtn {
  36.                 margin-bottom: 10px;
  37.             }
  38.         }
  39.         .daterangepicker td.active,
  40.         .daterangepicker td.active:hover {
  41.             background-color: #eb5b20 !important;
  42.             color: #fff;
  43.         }
  44.         .daterangepicker td.in-range {
  45.             background-color: #eb5b201c;
  46.         }
  47.     </style>
  48. {% endblock %}
  49. {% block body %}
  50.     <!-- hero-section -->
  51.     <div class="hero-section position-relative heor-section-style" style="">
  52.         <div id="carouselExampleIndicators" class="carousel slide" data-ride="carousel">
  53.             <ol class="carousel-indicators">
  54.                 {% for slider in sliders %}
  55.                     <li data-target="#carouselExampleIndicators" data-slide-to="{{ loop.index -1 }}" class="{% if loop.first %}active{% endif %}"></li>
  56.                 {% endfor %}
  57.             </ol>
  58.             <div class="carousel-inner">
  59.                 {% for slider in sliders %}
  60.                     <div class="carousel-item {% if loop.first %}active{% endif %}">
  61.                         <div style="background:url({{ asset(constant('App\\Services\\File::IMAGE_CATEGORY_DIR') ~ slider) }})no-repeat center;background-size:cover;height:600px"></div>
  62.                         <div class="carousel-caption d-none d-md-block"></div>
  63.                     </div>
  64.                 {% endfor %}
  65.             </div>
  66.             {{ include('front/accueil/recherche.html.twig') }}
  67.         </div>
  68.     </div>
  69.     <!-- /.hero-section -->
  70.     <div class="bg-white space-small d-none">
  71.         <div class="container">
  72.             <div
  73.                 class="row" id="block_icons">
  74.                 <!-- feature-1 -->
  75.                 {% for block in pagesHome %}
  76.                     {% if block.name == 'Sous block 1' %}
  77.                         <div class="col-xl-4 col-lg-4 col-md-4 col-sm-4 col-12 mb20">
  78.                             <div class="icon-3x mb30 text-default d-flex justify-content-center">
  79.                                 <i class="icon-051-wedding-arch"></i>
  80.                             </div>
  81.                             <div class="centerBlock">
  82.                                 <h3>
  83.                                     <strong>{{ productsCount }}
  84.                                     Services disponibles</strong></h3>
  85.                                 <p>{{ block.description1 }}</p>
  86.                             </div>
  87.                         </div>
  88.                         <div class="col-xl-4 col-lg-4 col-md-4 col-sm-4 col-12 mb20">
  89.                             <div class="icon-3x mb30 text-default d-flex justify-content-center">
  90.                                 <i class="icon-051-love-birds"></i>
  91.                             </div>
  92.                             <div class="centerBlock">
  93.                                 <h3>
  94.                                     <strong>{{ commandsCount }}
  95.                                     prestations réalisées</strong></h3>
  96.                                 <p>{{ block.description2 }}</p>
  97.                             </div>
  98.                         </div>
  99.                         <div class="col-xl-4 col-lg-4 col-md-4 col-sm-4 col-12 mb20">
  100.                             <div class="icon-3x mb30 text-default d-flex justify-content-center">
  101.                                 <i class="icon-017-location"></i>
  102.                             </div>
  103.                             <div class="centerBlock">
  104.                                 <h3>
  105.                                     <strong>{{ departmentsCount }}
  106.                                     Départements disponibles</strong></h3>
  107.                                 <p>{{ block.description3 }}</p>
  108.                             </div>
  109.                         </div>
  110.                     {% endif %}
  111.                 {% endfor %}
  112.                 {% for block in pagesHome %}
  113.                     {% if block.name == 'Sous block 1' %}
  114.                         {% if is_granted('ROLE_ADMIN') %}
  115.                             <a href="{{ path('admin_modify_block_home', {'id': block.id}) }}" style="margin:auto">
  116.                                 <i class="fas fa-pencil-alt" style="font-size:2em;color:blue"></i>
  117.                             </a>
  118.                         {% endif %}
  119.                     {% endif %}
  120.                 {% endfor %}
  121.                 <!-- /.feature-3 -->
  122.             </div>
  123.         </div>
  124.     </div>
  125.     {{ include('front/accueil/bloc_reseauSocial.html.twig') }}
  126.     {{ include('front/accueil/rechercheParPrestataire.html.twig') }}
  127.     {# <div class="space-medium">
  128.         <div class="p-4">
  129.             <div class="row">
  130.                 <div class="col-xl-12  col-lg-12 col-md-12 col-sm-12 col-12">
  131.                     <div
  132.                         class="section-title text-center">
  133.                         <!-- section title start-->
  134.                         <h2 class="mb10">Recherche par type de service</h2>
  135.                     </div>
  136.                     <!-- /.section title start-->
  137.                 </div>
  138.             </div>
  139.             <div class="venue-thumbnail-carousel">
  140.                 <div class="owl-carousel car-one">
  141.                     {% for category in subCategories %}
  142.                         {% if category.isService %}
  143.                             <div class="item">
  144.                                 <div class="venue-categories-block col-md-12">
  145.                                     <div class="venue-categories-img zoomimg">
  146.                                         <a href="{{ path('front_product_category_events', {'subCategorySlug': category.subCategorySlug}) }}"><img src="{{ asset(constant('App\\Services\\File::IMAGE_CATEGORY_DIR') ~ category.image) }}" alt="{{ category.name }}" class="img-fluid"></a>
  147.                                         <div class="venue-categories-overlay">
  148.                                             {% set nbProduct = category.products|length %}
  149.                                             <h3 class="mb0">
  150.                                                 <a href="{{ path('front_product_category_events', {'subCategorySlug': category.subCategorySlug}) }}" class="venue-categories-title">{{ category.name }}
  151.                                                     ({{ nbProduct }})</a>
  152.                                             </h3>
  153.                                         </div>
  154.                                     </div>
  155.                                 </div>
  156.                             </div>
  157.                         {% endif %}
  158.                     {% endfor %}
  159.                 </div>
  160.             </div>
  161.         </div>
  162.     </div> #}
  163.     <!-- Annonces -->
  164.     <div class="container mt-4 d-none">
  165.         <h1>
  166.             <strong>Annonces</strong>
  167.         </h1>
  168.         <div id="allProduct" class="row">
  169.             {% if productss|length > 0 %}
  170.         {# <div class="col-12">
  171.             <button type="button" class="btn btn-primary mb-2" data-toggle="modal" data-target="#modalFilter">Filter</button>
  172.         </div> #}
  173.             {% for product in productss|slice(productss|length - 6 < 0 ? 0 : productss|length, productss|length) %} {# Affiche seulement les 6 dernière produits et service #}
  174.                 {# <pre>
  175.                     {{ dump(product) }}
  176.                 </pre> #}
  177.                 {% set subCategorySlug = product.subCategories.toArray()[0].subCategorySlug %}
  178.                 <div class="col-lg-4 col-sm-12 col-12" >
  179.                     <div class="container-block-Pcompanies mb-3">
  180.                         {# <div class="container-imageP zoomimg"> #}
  181.                         <div class="container-slide-image">
  182.                             {% if product.photos.first != false %}
  183.                                 {% for imgHebmt in product.photos.toArray() %}
  184.                                     <img src="{{ asset(constant('App\\Services\\File::IMAGE_PRODUCT_DIR') ~ imgHebmt.url) }}" alt="default image" class="img-fluid" style="height: 213px;object-fit: cover; border-radius: .5rem .5rem 0 0;">
  185.                                 {% endfor %}
  186.                             {% else %}
  187.                                 <img src="{{ asset('images/vecteezy_vector-gear-logo-design-with-multi-colors-range_6172776.jpg') }}" alt="default image" class="img-fluid" style="height: 213px;object-fit: cover; border-radius: .5rem .5rem 0 0;">
  188.                             {% endif %}
  189.                         </div>
  190.                         <div class="container-info-presta" style="padding-bottom: 80px;">
  191.                             <h2 class="vendor-title">
  192.                                 {# <a href="{{ path('front_product_single', {'slug': product.subCategories[0].categories[0].slug, 'subCategorySlug': product.subCategories[0].subCategorySlug, 'product_id': product.id, 'productSlug': product.productSlug}) }}" class="title">{{ product.name }}</a> #}
  193.                             </h2>
  194.                             <p class="vendor-address">
  195.                                 {% for department in product.departments %}
  196.                                     {{ department.name }}
  197.                                     {% if not loop.last %},
  198.                                     {% endif %}
  199.                                 {% else %}
  200.                                     Toute la France
  201.                                 {% endfor %}
  202.                             </p>
  203.                             <p>
  204.                                 {% if product.typeHebergements.slugTypeHebergm is defined and product.typeHebergements.slugTypeHebergm != 'hotel' %}
  205.                                     <i class="fas fa-money-bill-wave"></i>
  206.                                     Prix :
  207.                                     <strong>{{ product.price|number_format(2, '.') }}</strong>€
  208.                                 {% else %}
  209.                                     {% set lengthRoomNight = 0 %}
  210.                                     {% set statusByNight = false %}
  211.                                     {% set allPriceByNight = 0 %}
  212.                                     {% set lengthRoomDay = 0 %}
  213.                                     {% set statusByDay = false %}
  214.                                     {% set allPriceByDay = 0 %}
  215.                                     {% if product.chambres is defined %}
  216.                                         {% for roomOption in product.chambres.toArray %}
  217.                                             {% if roomOption.tarifNuit is defined %}
  218.                                                 {% set lengthRoomNight = lengthRoomNight + 1 %}
  219.                                                 {% set statusByNight = true %}
  220.                                                 {% set allPriceByNight = allPriceByNight + roomOption.tarifNuit %}
  221.                                             {% endif %}
  222.                                             {% if roomOption.tarifJour is not null %}
  223.                                                 {% set lengthRoomDay = lengthRoomDay + 1 %}
  224.                                                 {% set statusByDay = true %}
  225.                                                 {% set allPriceByDay = allPriceByDay + roomOption.tarifJour %}
  226.                                             {% endif %}
  227.                                         {% endfor %}
  228.                                         {% if statusByDay or statusByNight %}
  229.                                             <p>Prix moyen d'une chambre:</p>
  230.                                         {% endif %}
  231.                                         {% if statusByNight %}
  232.                                             <p>
  233.                                                 <i class="fas fa-money-bill-wave"></i>
  234.                                                 par nuit 
  235.                                                 <strong>{{ (allPriceByNight / lengthRoomNight)|number_format(2, '.') }}</strong>€
  236.                                             </p>
  237.                                         {% endif %}
  238.                                         {% if statusByDay %}
  239.                                             {# <p>
  240.                                                 <i class="fas fa-money-bill-wave"></i>
  241.                                                 par jour 
  242.                                                 <strong>{{ (allPriceByDay / lengthRoomDay)|number_format(2, '.') }}</strong>€
  243.                                             </p> #}
  244.                                         {% endif %}
  245.                                     {% endif %}
  246.                                     {% if not statusByNight and not statusByDay %}
  247.                                         <p>
  248.                                             Prix : <strong>Prix en attente</strong>
  249.                                         </p>
  250.                                     {% endif %}
  251.                                     {# <i class="fas fa-money-bill-wave"></i>
  252.                                     Prix :
  253.                                     <strong>{{ product.price|number_format(2, '.') }}</strong>€ #}
  254.                                 {% endif %}
  255.                             </p>
  256.                             <p>
  257.                                 <i class="fa fa-star rated"></i>
  258.                                 {% set notes = 0 %}
  259.                                 {% for avi in product.avis %}
  260.                                     {% set notes = notes + avi.globalNote %}
  261.                                 {% endfor %}
  262.                                 {% set noteTotal = (notes > 0) ? notes / product.avis|length : 0 %}
  263.                                 {{ product.avis|length }} Avis</p>
  264.                         </div>
  265.                         <div class="wishlist-sign">
  266.                             <a href="#" class="btn-wishlist">
  267.                                 <i class="fa fa-heart"></i>
  268.                             </a>
  269.                         </div>
  270.                         {# <a href="{{ path('front_product_single', {'slug': product.subCategories[0].categories[0].slug, 'subCategorySlug': product.subCategories[0].subCategorySlug, 'product_id': product.id, 'productSlug': product.productSlug}) }}" class="title"> #}
  271.                             {% if subCategorySlug == "hebergements"%}
  272.                                 <button class="btnVoirP btn">Voir l'hébergement</button>
  273.                             {% endif %}
  274.                         </a>
  275.                     </div>
  276.                 </div>
  277.             {% endfor %}
  278.             {% else %}
  279.                 <div class="vendor-thumbnail list-view p-4">Aucun service correspondant</div>
  280.             {% endif %}
  281.         </div>
  282.     </div>
  283.     {{ include('front/accueil/rechercheParTypeDeProduit.html.twig') }}
  284.     {# <div class="bg-white space-medium">
  285.         <div class="p-4">
  286.             <div class="row">
  287.                 <div class="offset-xl-2 col-xl-8 offset-lg-2 col-lg-8 col-md-12 col-sm-12 col-12">
  288.                     <div
  289.                         class="section-title text-center">
  290.                         <!-- section title start-->
  291.                         <h2 class="mb10">Recherche par type de produit</h2>
  292.                     </div>
  293.                     <!-- /.section title start-->
  294.                 </div>
  295.             </div>
  296.             <div class="venue-thumbnail-carousel">
  297.                 <div class="owl-carousel car-two">
  298.                     {% for category in subCategories %}
  299.                         {% if not category.isService %}
  300.                             <div class="item">
  301.                                 <div class="venue-categories-block col-md-12">
  302.                                     <div class="venue-categories-img zoomimg">
  303.                                         <a href="{{ path('front_product_category_events', {'subCategorySlug': category.subCategorySlug}) }}"><img src="{{ asset(constant('App\\Services\\File::IMAGE_CATEGORY_DIR') ~ category.image) }}" alt="{{ category.name }}" class="img-fluid"></a>
  304.                                         <div class="venue-categories-overlay">
  305.                                             {% set nbProduct = category.products|length %}
  306.                                             <h3 class="mb0">
  307.                                                 <a href="{{ path('front_product_category_events', {'subCategorySlug': category.subCategorySlug}) }}" class="venue-categories-title">{{ category.name }}
  308.                                                     ({{ nbProduct }})</a>
  309.                                             </h3>
  310.                                         </div>
  311.                                     </div>
  312.                                 </div>
  313.                             </div>
  314.                         {% endif %}
  315.                     {% endfor %}
  316.                 </div>
  317.             </div>
  318.         </div>
  319.     </div> #}
  320.     {{ include('front/accueil/selectionDocumentaire.html.twig') }}
  321.     {# <div class="space-ex-large bg-white">
  322.         <div class="container">
  323.             <div class="row">
  324.                 <div class="col-xl-12  col-lg-12 col-md-12 col-sm-12 col-12">
  325.                     <div
  326.                         class="section-title text-center">
  327.                         <!-- section title start-->
  328.                         <h2 class="mb10">Notre sélection documentaire</h2>
  329.                         <p>Astuces, conseils, organisation,.. Des articles qui vont vous aider à préparer au mieux votre mariage.</p>
  330.                     </div>
  331.                     <!-- /.section title start-->
  332.                 </div>
  333.             </div>
  334.             <div class="row">
  335.                 {% for article in articles %}
  336.                     <div class="col-xl-4 col-lg-4 col-md-6 col-sm-6 col-12">
  337.                         <div
  338.                             class="post-block">
  339.                             <!-- post vertical block -->
  340.                             <div class="meta-date-circle">
  341.                                 <span class="meta-date">{{ article.publishedAt|date('d') }}
  342.                                     <small>{{ article.publishedAt|format_date(pattern="MMM")|slice(0, 3)|capitalize }}</small>
  343.                                 </span>
  344.                             </div>
  345.                             <div class="post-img zoomimg rounded-top" style="background:url({{ asset(constant('App\\Services\\File::IMAGE_BLOG_DIR') ~ article.image) }});width:100%;height:250px;background-repeat:no-repeat;background-position: center;background-size:cover"></div>
  346.                             <div class="post-content text-left rounded-0">
  347.                                 <div class="post-meta-category">
  348.                                     <a href="{{ path('front_blog_category_list', {'categorySlug': article.blogCategory.categorySlug}) }}">{{ article.blogCategory.name }}</a>
  349.                                 </div>
  350.                                 <h3 class="mb-0">
  351.                                     <a href="{{ path('front_blog_single', {'categorySlug': article.blogCategory.categorySlug, 'slug': article.slug}) }}" class="post-title">{{ article.title }}</a>
  352.                                 </h3>
  353.                                 <div class="post-second-footer">
  354.                                     <p class="meta"></p>
  355.                                 </div>
  356.                             </div>
  357.                         </div>
  358.                     </div>
  359.                 {% endfor %}
  360.             </div>
  361.             <div class="row">
  362.                 <div class="col-xl-12 col-lg-12 col-md-6 col-sm-12 col-12 text-center mt30">
  363.                     <a href="{{ path('front_blog_list') }}" class="btn btn-default">Voir tous les articles</a>
  364.                 </div>
  365.             </div>
  366.         </div>
  367.     </div> #}
  368.     {# {% if packsFormule is not empty %}
  369.         <div class="space-small bg-white">
  370.             <div class="container">
  371.                 <div class="row">
  372.                     <div class="offset-xl-2 col-xl-8 offset-lg-2 col-lg-8 col-md-12 col-sm-12 col-12">
  373.                         <div
  374.                             class="section-title text-center">
  375.                             <!-- section title start-->
  376.                             <h2 class="mb10">Nos formules mariage & lune de miel</h2>
  377.                         </div>
  378.                         <!-- /.section title start-->
  379.                     </div>
  380.                 </div>
  381.                 <div
  382.                     class="row">
  383.                     <!-- venue-categoris-block-->
  384.                     {% for pack in packsFormule %}
  385.                         <div class="col-xl-4 col-lg-4 col-md-6 col-sm-12 col-12">
  386.                             <div class="vendor-categories-block zoomimg">
  387.                                 <div class="vendor-categories-img">
  388.                                     <a href="{{ path('front_pack_single', {'slug': pack.slug}) }}"><img src="{{ asset(constant('App\\Services\\File::IMAGE_PRODUCT_DIR') ~ pack.image) }}" alt="{{ pack.name }}" class="img-fluid" style="min-width:100%"></a>
  389.                                 </div>
  390.                                 <div class="vendor-categories-overlay">
  391.                                     <div class="vendor-categories-text">
  392.                                         <h4 class="mb0">
  393.                                             <a href="{{ path('front_pack_single', {'slug': pack.slug}) }}" class="vendor-categories-title">{{ pack.name }}</a>
  394.                                         </h4>
  395.                                     </div>
  396.                                 </div>
  397.                             </div>
  398.                             <!-- /.venue-categoris-block-->
  399.                         </div>
  400.                     {% endfor %}
  401.                 </div>
  402.             </div>
  403.         </div>
  404.     {% endif %} #}
  405.     <!-- /.feature-section -->
  406.     {% if packsLuneMiel is not empty %}
  407.         <div class="space-medium pdb0">
  408.             <div class="container">
  409.                 <div class="row">
  410.                     <div class="offset-xl-2 col-xl-8 offset-lg-2 col-lg-8 col-md-12 col-sm-12 col-12">
  411.                         <div
  412.                             class="section-title text-center">
  413.                             <!-- section title start-->
  414.                             <h2 class="mb10">Nos sélections lune de miel</h2>
  415.                         </div>
  416.                         <!-- /.section title start-->
  417.                     </div>
  418.                 </div>
  419.                 <div
  420.                     class="row">
  421.                     <!-- venue-categoris-block-->
  422.                     {% for pack in packsLuneMiel %}
  423.                         <div class="col-xl-4 col-lg-4 col-md-6 col-sm-12 col-12">
  424.                             <div class="vendor-categories-block zoomimg">
  425.                                 <div class="vendor-categories-img">
  426.                                     <a href="{{ path('front_pack_single', {'slug': pack.slug}) }}"><img src="{{ asset(constant('App\\Services\\File::IMAGE_PRODUCT_DIR') ~ pack.image) }}" alt="{{ pack.name }}" class="img-fluid" style="min-width:100%"></a>
  427.                                 </div>
  428.                                 <div class="vendor-categories-overlay">
  429.                                     <div class="vendor-categories-text">
  430.                                         <h4 class="mb0">
  431.                                             <a href="{{ path('front_pack_single', {'slug': pack.slug}) }}" class="vendor-categories-title">{{ pack.name }}</a>
  432.                                         </h4>
  433.                                     </div>
  434.                                 </div>
  435.                             </div>
  436.                             <!-- /.venue-categoris-block-->
  437.                         </div>
  438.                     {% endfor %}
  439.                 </div>
  440.             </div>
  441.         </div>
  442.     {% endif %}
  443.     <!-- /. venue-thumbnail-section-->
  444.     <!-- /.feature-section-->
  445.     <!-- Testimonial-section -->
  446.         {% if lastAvis is not empty and lastAvis|length >= 3 %}
  447.             <div class="space-medium bg-yellow-light"> <div class="container">
  448.                 <div class="row">
  449.                     <div class="offset-xl-2 col-xl-8 offset-lg-2 col-lg-8 col-md-12 col-sm-12 col-12">
  450.                         <div
  451.                             class="section-title text-center">
  452.                             <!-- section title start-->
  453.                             <h2 class="mb10">Derniers avis déposés</h2>
  454.                         </div>
  455.                         <!-- /.section title start-->
  456.                     </div>
  457.                 </div>
  458.                 <div class="row">
  459.                     {% for avi in lastAvis %}
  460.                         <div class="col-xl-4 col-lg-4 col-md-6 col-sm-6 col-12">
  461.                             <div
  462.                                 class="testimonial-block">
  463.                                 <!-- testimonial block -->
  464.                                 <div class="testimonial-icon">
  465.                                     <i class="fa fa-quote-right fa-default"></i>
  466.                                 </div>
  467.                                 <h3 class="testimonial-name">{{ avi.client.firstName }}</h3>
  468.                                 <p class="testimonial-text">“{{ avi.text }}”</p>
  469.                                 <div class="testimonial-pic">
  470.                                     {% if avi.client.image %}
  471.                                         <img src="{{ asset(constant('App\\Services\\File::IMAGE_CLIENT_DIR') ~ avi.client.image) }}" class="rounded-circle" alt="{{ avi.client.firstName }}" style="width:100px;height:100px">
  472.                                     {% else %}
  473.                                         <img src="{{ asset('images/user-default') }}" class="rounded-circle" alt="{{ avi.client.firstName }}" style="width:100px;height:100px">
  474.                                     {% endif %}
  475.                                 </div>
  476.                                 <hr>
  477.                                 <div class="testimonial-meta">
  478.                                     <h5 class="mb0">{{ avi.client.firstName }}
  479.                                         a choisi un produit de la catégorie
  480.                                         {{ avi.product.subCategories[0].name }}</h5>
  481.                                     <p class="testimonial-small-text mb0">
  482.                                         {% for department in avi.product.departments %}
  483.                                             Disponibilité :<br>
  484.                                             {{ department.name }}
  485.                                             {% if not loop.last %},
  486.                                             {% endif %}
  487.                                         {% else %}
  488.                                             Disponibilité :<br>
  489.                                             Toute la France
  490.                                         {% endfor %}
  491.                                     </p>
  492.                                     <span class="rating-star">
  493.                                         {% for i in 1..5 %}
  494.                                             {% if i < avi.globalNote %}
  495.                                                 <i class="fa fa-star rated"></i>
  496.                                             {% else %}
  497.                                                 <i class="far fa-star"></i>
  498.                                             {% endif %}
  499.                                         {% endfor %}
  500.                                     </span>
  501.                                 </div>
  502.                                 <!-- /.testimonial block -->
  503.                             </div>
  504.                         </div>
  505.                     {% endfor %}
  506.                 </div>
  507.             </div>
  508.         </div>
  509.     {% endif %}
  510.     <!-- /.Testimonial-section -->
  511.     {{ include('front/petiteAnnonce.html.twig') }}
  512.     {# <div class="venue-thumbnail-carousel"> #}
  513.     {#<div class="space-small bg-white">
  514.         <div class="container">
  515.             <div class="row">
  516.                 <div class="offset-xl-2 col-xl-8 offset-lg-2 col-lg-8 col-md-12 col-sm-12 col-12">
  517.                     <div
  518.                         class="section-title text-center">
  519.                         <!-- section title start-->
  520.                         <h2 class="mb10">Les petites annonces</h2>
  521.                         {% if clients is not empty %}
  522.                             {% if (clients is not empty) and (clients | length == 1) %}
  523.                                 <p class="sous_titre">Le premier nouvel annonce client</p>
  524.                             {% elseif(clients is not empty) and (clients | length == 2) %}
  525.                                 <p class="sous_titre">Les deux premiers annonces clients</p>
  526.                             {% elseif(clients is not empty) and (clients | length == 3) %}
  527.                                 <p class="sous_titre">Les trois premiers annonces clients</p>
  528.                             {% else %}
  529.                                 <p class="sous_titre">Les trois derniers annonces clients</p>
  530.                             {% endif %}
  531.                         {% else %}
  532.                             <p class="sous_titre">il y a Aucune annonce pour l'instant</p>
  533.                         {% endif %}
  534.                     </div>
  535.                     <!-- /.section title start-->
  536.                 </div>
  537.             </div>
  538.             <div
  539.                 class="row">
  540.                 <!-- venue-categoris-block-->
  541.                 {% set today = date() %}
  542.                 {% set yesterday = date('-1days') %}
  543.                 
  544.                 {% for annonce in annonces %}
  545.                     <div class="col-xl-4 col-lg-4 col-md-6 col-sm-12 col-12">
  546.                         <div class="vendor-categories-block zoomimg">
  547.                             <div class="vendor-categories-img">
  548.                                 <div class="total_carde">
  549.                                     <div class="card card_core">
  550.                                         <div class="card-body">
  551.                                             <h3 class="card-title titre_cadre">{{filter_service.limite_motsafficher(annonce.titre, 60)}}</h3>
  552.                                             <p class="card-text text_cadre">{{ filter_service.limite_motsafficher(annonce.description,80) | raw}}</p>
  553.                                         </div>
  554.                                     </div>
  555.                                     <div class="profil_card">
  556.                                         <div class="profil_photo">
  557.                                             <img src={{ asset('images/avatar.jpg') }} alt="profil" class="profil_img">
  558.                                         </div>
  559.                                         <div class="profil_core">
  560.                                             <h4 class="profil_core_nom">{{annonce.users.firstName}}{{annonce.users.lastName}}</h4>
  561.                                              {% if annonce.createdAt|date('d/m/Y') == today|date("d/m/Y") %}
  562.                                              <span>Aujourd'hui à {{annonce.createdAt | date('H:i')}}</span>
  563.                                              {% elseif annonce.createdAt|date('d/m/Y') == yesterday|date("d/m/Y") %}
  564.                                              <span>Hier à {{annonce.createdAt | date('H:i')}}</span>
  565.                                              {% else %}
  566.                                             <span>{{annonce.createdAt | date('d M Y')}}
  567.                                                 à
  568.                                                 {{annonce.createdAt | date('H:i')}}</span>
  569.                                             {% endif %}
  570.                                         </div>
  571.                                     </div>
  572.                                 </div>
  573.                             </div>
  574.                         </div>
  575.                         <!-- /.venue-categoris-block-->
  576.                     </div>
  577.                 {% endfor %}
  578.             </div>
  579.             {% if clients is not empty %}
  580.                 <div class="row">
  581.                     <div class="offset-xl-2 col-xl-8 offset-lg-2 col-lg-8 col-md-12 col-sm-12 col-12">
  582.                         <div class="section-title text-center">
  583.                             <a href="{{ path('client_space_annonce_tous') }}" class="btn btn-default mb-3 bouton_s">
  584.                                 {% if (clients is not empty) and (clients | length == 1) %}
  585.                                     <p>Voir l' annonce du client <i class="fa fa-angle-double-right"></i></p>
  586.                                 {% else %}
  587.                                     <p>Voir les ({{clients | length}}) annonce(s) du client <i class="fa fa-angle-double-right"></i></p>
  588.                                 {% endif %}
  589.                             </a>
  590.                         </div>
  591.                         <!-- /.section title start-->
  592.                     </div>
  593.                 </div>
  594.             {% endif %}
  595.         </div>
  596.     </div>#}
  597.     {# <div class="space-small bg-white">
  598.         <div class="container">
  599.             <div class="row">
  600.                 <div class="offset-xl-2 col-xl-8 offset-lg-2 col-lg-8 col-md-12 col-sm-12 col-12">
  601.                     <div
  602.                         class="section-title text-center">
  603.                         <!-- section title start-->
  604.                         <h2 class="mb10">Les petites annonces du prestataire</h2>
  605.                         {% if prestataires is not empty %}
  606.                             {% if (prestataires is not empty) and (prestataires | length == 1) %}
  607.                                 <p class="sous_titre">Le premier nouvel annonce prestataire</p>
  608.                             {% elseif(prestataires is not empty) and (prestataires | length == 2) %}
  609.                                 <p class="sous_titre">Les deux premiers annonces prestataires</p>
  610.                             {% elseif(prestataires is not empty) and (prestataires | length == 3) %}
  611.                                 <p class="sous_titre">Les trois premiers annonces prestataires</p>
  612.                             {% else %}
  613.                                 <p class="sous_titre">Les trois derniers annonces prestataires</p>
  614.                             {% endif %}
  615.                         {% else %}
  616.                             <p class="sous_titre">il y a Aucune annonce pour l'instant</p>
  617.                         {% endif %}
  618.                     </div>
  619.                     <!-- /.section title start-->
  620.                 </div>
  621.             </div>
  622.             <div
  623.                 class="row">
  624.                 <!-- venue-categoris-block-->
  625.                 {% set today = date() %}
  626.                 {% set yesterday = date('-1days') %}
  627.                 
  628.                 {% for annonce in annonce_prests %}
  629.                     <div class="col-xl-4 col-lg-4 col-md-6 col-sm-12 col-12">
  630.                         <div class="vendor-categories-block zoomimg">
  631.                             <div class="vendor-categories-img couvert_prest">
  632.                                 <img src={{('upload/produits/' ~ filter_service.getphotoProduit(annonce.products)) }} alt="profil" class="img-fluid image_prest">
  633.                                 <div class="card card_core_prest">
  634.                                     <div class="card-body">
  635.                                         <h3 class="card-title titre_cadre_prest">{{filter_service.limite_motsafficher(annonce.titre, 70)}}</h3>
  636.                                         <span>Prix :
  637.                                             {{annonce.products.price}}
  638.                                             €</span>
  639.                                         <p class="card-text text_cadre_prest">
  640.                                             {% if annonce.createdAt|date('d/m/Y') == today|date("d/m/Y") %}
  641.                                              <span>Aujourd'hui à {{annonce.createdAt | date('H:i')}}</span>
  642.                                              {% elseif annonce.createdAt|date('d/m/Y') == yesterday|date("d/m/Y") %}
  643.                                              <span>Hier à {{annonce.createdAt | date('H:i')}}</span>
  644.                                              {% else %}
  645.                                             <span>{{annonce.createdAt | date('d M Y')}}
  646.                                                 à
  647.                                                 {{annonce.createdAt | date('H:i')}}</span>
  648.                                             {% endif %}
  649.                                         </p>
  650.                                     </div>
  651.                                 </div>
  652.                             </div>
  653.                         </div>
  654.                         <!-- /.venue-categoris-block-->
  655.                     </div>
  656.                 {% endfor %}
  657.             </div>
  658.             {% if prestataires is not empty %}
  659.                 <div class="row">
  660.                     <div class="offset-xl-2 col-xl-8 offset-lg-2 col-lg-8 col-md-12 col-sm-12 col-12">
  661.                         <div class="section-title text-center">
  662.                             <a href="{{ path('company_space_annonce') }}" class="btn btn-default mb-3 bouton_s">
  663.                                 {% if (clients is not empty) and (clients | length == 1) %}
  664.                                     <p>Voir l' annonce du prestataire <i class="fa fa-angle-double-right"></i></p>
  665.                                 {% else %}
  666.                                     <p>Voir les ({{prestataires | length}}) annonce(s) du prestataire <i class="fa fa-angle-double-right"></i></p>
  667.                                 {% endif %}
  668.                             </a>
  669.                         </div>
  670.                         <!-- /.section title start-->
  671.                     </div>
  672.                 </div>
  673.             {% endif %}
  674.         </div>
  675.     </div> #}
  676.     {# {{ include('front/accueil/petiteAnnoncePrestataire.html.twig') }} #}
  677. </div></div>{# </div> #}</div>
  678.     <button class="btn btn-default" id="btnCarte" data-url="{{ path('front_company_recherche_map') }}">Carte <i class="far fa-map"></i></button>
  679. {% endblock %}
  680. {% block javascript %}
  681. {{ parent() }}
  682. {# Pour aller voir carte et pour effacer en trois seconde addFlash message #}
  683. <script src="https://cdn.jsdelivr.net/npm/notyf@3/notyf.min.js"></script>
  684. <script src="{{ asset('js/btnCart.js') }}"></script>
  685. <script src="{{ asset('js/jquery-ui.js') }}"></script>
  686. <script>$('.carousel').carousel({interval: 3000})
  687. $(document).ready(function () {
  688. $('#category_master').change(function () {
  689. var inputValue = $('#category_master').val();
  690. const data = {
  691. idCategory: inputValue
  692. };
  693. let datas = new FormData();
  694. datas.append("data", JSON.stringify(data));
  695. fetch("{{ path('front_search_category') }}", {
  696. method: 'POST',
  697. body: datas
  698. }).then(response => response.json()).then(data => {
  699. if (data.response === 'ok') {
  700. document.getElementById('div_search_type').innerHTML = data.categories.content;
  701. }
  702. })
  703. })
  704. });
  705. // $('.owl-mitapy').owlCarousel({
  706. //     items: 3,
  707. //     loop:true,
  708. //     nav:true,
  709. //     autoplay: true,
  710. // })</script><script>
  711. var modal = document.querySelector('.annonce-modal');
  712. var close = document.querySelector('#modal-concel');
  713. if(close != null){
  714.     close.addEventListener('click', closeModal);
  715. }
  716. function closeModal() {
  717. modal.classList.remove('affiche');
  718. }
  719. function trouvePrest(event) {
  720. // var texte = event.target;
  721. // let message = texte.getAttribute('data-text');
  722. // let nom = texte.getAttribute('data-cli');
  723. // let mail = texte.getAttribute('data-mail');
  724. modal.classList.add('affiche');
  725. // message_content.innerText = message;
  726. // info_content.innerHTML = nom + ' / ' + mail;
  727. }</script>
  728. <script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.17.1/moment-with-locales.min.js"></script>
  729. <script src="https://cdnjs.cloudflare.com/ajax/libs/baguettebox.js/1.8.1/baguetteBox.min.js"></script>
  730. <script src="{{asset('/js/jquery.datetimepicker.full.js')}}"></script>
  731. <script>
  732. jQuery(document).ready(function($) {
  733.     $('#datetimepickerAccueil').datetimepicker({
  734.         format: 'd/m/Y',
  735.          locale: 'fr',
  736.          minDate: "+1",
  737.          minview: 2,
  738.          timepicker: false,
  739.         // new Date()
  740.     });
  741. })
  742. </script>
  743. {# daterangepicker #}
  744. <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/daterangepicker/daterangepicker.min.js"></script>
  745. <script>
  746. {# Save value of daterangepicker #}
  747. jQuery(document).ready(function($) {
  748.     var $startDate = $('#startdatetimepickerAccueil');
  749.     var $endDate = $('#enddatetimepickerAccueil');
  750.     $('#daterangePicker').daterangepicker({
  751.         opens: 'left',
  752.         locale: {
  753.             format: 'DD/MM/YYYY', // Change date format
  754.             separator: ' - ',
  755.             applyLabel: 'Appliquer',
  756.             cancelLabel: 'Annuler',
  757.             fromLabel: 'De',
  758.             toLabel: 'À',
  759.             customRangeLabel: 'Personnalisé',
  760.             weekLabel: 'S',
  761.             daysOfWeek: ['Di', 'Lu', 'Ma', 'Me', 'Je', 'Ve', 'Sa'],
  762.             monthNames: ['Janvier', 'Février', 'Mars', 'Avril', 'Mai', 'Juin', 'Juillet', 'Août', 'Septembre', 'Octobre', 'Novembre', 'Décembre'],
  763.             firstDay: 1 // Monday as the first day of the week
  764.         }
  765.     }, function(start, end, label) {
  766.         $startDate.val(start.format('DD/MM/YYYY'));
  767.         $endDate.val(end.format('DD/MM/YYYY'))
  768.     });
  769. })
  770. </script>
  771. <script>
  772.     {# Handle daterange in search #}
  773.     $(document).ready(function() {
  774.     var $categorySelect = $('#persoBorder');
  775.     var $singleDateContainer = $('#singleDateContainer');
  776.     var $rangeDateContainer = $('#rangeDateContainer');
  777.     var $startDate = $('#startdatetimepickerAccueil');
  778.     var $endDate = $('#enddatetimepickerAccueil');
  779.     var $weddingDate = $('#datetimepickerAccueil');
  780.         
  781.     $categorySelect.on('change', function() {
  782.         var selectedOption = $categorySelect.find('option:selected').text().toLowerCase();
  783.         console.log("Selected option:", $categorySelect.val());
  784.         if ($categorySelect.val() == 55) { // in search if subcategory selected is hebergements
  785.             $singleDateContainer.hide();
  786.             $rangeDateContainer.show();
  787.             $weddingDate.prop('required', false);
  788.             $startDate.prop('required', true);
  789.             $endDate.prop('required', true);
  790.         } else if ($categorySelect.val() == 53) { // in search if subcategory selected is vehicule
  791.             $singleDateContainer.hide();
  792.             $rangeDateContainer.show();
  793.             $weddingDate.prop('required', false);
  794.             $startDate.prop('required', true);
  795.             $endDate.prop('required', true);
  796.                 } else {
  797.             $singleDateContainer.show();
  798.             $rangeDateContainer.hide();
  799.             $weddingDate.prop('required', true);
  800.             $startDate.prop('required', false);
  801.             $endDate.prop('required', false);
  802.             $startDate.val("");
  803.             $endDate.val("");
  804.         }
  805.     });
  806.     // Save value daterange picker to local storage
  807.     const form = document.getElementById('formShearch');
  808.     form.addEventListener('submit', saveDate);
  809.     function saveDate(e) {
  810.         e.preventDefault();
  811.         const saveStart = document.getElementById('startdatetimepickerAccueil').value;
  812.         const saveEnd = document.getElementById('enddatetimepickerAccueil').value;
  813.     
  814.         const dateSave = {
  815.             start: saveStart,
  816.             end: saveEnd
  817.         };
  818.     
  819.         localStorage.setItem('dateSave', JSON.stringify(dateSave));
  820.         
  821.         form.submit();
  822.     }
  823. });
  824. </script>
  825. {% endblock %}