var/cache/dev/twig/30/3058c32cf4a60f6e4b4b069ebe7a6aa0.php line 56

Open in your IDE?
  1. <?php
  2. use Twig\Environment;
  3. use Twig\Error\LoaderError;
  4. use Twig\Error\RuntimeError;
  5. use Twig\Extension\CoreExtension;
  6. use Twig\Extension\SandboxExtension;
  7. use Twig\Markup;
  8. use Twig\Sandbox\SecurityError;
  9. use Twig\Sandbox\SecurityNotAllowedTagError;
  10. use Twig\Sandbox\SecurityNotAllowedFilterError;
  11. use Twig\Sandbox\SecurityNotAllowedFunctionError;
  12. use Twig\Source;
  13. use Twig\Template;
  14. use Twig\TemplateWrapper;
  15. /* home/shops_list.html.twig */
  16. class __TwigTemplate_2c903694a6a24f3c0ae62c1cd97a5737 extends Template
  17. {
  18.     private Source $source;
  19.     /**
  20.      * @var array<string, Template>
  21.      */
  22.     private array $macros = [];
  23.     public function __construct(Environment $env)
  24.     {
  25.         parent::__construct($env);
  26.         $this->source $this->getSourceContext();
  27.         $this->blocks = [
  28.             'title' => [$this'block_title'],
  29.             'body' => [$this'block_body'],
  30.             'stylesheets' => [$this'block_stylesheets'],
  31.             'javascripts' => [$this'block_javascripts'],
  32.         ];
  33.     }
  34.     protected function doGetParent(array $context): bool|string|Template|TemplateWrapper
  35.     {
  36.         // line 1
  37.         return "base_home.html.twig";
  38.     }
  39.     protected function doDisplay(array $context, array $blocks = []): iterable
  40.     {
  41.         $macros $this->macros;
  42.         $__internal_5a27a8ba21ca79b61932376b2fa922d2 $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  43.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template""home/shops_list.html.twig"));
  44.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  45.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template""home/shops_list.html.twig"));
  46.         $this->parent $this->load("base_home.html.twig"1);
  47.         yield from $this->parent->unwrap()->yield($contextarray_merge($this->blocks$blocks));
  48.         
  49.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  50.         
  51.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  52.     }
  53.     // line 3
  54.     /**
  55.      * @return iterable<null|scalar|\Stringable>
  56.      */
  57.     public function block_title(array $context, array $blocks = []): iterable
  58.     {
  59.         $macros $this->macros;
  60.         $__internal_5a27a8ba21ca79b61932376b2fa922d2 $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  61.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""title"));
  62.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  63.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""title"));
  64.         yield "Boutiques | MaketOu";
  65.         
  66.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  67.         
  68.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  69.         yield from [];
  70.     }
  71.     // line 5
  72.     /**
  73.      * @return iterable<null|scalar|\Stringable>
  74.      */
  75.     public function block_body(array $context, array $blocks = []): iterable
  76.     {
  77.         $macros $this->macros;
  78.         $__internal_5a27a8ba21ca79b61932376b2fa922d2 $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  79.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""body"));
  80.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  81.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""body"));
  82.         // line 6
  83.         yield "
  84.     <!-- Start Banner Area -->
  85.     ";
  86.         // line 8
  87.         if ((($context["selectedCategory"] ?? null) && CoreExtension::getAttribute($this->env$this->source, ($context["selectedCategory"] ?? null), "bannerImage", [], "any"falsefalsefalse8))) {
  88.             // line 9
  89.             yield "        <section class=\"banner-area shop-category-banner  organic-breadcrumb\" style=\"background-image: url('";
  90.             yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl(CoreExtension::getAttribute($this->env$this->source, ($context["selectedCategory"] ?? null), "bannerImage", [], "any"falsefalsefalse9)), "html"nulltrue);
  91.             yield "'); background-size: cover; background-position: center; min-height: 300px; position: relative;object-fit: cover;height:400px;\">
  92.             <div class=\"banner-overlay\" style=\"position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.3);\"></div>
  93.             <div class=\"container\" style=\"position: relative; z-index: 1;\">
  94.                 <div class=\"breadcrumb-banner d-flex flex-wrap align-items-center justify-content-end\">
  95.                     <div class=\"col-first text-white\">
  96.                         <h1 style=\"color: white; text-shadow: 2px 2px 4px rgba(0,0,0,0.5);\">";
  97.             // line 14
  98.             yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env$this->source, ($context["selectedCategory"] ?? null), "name", [], "any"falsefalsefalse14), "html"nulltrue);
  99.             yield "</h1>
  100.                         <nav class=\"d-flex align-items-center\">
  101.                             <a href=\"";
  102.             // line 16
  103.             yield $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("ui_home");
  104.             yield "\" style=\"color: white;\">Accueil<span class=\"lnr lnr-arrow-right\"></span></a>
  105.                             <a href=\"";
  106.             // line 17
  107.             yield $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("ui_shops_list");
  108.             yield "\" style=\"color: white;\">Boutiques<span class=\"lnr lnr-arrow-right\"></span></a>
  109.                             <a href=\"javascript:void(0);\" style=\"color: white;\">";
  110.             // line 18
  111.             yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env$this->source, ($context["selectedCategory"] ?? null), "name", [], "any"falsefalsefalse18), "html"nulltrue);
  112.             yield "</a>
  113.                         </nav>
  114.                     </div>
  115.                 </div>
  116.             </div>
  117.         </section>
  118.     ";
  119.         } else {
  120.             // line 25
  121.             yield "        <section class=\"banner-area organic-breadcrumb\">
  122.             <div class=\"container\">
  123.                 <div class=\"breadcrumb-banner d-flex flex-wrap align-items-center justify-content-end\">
  124.                     <div class=\"col-first\">
  125.                         <h1>";
  126.             // line 29
  127.             if ((($tmp = ($context["selectedCategory"] ?? null)) && $tmp instanceof Markup ? (string) $tmp $tmp)) {
  128.                 yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env$this->source, ($context["selectedCategory"] ?? null), "name", [], "any"falsefalsefalse29), "html"nulltrue);
  129.             } else {
  130.                 yield "Boutiques";
  131.             }
  132.             yield "</h1>
  133.                         <nav class=\"d-flex align-items-center\">
  134.                             <a href=\"";
  135.             // line 31
  136.             yield $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("ui_home");
  137.             yield "\">Accueil<span class=\"lnr lnr-arrow-right\"></span></a>
  138.                             <a href=\"javascript:void(0);\">Boutiques</a>
  139.                         </nav>
  140.                     </div>
  141.                 </div>
  142.             </div>
  143.         </section>
  144.     ";
  145.         }
  146.         // line 39
  147.         yield "    <!-- End Banner Area -->
  148.     <div class=\"container mt-4 mb-4\">
  149.         <div class=\"row\">
  150.             <div class=\"col-xl-3 col-lg-4 col-md-5\">
  151.                 <!-- Filtres des boutiques -->
  152.                 <div class=\"sidebar-categories\">
  153.                     <div class=\"head\">Catégories de boutiques</div>
  154.                     <ul class=\"main-categories\">
  155.                         ";
  156.         // line 48
  157.         $context['_parent'] = $context;
  158.         $context['_seq'] = CoreExtension::ensureTraversable(($context["shopCategories"] ?? null));
  159.         foreach ($context['_seq'] as $context["_key"] => $context["category"]) {
  160.             // line 49
  161.             yield "                            <li class=\"main-nav-list\">
  162.                                 <a href=\"";
  163.             // line 50
  164.             yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("ui_shops_list", ["category" => CoreExtension::getAttribute($this->env$this->source$context["category"], "slug", [], "any"falsefalsefalse50)]), "html"nulltrue);
  165.             yield "\" 
  166.                                    class=\"category-link ";
  167.             // line 51
  168.             if ((CoreExtension::getAttribute($this->env$this->sourceCoreExtension::getAttribute($this->env$this->sourceCoreExtension::getAttribute($this->env$this->source, ($context["app"] ?? null), "request", [], "any"falsefalsefalse51), "query", [], "any"falsefalsefalse51), "get", ["category"], "method"falsefalsefalse51) == CoreExtension::getAttribute($this->env$this->source$context["category"], "slug", [], "any"falsefalsefalse51))) {
  169.                 yield "active";
  170.             }
  171.             yield "\">
  172.                                     <i class=\"lnr lnr-store\"></i>
  173.                                     ";
  174.             // line 53
  175.             yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env$this->source$context["category"], "name", [], "any"falsefalsefalse53), "html"nulltrue);
  176.             yield "
  177.                                     <span class=\"number\">(";
  178.             // line 54
  179.             yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(Twig\Extension\CoreExtension::length($this->env->getCharset(), CoreExtension::getAttribute($this->env$this->source$context["category"], "shops", [], "any"falsefalsefalse54)), "html"nulltrue);
  180.             yield ")</span>
  181.                                 </a>
  182.                             </li>
  183.                         ";
  184.         }
  185.         $_parent $context['_parent'];
  186.         unset($context['_seq'], $context['_key'], $context['category'], $context['_parent']);
  187.         $context array_intersect_key($context$_parent) + $_parent;
  188.         // line 58
  189.         yield "                    </ul>
  190.                 </div>
  191.                 <!-- Statistiques modernes inline -->
  192.                 <div class=\"sidebar-filter mt-4\">
  193.                     <div class=\"top-filter-head\">Statistiques</div>
  194.                     <div class=\"modern-stats\">
  195.                         <div class=\"stat-item-inline mt-3\">
  196.                             <i class=\"lnr lnr-store\"></i>
  197.                             <div>
  198.                                 <div class=\"stat-value\">";
  199.         // line 68
  200.         yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(((array_key_exists("total_shops"$context)) ? (Twig\Extension\CoreExtension::default(($context["total_shops"] ?? null), 0)) : (0)), "html"nulltrue);
  201.         yield "</div>
  202.                                 <div class=\"stat-label\">Total</div>
  203.                             </div>
  204.                         </div>
  205.                         <div class=\"stat-item-inline\">
  206.                             <i class=\"lnr lnr-star\"></i>
  207.                             <div>
  208.                                 <div class=\"stat-value\">";
  209.         // line 75
  210.         yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(Twig\Extension\CoreExtension::length($this->env->getCharset(), Twig\Extension\CoreExtension::filter($this->env, ($context["shops"] ?? null), function ($__shop__) use ($context$macros) { $context["shop"] = $__shop__; return CoreExtension::getAttribute($this->env$this->source, ($context["shop"] ?? null), "isActive", [], "any"falsefalsefalse75); })), "html"nulltrue);
  211.         yield "</div>
  212.                                 <div class=\"stat-label\">Actives</div>
  213.                             </div>
  214.                         </div>
  215.                         <div class=\"stat-item-inline\">
  216.                             <i class=\"lnr lnr-checkmark-circle\"></i>
  217.                             <div>
  218.                                 <div class=\"stat-value\">";
  219.         // line 82
  220.         yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(Twig\Extension\CoreExtension::length($this->env->getCharset(), Twig\Extension\CoreExtension::filter($this->env, ($context["shops"] ?? null), function ($__shop__) use ($context$macros) { $context["shop"] = $__shop__; return CoreExtension::getAttribute($this->env$this->source, ($context["shop"] ?? null), "isVerified", [], "any"falsefalsefalse82); })), "html"nulltrue);
  221.         yield "</div>
  222.                                 <div class=\"stat-label\">Vérifiées</div>
  223.                             </div>
  224.                         </div>
  225.                     </div>
  226.                 </div>
  227.             </div>
  228.             <div class=\"col-xl-9 col-lg-8 col-md-7\">
  229.                 <!-- Liste des boutiques -->
  230.                 <div class=\"row\" id=\"shopsContainer\">
  231.                     ";
  232.         // line 94
  233.         $context['_parent'] = $context;
  234.         $context['_seq'] = CoreExtension::ensureTraversable(Twig\Extension\CoreExtension::slice($this->env->getCharset(), ($context["shops"] ?? null), 09));
  235.         foreach ($context['_seq'] as $context["_key"] => $context["shop"]) {
  236.             // line 95
  237.             yield "                        <div class=\"mt-4 col-lg-4 col-md-6 shop-item\" data-shop-id=\"";
  238.             yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env$this->source$context["shop"], "id", [], "any"falsefalsefalse95), "html"nulltrue);
  239.             yield "\">
  240.                             <div class=\"single-shop h-100\">
  241.                                 <div class=\"shop-image\">
  242.                                     <a href=\"";
  243.             // line 98
  244.             yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("ui_shop_show", ["slug" => CoreExtension::getAttribute($this->env$this->source$context["shop"], "slug", [], "any"falsefalsefalse98)]), "html"nulltrue);
  245.             yield "\">
  246.                                         ";
  247.             // line 99
  248.             if ((($tmp CoreExtension::getAttribute($this->env$this->source$context["shop"], "logo", [], "any"falsefalsefalse99)) && $tmp instanceof Markup ? (string) $tmp $tmp)) {
  249.                 // line 100
  250.                 yield "                                            <img class=\"img-fluid\" src=\"";
  251.                 yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl(CoreExtension::getAttribute($this->env$this->source$context["shop"], "logo", [], "any"falsefalsefalse100)), "html"nulltrue);
  252.                 yield "\" alt=\"";
  253.                 yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env$this->source$context["shop"], "name", [], "any"falsefalsefalse100), "html"nulltrue);
  254.                 yield "\">
  255.                                         ";
  256.             } else {
  257.                 // line 102
  258.                 yield "                                            <img class=\"img-fluid\" src=\"";
  259.                 yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("ui/img/shop/default-shop.jpg"), "html"nulltrue);
  260.                 yield "\" alt=\"";
  261.                 yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env$this->source$context["shop"], "name", [], "any"falsefalsefalse102), "html"nulltrue);
  262.                 yield "\">
  263.                                         ";
  264.             }
  265.             // line 104
  266.             yield "                                    </a>
  267.                                     ";
  268.             // line 105
  269.             if ((($tmp CoreExtension::getAttribute($this->env$this->source$context["shop"], "isVerified", [], "any"falsefalsefalse105)) && $tmp instanceof Markup ? (string) $tmp $tmp)) {
  270.                 // line 106
  271.                 yield "                                        <div class=\"verified-badge\">
  272.                                             <i class=\"lnr lnr-checkmark-circle\"></i>
  273.                                         </div>
  274.                                     ";
  275.             }
  276.             // line 110
  277.             yield "                                </div>
  278.                                 
  279.                                 <div class=\"shop-details\">
  280.                                     <div class=\"shop-header\">
  281.                                         <h6 class=\"shop-name\">
  282.                                             <a href=\"";
  283.             // line 115
  284.             yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("ui_shop_show", ["slug" => CoreExtension::getAttribute($this->env$this->source$context["shop"], "slug", [], "any"falsefalsefalse115)]), "html"nulltrue);
  285.             yield "\">";
  286.             yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env$this->source$context["shop"], "name", [], "any"falsefalsefalse115), "html"nulltrue);
  287.             yield "</a>
  288.                                         </h6>
  289.                                         ";
  290.             // line 117
  291.             if ((($tmp CoreExtension::getAttribute($this->env$this->source$context["shop"], "shopCategory", [], "any"falsefalsefalse117)) && $tmp instanceof Markup ? (string) $tmp $tmp)) {
  292.                 // line 118
  293.                 yield "                                            <span class=\"shop-category\">";
  294.                 yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env$this->sourceCoreExtension::getAttribute($this->env$this->source$context["shop"], "shopCategory", [], "any"falsefalsefalse118), "name", [], "any"falsefalsefalse118), "html"nulltrue);
  295.                 yield "</span>
  296.                                         ";
  297.             }
  298.             // line 120
  299.             yield "                                    </div>
  300.                                     
  301.                                     <div class=\"shop-stats\">
  302.                                         <div class=\"stat-item\">
  303.                                             <span class=\"stat-value\">";
  304.             // line 124
  305.             yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env$this->source$context["shop"], "getActiveProductsCount", [], "method"falsefalsefalse124), "html"nulltrue);
  306.             yield "</span>
  307.                                             <span class=\"stat-label\">Produits</span>
  308.                                         </div>
  309.                         <div class=\"stat-item\">
  310.                             <span class=\"stat-value followers-count\" data-shop-id=\"";
  311.             // line 128
  312.             yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env$this->source$context["shop"], "id", [], "any"falsefalsefalse128), "html"nulltrue);
  313.             yield "\">";
  314.             yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env$this->source$context["shop"], "getActiveFollowersCount", [], "method"falsefalsefalse128), "html"nulltrue);
  315.             yield "</span>
  316.                                             <span class=\"stat-label\">Suiveurs</span>
  317.                                         </div>
  318.                                         <div class=\"stat-item\">
  319.                                             <span class=\"stat-value\">";
  320.             // line 132
  321.             yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env$this->source$context["shop"], "viewCount", [], "any"falsefalsefalse132), "html"nulltrue);
  322.             yield "</span>
  323.                                             <span class=\"stat-label\">Vues</span>
  324.                                         </div>
  325.                                     </div>
  326.                                     
  327.                                     <div class=\"shop-description\">
  328.                                         <p>";
  329.             // line 138
  330.             yield (((Twig\Extension\CoreExtension::length($this->env->getCharset(), Twig\Extension\CoreExtension::striptags(CoreExtension::getAttribute($this->env$this->source$context["shop"], "description", [], "any"falsefalsefalse138))) > 100)) ? ($this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((Twig\Extension\CoreExtension::slice($this->env->getCharset(), Twig\Extension\CoreExtension::striptags(CoreExtension::getAttribute($this->env$this->source$context["shop"], "description", [], "any"falsefalsefalse138)), 0100) . "..."), "html"nulltrue)) : ($this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(Twig\Extension\CoreExtension::striptags(CoreExtension::getAttribute($this->env$this->source$context["shop"], "description", [], "any"falsefalsefalse138)), "html"nulltrue)));
  331.             yield "</p>
  332.                                     </div>
  333.                                     
  334.                                     <div class=\"shop-actions\">
  335.                                         <a href=\"";
  336.             // line 142
  337.             yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("ui_shop_show", ["slug" => CoreExtension::getAttribute($this->env$this->source$context["shop"], "slug", [], "any"falsefalsefalse142)]), "html"nulltrue);
  338.             yield "\" class=\"btn btn-primary btn-sm\">
  339.                                             <i class=\"lnr lnr-eye me-1\"></i> Voir
  340.                                         </a>
  341.                                         ";
  342.             // line 145
  343.             if ((($tmp CoreExtension::getAttribute($this->env$this->source, ($context["app"] ?? null), "user", [], "any"falsefalsefalse145)) && $tmp instanceof Markup ? (string) $tmp $tmp)) {
  344.                 // line 146
  345.                 yield "                                            ";
  346.                 $context["followed_shop_ids"] = ((array_key_exists("followed_shop_ids"$context)) ? (Twig\Extension\CoreExtension::default(($context["followed_shop_ids"] ?? null), [])) : ([]));
  347.                 // line 147
  348.                 yield "                                            ";
  349.                 $context["is_following"] = CoreExtension::inFilter(CoreExtension::getAttribute($this->env$this->source$context["shop"], "id", [], "any"falsefalsefalse147), ($context["followed_shop_ids"] ?? null));
  350.                 // line 148
  351.                 yield "                                            <button class=\"btn btn-sm follow-btn ";
  352.                 yield (((($tmp = ($context["is_following"] ?? null)) && $tmp instanceof Markup ? (string) $tmp $tmp)) ? ("btn-outline-danger") : ("btn-outline-secondary"));
  353.                 yield "\" 
  354.                                                     data-shop-id=\"";
  355.                 // line 149
  356.                 yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env$this->source$context["shop"], "id", [], "any"falsefalsefalse149), "html"nulltrue);
  357.                 yield "\"
  358.                                                     data-following=\"";
  359.                 // line 150
  360.                 yield (((($tmp = ($context["is_following"] ?? null)) && $tmp instanceof Markup ? (string) $tmp $tmp)) ? ("true") : ("false"));
  361.                 yield "\"
  362.                                                     onclick=\"toggleFollow(";
  363.                 // line 151
  364.                 yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env$this->source$context["shop"], "id", [], "any"falsefalsefalse151), "html"nulltrue);
  365.                 yield ", this)\">
  366.                                                 <i class=\"lnr ";
  367.                 // line 152
  368.                 yield (((($tmp = ($context["is_following"] ?? null)) && $tmp instanceof Markup ? (string) $tmp $tmp)) ? ("lnr-cross") : ("lnr-plus"));
  369.                 yield " me-1\"></i>
  370.                                                 <span class=\"follow-text\">
  371.                                                     ";
  372.                 // line 154
  373.                 yield (((($tmp = ($context["is_following"] ?? null)) && $tmp instanceof Markup ? (string) $tmp $tmp)) ? ("Ne plus suivre") : ("Suivre"));
  374.                 yield "
  375.                                                 </span>
  376.                                             </button>
  377.                                         ";
  378.             }
  379.             // line 158
  380.             yield "                                    </div>
  381.                                 </div>
  382.                             </div>
  383.                         </div>
  384.                     ";
  385.         }
  386.         $_parent $context['_parent'];
  387.         unset($context['_seq'], $context['_key'], $context['shop'], $context['_parent']);
  388.         $context array_intersect_key($context$_parent) + $_parent;
  389.         // line 163
  390.         yield "                </div>
  391.                 <!-- Bouton Voir plus -->
  392.                 ";
  393.         // line 166
  394.         if (((Twig\Extension\CoreExtension::length($this->env->getCharset(), ($context["shops"] ?? null)) > 9) || (($context["current_page"] ?? null) < ($context["total_pages"] ?? null)))) {
  395.             // line 167
  396.             yield "                    <div class=\"text-center mt-4 mb-4\" id=\"loadMoreContainer\">
  397.                         <button class=\"btn btn-primary btn-lg\" id=\"loadMoreBtn\" onclick=\"loadMoreShops()\">
  398.                             <i class=\"lnr lnr-plus-circle me-2\"></i>Voir plus de boutiques
  399.                         </button>
  400.                     </div>
  401.                 ";
  402.         }
  403.         // line 173
  404.         yield "
  405.                 <!-- Message si aucune boutique -->
  406.                 ";
  407.         // line 175
  408.         if ((Twig\Extension\CoreExtension::length($this->env->getCharset(), ($context["shops"] ?? null)) == 0)) {
  409.             // line 176
  410.             yield "                    <div class=\"text-center py-5\">
  411.                         <i class=\"lnr lnr-store\" style=\"font-size: 4rem; color: #ccc;\"></i>
  412.                         <h4 class=\"mt-3\">Aucune boutique trouvée</h4>
  413.                         <p class=\"text-muted\">Aucune boutique ne correspond à vos critères de recherche.</p>
  414.                     </div>
  415.                 ";
  416.         }
  417.         // line 182
  418.         yield "            </div>
  419.         </div>
  420.     </div>
  421. ";
  422.         
  423.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  424.         
  425.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  426.         yield from [];
  427.     }
  428.     // line 187
  429.     /**
  430.      * @return iterable<null|scalar|\Stringable>
  431.      */
  432.     public function block_stylesheets(array $context, array $blocks = []): iterable
  433.     {
  434.         $macros $this->macros;
  435.         $__internal_5a27a8ba21ca79b61932376b2fa922d2 $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  436.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""stylesheets"));
  437.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  438.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""stylesheets"));
  439.         // line 188
  440.         yield "<style>
  441. .single-shop {
  442.     background: white;
  443.     border-radius: 12px;
  444.     padding: 20px;
  445.     margin-bottom: 30px;
  446.     box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  447.     transition: all 0.3s ease;
  448.     display: flex;
  449.     flex-direction: column;
  450.     height: 100%;
  451.     overflow: hidden; /* Empêcher le débordement */
  452. }
  453. .single-shop:hover {
  454.     transform: translateY(-5px);
  455.     box-shadow: 0 8px 25px rgba(0,0,0,0.15);
  456. }
  457. .shop-image {
  458.     position: relative;
  459.     margin-bottom: 15px;
  460. }
  461. .shop-image img {
  462.     width: 100%;
  463.     height: 200px;
  464.     object-fit: cover;
  465.     border-radius: 8px;
  466. }
  467. .verified-badge {
  468.     position: absolute;
  469.     top: 10px;
  470.     right: 10px;
  471.     background: #28a745;
  472.     color: white;
  473.     padding: 5px 8px;
  474.     border-radius: 12px;
  475.     font-size: 0.8rem;
  476. }
  477. .shop-header {
  478.     margin-bottom: 15px;
  479. }
  480. .shop-name {
  481.     margin: 0 0 5px 0;
  482.     font-size: 1.1rem;
  483.     font-weight: 600;
  484. }
  485. .shop-name a {
  486.     color: #333;
  487.     text-decoration: none;
  488. }
  489. .shop-name a:hover {
  490.     color: #007bff;
  491. }
  492. .shop-category {
  493.     background: #f8f9fa;
  494.     color: #666;
  495.     padding: 2px 8px;
  496.     border-radius: 12px;
  497.     font-size: 0.8rem;
  498. }
  499. .shop-stats {
  500.     display: flex;
  501.     justify-content: space-around;
  502.     margin: 15px 0;
  503.     padding: 15px 0;
  504.     border-top: 1px solid #f0f0f0;
  505.     border-bottom: 1px solid #f0f0f0;
  506. }
  507. .stat-item {
  508.     text-align: center;
  509. }
  510. .stat-value {
  511.     display: block;
  512.     font-size: 1.2rem;
  513.     font-weight: 600;
  514.     color: #333;
  515. }
  516. .stat-label {
  517.     font-size: 0.8rem;
  518.     color: #666;
  519.     text-transform: uppercase;
  520.     letter-spacing: 0.5px;
  521. }
  522. .shop-description {
  523.     margin: 15px 0;
  524.     color: #666;
  525.     font-size: 0.9rem;
  526.     line-height: 1.4;
  527. }
  528. .shop-actions {
  529.     display: flex;
  530.     gap: 8px;
  531.     margin-top: auto;
  532.     padding-top: 15px;
  533.     flex-wrap: wrap;
  534. }
  535. .shop-actions .btn {
  536.     flex: 1 1 auto;
  537.     min-width: 0;
  538.     font-size: 0.85rem;
  539.     white-space: nowrap;
  540.     overflow: hidden;
  541.     text-overflow: ellipsis;
  542.     padding: 8px 12px;
  543. }
  544. .shop-actions .btn i {
  545.     margin-right: 4px;
  546.     flex-shrink: 0;
  547. }
  548. /* Assurer que shop-details utilise flexbox pour garder les boutons en bas */
  549. .shop-details {
  550.     display: flex;
  551.     flex-direction: column;
  552.     flex: 1;
  553.     min-height: 0; /* Important pour le flexbox */
  554. }
  555. /* Statistiques modernes inline */
  556. .modern-stats {
  557.     display: flex;
  558.     flex-direction: column;
  559.     gap: 15px;
  560. }
  561. .stat-item-inline {
  562.     display: flex;
  563.     align-items: center;
  564.     gap: 15px;
  565.     padding: 15px;
  566.     background: #f8f9fa;
  567.     border-radius: 10px;
  568.     transition: all 0.3s ease;
  569. }
  570. .stat-item-inline:hover {
  571.     background: #e9ecef;
  572.     transform: translateX(5px);
  573. }
  574. .stat-item-inline i {
  575.     font-size: 1.5rem;
  576.     color: #007bff;
  577.     width: 40px;
  578.     text-align: center;
  579. }
  580. .stat-item-inline .stat-value {
  581.     font-size: 1.5rem;
  582.     font-weight: 700;
  583.     color: #333;
  584.     line-height: 1;
  585. }
  586. .stat-item-inline .stat-label {
  587.     font-size: 0.85rem;
  588.     color: #666;
  589.     text-transform: uppercase;
  590.     letter-spacing: 0.5px;
  591.     margin-top: 5px;
  592. }
  593. .stat-number {
  594.     font-size: 1.5rem;
  595.     font-weight: 700;
  596.     color: #007bff;
  597.     margin-top: 5px;
  598. }
  599. @media (max-width: 768px) {
  600.     .single-shop {
  601.         padding: 15px;
  602.     }
  603.     
  604.     .shop-stats {
  605.         flex-direction: column;
  606.         gap: 10px;
  607.     }
  608.     
  609.     .shop-actions {
  610.         flex-direction: column;
  611.     }
  612. }
  613. </style>
  614. ";
  615.         
  616.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  617.         
  618.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  619.         yield from [];
  620.     }
  621.     // line 390
  622.     /**
  623.      * @return iterable<null|scalar|\Stringable>
  624.      */
  625.     public function block_javascripts(array $context, array $blocks = []): iterable
  626.     {
  627.         $macros $this->macros;
  628.         $__internal_5a27a8ba21ca79b61932376b2fa922d2 $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  629.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""javascripts"));
  630.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  631.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""javascripts"));
  632.         // line 391
  633.         yield "<script>
  634. let currentPage = ";
  635.         // line 392
  636.         yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(($context["current_page"] ?? null), "html"nulltrue);
  637.         yield ";
  638. let totalPages = ";
  639.         // line 393
  640.         yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(($context["total_pages"] ?? null), "html"nulltrue);
  641.         yield ";
  642. let isLoading = false;
  643. function sortShops(sortValue) {
  644.     console.log('Tri des boutiques:', sortValue);
  645.     // TODO: Implémenter le tri AJAX
  646. }
  647. function toggleFollow(shopId, button) {
  648.     if (!button) {
  649.         button = document.querySelector(`.follow-btn[data-shop-id=\"\${shopId}\"]`);
  650.         if (!button) return;
  651.     }
  652.     const isFollowing = button.getAttribute('data-following') === 'true';
  653.     const originalHtml = button.innerHTML;
  654.     button.disabled = true;
  655.     button.innerHTML = '<span class=\"spinner-border spinner-border-sm\"></span>';
  656.     fetch(`";
  657.         // line 412
  658.         yield $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("ui_api_shop_toggle_follow", ["id" => "SHOP_ID"]);
  659.         yield "`.replace('SHOP_ID', shopId), {
  660.         method: 'POST',
  661.         headers: {
  662.             'Content-Type': 'application/json',
  663.             'X-Requested-With': 'XMLHttpRequest'
  664.         },
  665.         body: JSON.stringify({ action: isFollowing ? 'unfollow' : 'follow' })
  666.     })
  667.     .then(response => response.json())
  668.     .then(data => {
  669.         if (data.success) {
  670.             // Mettre à jour l'état du bouton
  671.             const isFollowing = data.isFollowing === true;
  672.             button.setAttribute('data-following', isFollowing ? 'true' : 'false');
  673.             
  674.             // Mettre à jour les classes CSS
  675.             button.classList.remove('btn-outline-secondary', 'btn-outline-danger');
  676.             if (isFollowing) {
  677.                 button.classList.add('btn-outline-danger');
  678.             } else {
  679.                 button.classList.add('btn-outline-secondary');
  680.             }
  681.             // Reconstruire le HTML complet du bouton
  682.             const iconClass = isFollowing ? 'lnr-cross' : 'lnr-plus';
  683.             const textContent = isFollowing ? 'Ne plus suivre' : 'Suivre';
  684.             button.innerHTML = `<i class=\"lnr \${iconClass} me-1\"></i><span class=\"follow-text\">\${textContent}</span>`;
  685.             // Mettre à jour le compteur
  686.             const followersCounter = document.querySelector(`.followers-count[data-shop-id=\"\${shopId}\"]`);
  687.             if (followersCounter && typeof data.followersCount !== 'undefined') {
  688.                 followersCounter.textContent = data.followersCount;
  689.             }
  690.             if (data.message) {
  691.                 console.log(data.message);
  692.             }
  693.             
  694.             button.disabled = false;
  695.         } else {
  696.             alert(data.message || 'Impossible de mettre à jour le suivi.');
  697.             button.innerHTML = originalHtml;
  698.             button.disabled = false;
  699.         }
  700.     })
  701.     .catch(error => {
  702.         console.error('Erreur suivi boutique:', error);
  703.         alert('Erreur lors de la mise à jour du suivi.');
  704.         button.innerHTML = originalHtml;
  705.         button.disabled = false;
  706.     });
  707. }
  708. function loadMoreShops() {
  709.     if (isLoading || currentPage >= totalPages) return;
  710.     
  711.     isLoading = true;
  712.     const btn = document.getElementById('loadMoreBtn');
  713.     const originalText = btn.innerHTML;
  714.     btn.disabled = true;
  715.     btn.innerHTML = '<span class=\"spinner-border spinner-border-sm me-2\"></span>Chargement...';
  716.     
  717.     currentPage++;
  718.     const url = new URL(window.location.href);
  719.     url.searchParams.set('page', currentPage);
  720.     
  721.     fetch(url.toString(), {
  722.         headers: {
  723.             'X-Requested-With': 'XMLHttpRequest'
  724.         }
  725.     })
  726.     .then(response => response.json())
  727.     .then(data => {
  728.         if (data.success && data.shops.length > 0) {
  729.             const container = document.getElementById('shopsContainer');
  730.             data.shops.forEach(shop => {
  731.                 const shopHtml = createShopCard(shop);
  732.                 container.insertAdjacentHTML('beforeend', shopHtml);
  733.             });
  734.             
  735.             // Mettre à jour le bouton
  736.             if (!data.hasMore) {
  737.                 document.getElementById('loadMoreContainer').style.display = 'none';
  738.             } else {
  739.                 btn.disabled = false;
  740.                 btn.innerHTML = originalText;
  741.             }
  742.         } else {
  743.             document.getElementById('loadMoreContainer').style.display = 'none';
  744.         }
  745.         isLoading = false;
  746.     })
  747.     .catch(error => {
  748.         console.error('Erreur:', error);
  749.         btn.disabled = false;
  750.         btn.innerHTML = originalText;
  751.         isLoading = false;
  752.     });
  753. }
  754. function createShopCard(shop) {
  755.     const logoUrl = shop.logo ? '/' + shop.logo : '";
  756.         // line 513
  757.         yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("ui/img/shop/default-shop.jpg"), "html"nulltrue);
  758.         yield "';
  759.     const verifiedBadge = shop.isVerified ? 
  760.         '<div class=\"verified-badge\"><i class=\"lnr lnr-checkmark-circle\"></i></div>' : '';
  761.     const category = shop.category ? 
  762.         `<span class=\"shop-category\">\${shop.category}</span>` : '';
  763.     
  764.     return `
  765.         <div class=\"mt-4 col-lg-4 col-md-6 shop-item\" data-shop-id=\"\${shop.id}\">
  766.             <div class=\"single-shop h-100\">
  767.                 <div class=\"shop-image\">
  768.                     <a href=\"/shop/\${shop.slug}\">
  769.                         <img class=\"img-fluid\" src=\"\${logoUrl}\" alt=\"\${shop.name}\">
  770.                     </a>
  771.                     \${verifiedBadge}
  772.                 </div>
  773.                 <div class=\"shop-details\">
  774.                     <div class=\"shop-header\">
  775.                         <h6 class=\"shop-name\">
  776.                             <a href=\"/shop/\${shop.slug}\">\${shop.name}</a>
  777.                         </h6>
  778.                         \${category}
  779.                     </div>
  780.                     <div class=\"shop-stats\">
  781.                         <div class=\"stat-item\">
  782.                             <span class=\"stat-value\">\${shop.productsCount || 0}</span>
  783.                             <span class=\"stat-label\">Produits</span>
  784.                         </div>
  785.                         <div class=\"stat-item\">
  786.                             <span class=\"stat-value\">\${shop.followersCount || 0}</span>
  787.                             <span class=\"stat-label\">Suiveurs</span>
  788.                         </div>
  789.                         <div class=\"stat-item\">
  790.                             <span class=\"stat-value\">\${shop.viewCount || 0}</span>
  791.                             <span class=\"stat-label\">Vues</span>
  792.                         </div>
  793.                     </div>
  794.                     <div class=\"shop-description\">
  795.                         <p>\${(shop.description || '').substring(0, 100)}\${(shop.description || '').length > 100 ? '...' : ''}</p>
  796.                     </div>
  797.                     <div class=\"shop-actions\">
  798.                         <a href=\"/shop/\${shop.slug}\" class=\"btn btn-primary btn-sm\" style=\"flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;\">
  799.                             <i class=\"lnr lnr-eye me-1\"></i> Voir
  800.                         </a>
  801.                         ";
  802.         // line 556
  803.         if ((($tmp CoreExtension::getAttribute($this->env$this->source, ($context["app"] ?? null), "user", [], "any"falsefalsefalse556)) && $tmp instanceof Markup ? (string) $tmp $tmp)) {
  804.             // line 557
  805.             yield "                        <button class=\"btn btn-sm follow-btn \${shop.following ? 'btn-outline-danger' : 'btn-outline-secondary'}\" 
  806.                                 data-shop-id=\"\${shop.id}\"
  807.                                 data-following=\"\${shop.following ? 'true' : 'false'}\"
  808.                                 onclick=\"toggleFollow(\${shop.id}, this)\"
  809.                                 style=\"flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;\">
  810.                             <i class=\"lnr \${shop.following ? 'lnr-cross' : 'lnr-plus'} me-1\"></i>
  811.                             <span class=\"follow-text\">\${shop.following ? 'Ne plus suivre' : 'Suivre'}</span>
  812.                         </button>
  813.                         ";
  814.         }
  815.         // line 566
  816.         yield "                    </div>
  817.                 </div>
  818.             </div>
  819.         </div>
  820.     `;
  821. }
  822. </script>
  823. ";
  824.         
  825.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  826.         
  827.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  828.         yield from [];
  829.     }
  830.     /**
  831.      * @codeCoverageIgnore
  832.      */
  833.     public function getTemplateName(): string
  834.     {
  835.         return "home/shops_list.html.twig";
  836.     }
  837.     /**
  838.      * @codeCoverageIgnore
  839.      */
  840.     public function isTraitable(): bool
  841.     {
  842.         return false;
  843.     }
  844.     /**
  845.      * @codeCoverageIgnore
  846.      */
  847.     public function getDebugInfo(): array
  848.     {
  849.         return array (  885 => 566,  874 => 557,  872 => 556,  826 => 513,  722 => 412,  700 => 393,  696 => 392,  693 => 391,  680 => 390,  469 => 188,  456 => 187,  442 => 182,  434 => 176,  432 => 175,  428 => 173,  420 => 167,  418 => 166,  413 => 163,  403 => 158,  396 => 154,  391 => 152,  387 => 151,  383 => 150,  379 => 149,  374 => 148,  371 => 147,  368 => 146,  366 => 145,  360 => 142,  353 => 138,  344 => 132,  335 => 128,  328 => 124,  322 => 120,  316 => 118,  314 => 117,  307 => 115,  300 => 110,  294 => 106,  292 => 105,  289 => 104,  281 => 102,  273 => 100,  271 => 99,  267 => 98,  260 => 95,  256 => 94,  241 => 82,  231 => 75,  221 => 68,  209 => 58,  199 => 54,  195 => 53,  188 => 51,  184 => 50,  181 => 49,  177 => 48,  166 => 39,  155 => 31,  146 => 29,  140 => 25,  130 => 18,  126 => 17,  122 => 16,  117 => 14,  108 => 9,  106 => 8,  102 => 6,  89 => 5,  66 => 3,  43 => 1,);
  850.     }
  851.     public function getSourceContext(): Source
  852.     {
  853.         return new Source("{% extends 'base_home.html.twig' %}
  854. {% block title %}Boutiques | MaketOu{% endblock %}
  855. {% block body %}
  856.     <!-- Start Banner Area -->
  857.     {% if selectedCategory and selectedCategory.bannerImage %}
  858.         <section class=\"banner-area shop-category-banner  organic-breadcrumb\" style=\"background-image: url('{{ asset(selectedCategory.bannerImage) }}'); background-size: cover; background-position: center; min-height: 300px; position: relative;object-fit: cover;height:400px;\">
  859.             <div class=\"banner-overlay\" style=\"position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.3);\"></div>
  860.             <div class=\"container\" style=\"position: relative; z-index: 1;\">
  861.                 <div class=\"breadcrumb-banner d-flex flex-wrap align-items-center justify-content-end\">
  862.                     <div class=\"col-first text-white\">
  863.                         <h1 style=\"color: white; text-shadow: 2px 2px 4px rgba(0,0,0,0.5);\">{{ selectedCategory.name }}</h1>
  864.                         <nav class=\"d-flex align-items-center\">
  865.                             <a href=\"{{ path('ui_home') }}\" style=\"color: white;\">Accueil<span class=\"lnr lnr-arrow-right\"></span></a>
  866.                             <a href=\"{{ path('ui_shops_list') }}\" style=\"color: white;\">Boutiques<span class=\"lnr lnr-arrow-right\"></span></a>
  867.                             <a href=\"javascript:void(0);\" style=\"color: white;\">{{ selectedCategory.name }}</a>
  868.                         </nav>
  869.                     </div>
  870.                 </div>
  871.             </div>
  872.         </section>
  873.     {% else %}
  874.         <section class=\"banner-area organic-breadcrumb\">
  875.             <div class=\"container\">
  876.                 <div class=\"breadcrumb-banner d-flex flex-wrap align-items-center justify-content-end\">
  877.                     <div class=\"col-first\">
  878.                         <h1>{% if selectedCategory %}{{ selectedCategory.name }}{% else %}Boutiques{% endif %}</h1>
  879.                         <nav class=\"d-flex align-items-center\">
  880.                             <a href=\"{{ path('ui_home') }}\">Accueil<span class=\"lnr lnr-arrow-right\"></span></a>
  881.                             <a href=\"javascript:void(0);\">Boutiques</a>
  882.                         </nav>
  883.                     </div>
  884.                 </div>
  885.             </div>
  886.         </section>
  887.     {% endif %}
  888.     <!-- End Banner Area -->
  889.     <div class=\"container mt-4 mb-4\">
  890.         <div class=\"row\">
  891.             <div class=\"col-xl-3 col-lg-4 col-md-5\">
  892.                 <!-- Filtres des boutiques -->
  893.                 <div class=\"sidebar-categories\">
  894.                     <div class=\"head\">Catégories de boutiques</div>
  895.                     <ul class=\"main-categories\">
  896.                         {% for category in shopCategories %}
  897.                             <li class=\"main-nav-list\">
  898.                                 <a href=\"{{ path('ui_shops_list', {'category': category.slug}) }}\" 
  899.                                    class=\"category-link {% if app.request.query.get('category') == category.slug %}active{% endif %}\">
  900.                                     <i class=\"lnr lnr-store\"></i>
  901.                                     {{ category.name }}
  902.                                     <span class=\"number\">({{ category.shops|length }})</span>
  903.                                 </a>
  904.                             </li>
  905.                         {% endfor %}
  906.                     </ul>
  907.                 </div>
  908.                 <!-- Statistiques modernes inline -->
  909.                 <div class=\"sidebar-filter mt-4\">
  910.                     <div class=\"top-filter-head\">Statistiques</div>
  911.                     <div class=\"modern-stats\">
  912.                         <div class=\"stat-item-inline mt-3\">
  913.                             <i class=\"lnr lnr-store\"></i>
  914.                             <div>
  915.                                 <div class=\"stat-value\">{{ total_shops|default(0) }}</div>
  916.                                 <div class=\"stat-label\">Total</div>
  917.                             </div>
  918.                         </div>
  919.                         <div class=\"stat-item-inline\">
  920.                             <i class=\"lnr lnr-star\"></i>
  921.                             <div>
  922.                                 <div class=\"stat-value\">{{ shops|filter(shop => shop.isActive)|length }}</div>
  923.                                 <div class=\"stat-label\">Actives</div>
  924.                             </div>
  925.                         </div>
  926.                         <div class=\"stat-item-inline\">
  927.                             <i class=\"lnr lnr-checkmark-circle\"></i>
  928.                             <div>
  929.                                 <div class=\"stat-value\">{{ shops|filter(shop => shop.isVerified)|length }}</div>
  930.                                 <div class=\"stat-label\">Vérifiées</div>
  931.                             </div>
  932.                         </div>
  933.                     </div>
  934.                 </div>
  935.             </div>
  936.             <div class=\"col-xl-9 col-lg-8 col-md-7\">
  937.                 <!-- Liste des boutiques -->
  938.                 <div class=\"row\" id=\"shopsContainer\">
  939.                     {% for shop in shops|slice(0, 9) %}
  940.                         <div class=\"mt-4 col-lg-4 col-md-6 shop-item\" data-shop-id=\"{{ shop.id }}\">
  941.                             <div class=\"single-shop h-100\">
  942.                                 <div class=\"shop-image\">
  943.                                     <a href=\"{{ path('ui_shop_show', {'slug': shop.slug}) }}\">
  944.                                         {% if shop.logo %}
  945.                                             <img class=\"img-fluid\" src=\"{{ asset(shop.logo) }}\" alt=\"{{ shop.name }}\">
  946.                                         {% else %}
  947.                                             <img class=\"img-fluid\" src=\"{{ asset('ui/img/shop/default-shop.jpg') }}\" alt=\"{{ shop.name }}\">
  948.                                         {% endif %}
  949.                                     </a>
  950.                                     {% if shop.isVerified %}
  951.                                         <div class=\"verified-badge\">
  952.                                             <i class=\"lnr lnr-checkmark-circle\"></i>
  953.                                         </div>
  954.                                     {% endif %}
  955.                                 </div>
  956.                                 
  957.                                 <div class=\"shop-details\">
  958.                                     <div class=\"shop-header\">
  959.                                         <h6 class=\"shop-name\">
  960.                                             <a href=\"{{ path('ui_shop_show', {'slug': shop.slug}) }}\">{{ shop.name }}</a>
  961.                                         </h6>
  962.                                         {% if shop.shopCategory %}
  963.                                             <span class=\"shop-category\">{{ shop.shopCategory.name }}</span>
  964.                                         {% endif %}
  965.                                     </div>
  966.                                     
  967.                                     <div class=\"shop-stats\">
  968.                                         <div class=\"stat-item\">
  969.                                             <span class=\"stat-value\">{{ shop.getActiveProductsCount() }}</span>
  970.                                             <span class=\"stat-label\">Produits</span>
  971.                                         </div>
  972.                         <div class=\"stat-item\">
  973.                             <span class=\"stat-value followers-count\" data-shop-id=\"{{ shop.id }}\">{{ shop.getActiveFollowersCount() }}</span>
  974.                                             <span class=\"stat-label\">Suiveurs</span>
  975.                                         </div>
  976.                                         <div class=\"stat-item\">
  977.                                             <span class=\"stat-value\">{{ shop.viewCount }}</span>
  978.                                             <span class=\"stat-label\">Vues</span>
  979.                                         </div>
  980.                                     </div>
  981.                                     
  982.                                     <div class=\"shop-description\">
  983.                                         <p>{{ shop.description|striptags|length > 100 ? shop.description|striptags|slice(0, 100) ~ '...' : shop.description|striptags }}</p>
  984.                                     </div>
  985.                                     
  986.                                     <div class=\"shop-actions\">
  987.                                         <a href=\"{{ path('ui_shop_show', {'slug': shop.slug}) }}\" class=\"btn btn-primary btn-sm\">
  988.                                             <i class=\"lnr lnr-eye me-1\"></i> Voir
  989.                                         </a>
  990.                                         {% if app.user %}
  991.                                             {% set followed_shop_ids = followed_shop_ids|default([]) %}
  992.                                             {% set is_following = shop.id in followed_shop_ids %}
  993.                                             <button class=\"btn btn-sm follow-btn {{ is_following ? 'btn-outline-danger' : 'btn-outline-secondary' }}\" 
  994.                                                     data-shop-id=\"{{ shop.id }}\"
  995.                                                     data-following=\"{{ is_following ? 'true' : 'false' }}\"
  996.                                                     onclick=\"toggleFollow({{ shop.id }}, this)\">
  997.                                                 <i class=\"lnr {{ is_following ? 'lnr-cross' : 'lnr-plus' }} me-1\"></i>
  998.                                                 <span class=\"follow-text\">
  999.                                                     {{ is_following ? 'Ne plus suivre' : 'Suivre' }}
  1000.                                                 </span>
  1001.                                             </button>
  1002.                                         {% endif %}
  1003.                                     </div>
  1004.                                 </div>
  1005.                             </div>
  1006.                         </div>
  1007.                     {% endfor %}
  1008.                 </div>
  1009.                 <!-- Bouton Voir plus -->
  1010.                 {% if shops|length > 9 or current_page < total_pages %}
  1011.                     <div class=\"text-center mt-4 mb-4\" id=\"loadMoreContainer\">
  1012.                         <button class=\"btn btn-primary btn-lg\" id=\"loadMoreBtn\" onclick=\"loadMoreShops()\">
  1013.                             <i class=\"lnr lnr-plus-circle me-2\"></i>Voir plus de boutiques
  1014.                         </button>
  1015.                     </div>
  1016.                 {% endif %}
  1017.                 <!-- Message si aucune boutique -->
  1018.                 {% if shops|length == 0 %}
  1019.                     <div class=\"text-center py-5\">
  1020.                         <i class=\"lnr lnr-store\" style=\"font-size: 4rem; color: #ccc;\"></i>
  1021.                         <h4 class=\"mt-3\">Aucune boutique trouvée</h4>
  1022.                         <p class=\"text-muted\">Aucune boutique ne correspond à vos critères de recherche.</p>
  1023.                     </div>
  1024.                 {% endif %}
  1025.             </div>
  1026.         </div>
  1027.     </div>
  1028. {% endblock %}
  1029. {% block stylesheets %}
  1030. <style>
  1031. .single-shop {
  1032.     background: white;
  1033.     border-radius: 12px;
  1034.     padding: 20px;
  1035.     margin-bottom: 30px;
  1036.     box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  1037.     transition: all 0.3s ease;
  1038.     display: flex;
  1039.     flex-direction: column;
  1040.     height: 100%;
  1041.     overflow: hidden; /* Empêcher le débordement */
  1042. }
  1043. .single-shop:hover {
  1044.     transform: translateY(-5px);
  1045.     box-shadow: 0 8px 25px rgba(0,0,0,0.15);
  1046. }
  1047. .shop-image {
  1048.     position: relative;
  1049.     margin-bottom: 15px;
  1050. }
  1051. .shop-image img {
  1052.     width: 100%;
  1053.     height: 200px;
  1054.     object-fit: cover;
  1055.     border-radius: 8px;
  1056. }
  1057. .verified-badge {
  1058.     position: absolute;
  1059.     top: 10px;
  1060.     right: 10px;
  1061.     background: #28a745;
  1062.     color: white;
  1063.     padding: 5px 8px;
  1064.     border-radius: 12px;
  1065.     font-size: 0.8rem;
  1066. }
  1067. .shop-header {
  1068.     margin-bottom: 15px;
  1069. }
  1070. .shop-name {
  1071.     margin: 0 0 5px 0;
  1072.     font-size: 1.1rem;
  1073.     font-weight: 600;
  1074. }
  1075. .shop-name a {
  1076.     color: #333;
  1077.     text-decoration: none;
  1078. }
  1079. .shop-name a:hover {
  1080.     color: #007bff;
  1081. }
  1082. .shop-category {
  1083.     background: #f8f9fa;
  1084.     color: #666;
  1085.     padding: 2px 8px;
  1086.     border-radius: 12px;
  1087.     font-size: 0.8rem;
  1088. }
  1089. .shop-stats {
  1090.     display: flex;
  1091.     justify-content: space-around;
  1092.     margin: 15px 0;
  1093.     padding: 15px 0;
  1094.     border-top: 1px solid #f0f0f0;
  1095.     border-bottom: 1px solid #f0f0f0;
  1096. }
  1097. .stat-item {
  1098.     text-align: center;
  1099. }
  1100. .stat-value {
  1101.     display: block;
  1102.     font-size: 1.2rem;
  1103.     font-weight: 600;
  1104.     color: #333;
  1105. }
  1106. .stat-label {
  1107.     font-size: 0.8rem;
  1108.     color: #666;
  1109.     text-transform: uppercase;
  1110.     letter-spacing: 0.5px;
  1111. }
  1112. .shop-description {
  1113.     margin: 15px 0;
  1114.     color: #666;
  1115.     font-size: 0.9rem;
  1116.     line-height: 1.4;
  1117. }
  1118. .shop-actions {
  1119.     display: flex;
  1120.     gap: 8px;
  1121.     margin-top: auto;
  1122.     padding-top: 15px;
  1123.     flex-wrap: wrap;
  1124. }
  1125. .shop-actions .btn {
  1126.     flex: 1 1 auto;
  1127.     min-width: 0;
  1128.     font-size: 0.85rem;
  1129.     white-space: nowrap;
  1130.     overflow: hidden;
  1131.     text-overflow: ellipsis;
  1132.     padding: 8px 12px;
  1133. }
  1134. .shop-actions .btn i {
  1135.     margin-right: 4px;
  1136.     flex-shrink: 0;
  1137. }
  1138. /* Assurer que shop-details utilise flexbox pour garder les boutons en bas */
  1139. .shop-details {
  1140.     display: flex;
  1141.     flex-direction: column;
  1142.     flex: 1;
  1143.     min-height: 0; /* Important pour le flexbox */
  1144. }
  1145. /* Statistiques modernes inline */
  1146. .modern-stats {
  1147.     display: flex;
  1148.     flex-direction: column;
  1149.     gap: 15px;
  1150. }
  1151. .stat-item-inline {
  1152.     display: flex;
  1153.     align-items: center;
  1154.     gap: 15px;
  1155.     padding: 15px;
  1156.     background: #f8f9fa;
  1157.     border-radius: 10px;
  1158.     transition: all 0.3s ease;
  1159. }
  1160. .stat-item-inline:hover {
  1161.     background: #e9ecef;
  1162.     transform: translateX(5px);
  1163. }
  1164. .stat-item-inline i {
  1165.     font-size: 1.5rem;
  1166.     color: #007bff;
  1167.     width: 40px;
  1168.     text-align: center;
  1169. }
  1170. .stat-item-inline .stat-value {
  1171.     font-size: 1.5rem;
  1172.     font-weight: 700;
  1173.     color: #333;
  1174.     line-height: 1;
  1175. }
  1176. .stat-item-inline .stat-label {
  1177.     font-size: 0.85rem;
  1178.     color: #666;
  1179.     text-transform: uppercase;
  1180.     letter-spacing: 0.5px;
  1181.     margin-top: 5px;
  1182. }
  1183. .stat-number {
  1184.     font-size: 1.5rem;
  1185.     font-weight: 700;
  1186.     color: #007bff;
  1187.     margin-top: 5px;
  1188. }
  1189. @media (max-width: 768px) {
  1190.     .single-shop {
  1191.         padding: 15px;
  1192.     }
  1193.     
  1194.     .shop-stats {
  1195.         flex-direction: column;
  1196.         gap: 10px;
  1197.     }
  1198.     
  1199.     .shop-actions {
  1200.         flex-direction: column;
  1201.     }
  1202. }
  1203. </style>
  1204. {% endblock %}
  1205. {% block javascripts %}
  1206. <script>
  1207. let currentPage = {{ current_page }};
  1208. let totalPages = {{ total_pages }};
  1209. let isLoading = false;
  1210. function sortShops(sortValue) {
  1211.     console.log('Tri des boutiques:', sortValue);
  1212.     // TODO: Implémenter le tri AJAX
  1213. }
  1214. function toggleFollow(shopId, button) {
  1215.     if (!button) {
  1216.         button = document.querySelector(`.follow-btn[data-shop-id=\"\${shopId}\"]`);
  1217.         if (!button) return;
  1218.     }
  1219.     const isFollowing = button.getAttribute('data-following') === 'true';
  1220.     const originalHtml = button.innerHTML;
  1221.     button.disabled = true;
  1222.     button.innerHTML = '<span class=\"spinner-border spinner-border-sm\"></span>';
  1223.     fetch(`{{ path('ui_api_shop_toggle_follow', {'id': 'SHOP_ID'}) }}`.replace('SHOP_ID', shopId), {
  1224.         method: 'POST',
  1225.         headers: {
  1226.             'Content-Type': 'application/json',
  1227.             'X-Requested-With': 'XMLHttpRequest'
  1228.         },
  1229.         body: JSON.stringify({ action: isFollowing ? 'unfollow' : 'follow' })
  1230.     })
  1231.     .then(response => response.json())
  1232.     .then(data => {
  1233.         if (data.success) {
  1234.             // Mettre à jour l'état du bouton
  1235.             const isFollowing = data.isFollowing === true;
  1236.             button.setAttribute('data-following', isFollowing ? 'true' : 'false');
  1237.             
  1238.             // Mettre à jour les classes CSS
  1239.             button.classList.remove('btn-outline-secondary', 'btn-outline-danger');
  1240.             if (isFollowing) {
  1241.                 button.classList.add('btn-outline-danger');
  1242.             } else {
  1243.                 button.classList.add('btn-outline-secondary');
  1244.             }
  1245.             // Reconstruire le HTML complet du bouton
  1246.             const iconClass = isFollowing ? 'lnr-cross' : 'lnr-plus';
  1247.             const textContent = isFollowing ? 'Ne plus suivre' : 'Suivre';
  1248.             button.innerHTML = `<i class=\"lnr \${iconClass} me-1\"></i><span class=\"follow-text\">\${textContent}</span>`;
  1249.             // Mettre à jour le compteur
  1250.             const followersCounter = document.querySelector(`.followers-count[data-shop-id=\"\${shopId}\"]`);
  1251.             if (followersCounter && typeof data.followersCount !== 'undefined') {
  1252.                 followersCounter.textContent = data.followersCount;
  1253.             }
  1254.             if (data.message) {
  1255.                 console.log(data.message);
  1256.             }
  1257.             
  1258.             button.disabled = false;
  1259.         } else {
  1260.             alert(data.message || 'Impossible de mettre à jour le suivi.');
  1261.             button.innerHTML = originalHtml;
  1262.             button.disabled = false;
  1263.         }
  1264.     })
  1265.     .catch(error => {
  1266.         console.error('Erreur suivi boutique:', error);
  1267.         alert('Erreur lors de la mise à jour du suivi.');
  1268.         button.innerHTML = originalHtml;
  1269.         button.disabled = false;
  1270.     });
  1271. }
  1272. function loadMoreShops() {
  1273.     if (isLoading || currentPage >= totalPages) return;
  1274.     
  1275.     isLoading = true;
  1276.     const btn = document.getElementById('loadMoreBtn');
  1277.     const originalText = btn.innerHTML;
  1278.     btn.disabled = true;
  1279.     btn.innerHTML = '<span class=\"spinner-border spinner-border-sm me-2\"></span>Chargement...';
  1280.     
  1281.     currentPage++;
  1282.     const url = new URL(window.location.href);
  1283.     url.searchParams.set('page', currentPage);
  1284.     
  1285.     fetch(url.toString(), {
  1286.         headers: {
  1287.             'X-Requested-With': 'XMLHttpRequest'
  1288.         }
  1289.     })
  1290.     .then(response => response.json())
  1291.     .then(data => {
  1292.         if (data.success && data.shops.length > 0) {
  1293.             const container = document.getElementById('shopsContainer');
  1294.             data.shops.forEach(shop => {
  1295.                 const shopHtml = createShopCard(shop);
  1296.                 container.insertAdjacentHTML('beforeend', shopHtml);
  1297.             });
  1298.             
  1299.             // Mettre à jour le bouton
  1300.             if (!data.hasMore) {
  1301.                 document.getElementById('loadMoreContainer').style.display = 'none';
  1302.             } else {
  1303.                 btn.disabled = false;
  1304.                 btn.innerHTML = originalText;
  1305.             }
  1306.         } else {
  1307.             document.getElementById('loadMoreContainer').style.display = 'none';
  1308.         }
  1309.         isLoading = false;
  1310.     })
  1311.     .catch(error => {
  1312.         console.error('Erreur:', error);
  1313.         btn.disabled = false;
  1314.         btn.innerHTML = originalText;
  1315.         isLoading = false;
  1316.     });
  1317. }
  1318. function createShopCard(shop) {
  1319.     const logoUrl = shop.logo ? '/' + shop.logo : '{{ asset(\"ui/img/shop/default-shop.jpg\") }}';
  1320.     const verifiedBadge = shop.isVerified ? 
  1321.         '<div class=\"verified-badge\"><i class=\"lnr lnr-checkmark-circle\"></i></div>' : '';
  1322.     const category = shop.category ? 
  1323.         `<span class=\"shop-category\">\${shop.category}</span>` : '';
  1324.     
  1325.     return `
  1326.         <div class=\"mt-4 col-lg-4 col-md-6 shop-item\" data-shop-id=\"\${shop.id}\">
  1327.             <div class=\"single-shop h-100\">
  1328.                 <div class=\"shop-image\">
  1329.                     <a href=\"/shop/\${shop.slug}\">
  1330.                         <img class=\"img-fluid\" src=\"\${logoUrl}\" alt=\"\${shop.name}\">
  1331.                     </a>
  1332.                     \${verifiedBadge}
  1333.                 </div>
  1334.                 <div class=\"shop-details\">
  1335.                     <div class=\"shop-header\">
  1336.                         <h6 class=\"shop-name\">
  1337.                             <a href=\"/shop/\${shop.slug}\">\${shop.name}</a>
  1338.                         </h6>
  1339.                         \${category}
  1340.                     </div>
  1341.                     <div class=\"shop-stats\">
  1342.                         <div class=\"stat-item\">
  1343.                             <span class=\"stat-value\">\${shop.productsCount || 0}</span>
  1344.                             <span class=\"stat-label\">Produits</span>
  1345.                         </div>
  1346.                         <div class=\"stat-item\">
  1347.                             <span class=\"stat-value\">\${shop.followersCount || 0}</span>
  1348.                             <span class=\"stat-label\">Suiveurs</span>
  1349.                         </div>
  1350.                         <div class=\"stat-item\">
  1351.                             <span class=\"stat-value\">\${shop.viewCount || 0}</span>
  1352.                             <span class=\"stat-label\">Vues</span>
  1353.                         </div>
  1354.                     </div>
  1355.                     <div class=\"shop-description\">
  1356.                         <p>\${(shop.description || '').substring(0, 100)}\${(shop.description || '').length > 100 ? '...' : ''}</p>
  1357.                     </div>
  1358.                     <div class=\"shop-actions\">
  1359.                         <a href=\"/shop/\${shop.slug}\" class=\"btn btn-primary btn-sm\" style=\"flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;\">
  1360.                             <i class=\"lnr lnr-eye me-1\"></i> Voir
  1361.                         </a>
  1362.                         {% if app.user %}
  1363.                         <button class=\"btn btn-sm follow-btn \${shop.following ? 'btn-outline-danger' : 'btn-outline-secondary'}\" 
  1364.                                 data-shop-id=\"\${shop.id}\"
  1365.                                 data-following=\"\${shop.following ? 'true' : 'false'}\"
  1366.                                 onclick=\"toggleFollow(\${shop.id}, this)\"
  1367.                                 style=\"flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;\">
  1368.                             <i class=\"lnr \${shop.following ? 'lnr-cross' : 'lnr-plus'} me-1\"></i>
  1369.                             <span class=\"follow-text\">\${shop.following ? 'Ne plus suivre' : 'Suivre'}</span>
  1370.                         </button>
  1371.                         {% endif %}
  1372.                     </div>
  1373.                 </div>
  1374.             </div>
  1375.         </div>
  1376.     `;
  1377. }
  1378. </script>
  1379. {% endblock %}
  1380. ""home/shops_list.html.twig""/home/u540977899/domains/maketou-ht.com/public_html/templates/home/shops_list.html.twig");
  1381.     }
  1382. }