<?php
use Twig\Environment;
use Twig\Error\LoaderError;
use Twig\Error\RuntimeError;
use Twig\Extension\CoreExtension;
use Twig\Extension\SandboxExtension;
use Twig\Markup;
use Twig\Sandbox\SecurityError;
use Twig\Sandbox\SecurityNotAllowedTagError;
use Twig\Sandbox\SecurityNotAllowedFilterError;
use Twig\Sandbox\SecurityNotAllowedFunctionError;
use Twig\Source;
use Twig\Template;
use Twig\TemplateWrapper;
/* home/shops_list.html.twig */
class __TwigTemplate_2c903694a6a24f3c0ae62c1cd97a5737 extends Template
{
private Source $source;
/**
* @var array<string, Template>
*/
private array $macros = [];
public function __construct(Environment $env)
{
parent::__construct($env);
$this->source = $this->getSourceContext();
$this->blocks = [
'title' => [$this, 'block_title'],
'body' => [$this, 'block_body'],
'stylesheets' => [$this, 'block_stylesheets'],
'javascripts' => [$this, 'block_javascripts'],
];
}
protected function doGetParent(array $context): bool|string|Template|TemplateWrapper
{
// line 1
return "base_home.html.twig";
}
protected function doDisplay(array $context, array $blocks = []): iterable
{
$macros = $this->macros;
$__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "home/shops_list.html.twig"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "home/shops_list.html.twig"));
$this->parent = $this->load("base_home.html.twig", 1);
yield from $this->parent->unwrap()->yield($context, array_merge($this->blocks, $blocks));
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
}
// line 3
/**
* @return iterable<null|scalar|\Stringable>
*/
public function block_title(array $context, array $blocks = []): iterable
{
$macros = $this->macros;
$__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "title"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "title"));
yield "Boutiques | MaketOu";
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
yield from [];
}
// line 5
/**
* @return iterable<null|scalar|\Stringable>
*/
public function block_body(array $context, array $blocks = []): iterable
{
$macros = $this->macros;
$__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "body"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "body"));
// line 6
yield "
<!-- Start Banner Area -->
";
// line 8
if ((($context["selectedCategory"] ?? null) && CoreExtension::getAttribute($this->env, $this->source, ($context["selectedCategory"] ?? null), "bannerImage", [], "any", false, false, false, 8))) {
// line 9
yield " <section class=\"banner-area shop-category-banner organic-breadcrumb\" style=\"background-image: url('";
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", false, false, false, 9)), "html", null, true);
yield "'); background-size: cover; background-position: center; min-height: 300px; position: relative;object-fit: cover;height:400px;\">
<div class=\"banner-overlay\" style=\"position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.3);\"></div>
<div class=\"container\" style=\"position: relative; z-index: 1;\">
<div class=\"breadcrumb-banner d-flex flex-wrap align-items-center justify-content-end\">
<div class=\"col-first text-white\">
<h1 style=\"color: white; text-shadow: 2px 2px 4px rgba(0,0,0,0.5);\">";
// line 14
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, ($context["selectedCategory"] ?? null), "name", [], "any", false, false, false, 14), "html", null, true);
yield "</h1>
<nav class=\"d-flex align-items-center\">
<a href=\"";
// line 16
yield $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("ui_home");
yield "\" style=\"color: white;\">Accueil<span class=\"lnr lnr-arrow-right\"></span></a>
<a href=\"";
// line 17
yield $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("ui_shops_list");
yield "\" style=\"color: white;\">Boutiques<span class=\"lnr lnr-arrow-right\"></span></a>
<a href=\"javascript:void(0);\" style=\"color: white;\">";
// line 18
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, ($context["selectedCategory"] ?? null), "name", [], "any", false, false, false, 18), "html", null, true);
yield "</a>
</nav>
</div>
</div>
</div>
</section>
";
} else {
// line 25
yield " <section class=\"banner-area organic-breadcrumb\">
<div class=\"container\">
<div class=\"breadcrumb-banner d-flex flex-wrap align-items-center justify-content-end\">
<div class=\"col-first\">
<h1>";
// line 29
if ((($tmp = ($context["selectedCategory"] ?? null)) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, ($context["selectedCategory"] ?? null), "name", [], "any", false, false, false, 29), "html", null, true);
} else {
yield "Boutiques";
}
yield "</h1>
<nav class=\"d-flex align-items-center\">
<a href=\"";
// line 31
yield $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("ui_home");
yield "\">Accueil<span class=\"lnr lnr-arrow-right\"></span></a>
<a href=\"javascript:void(0);\">Boutiques</a>
</nav>
</div>
</div>
</div>
</section>
";
}
// line 39
yield " <!-- End Banner Area -->
<div class=\"container mt-4 mb-4\">
<div class=\"row\">
<div class=\"col-xl-3 col-lg-4 col-md-5\">
<!-- Filtres des boutiques -->
<div class=\"sidebar-categories\">
<div class=\"head\">Catégories de boutiques</div>
<ul class=\"main-categories\">
";
// line 48
$context['_parent'] = $context;
$context['_seq'] = CoreExtension::ensureTraversable(($context["shopCategories"] ?? null));
foreach ($context['_seq'] as $context["_key"] => $context["category"]) {
// line 49
yield " <li class=\"main-nav-list\">
<a href=\"";
// line 50
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", false, false, false, 50)]), "html", null, true);
yield "\"
class=\"category-link ";
// line 51
if ((CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, ($context["app"] ?? null), "request", [], "any", false, false, false, 51), "query", [], "any", false, false, false, 51), "get", ["category"], "method", false, false, false, 51) == CoreExtension::getAttribute($this->env, $this->source, $context["category"], "slug", [], "any", false, false, false, 51))) {
yield "active";
}
yield "\">
<i class=\"lnr lnr-store\"></i>
";
// line 53
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["category"], "name", [], "any", false, false, false, 53), "html", null, true);
yield "
<span class=\"number\">(";
// line 54
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", false, false, false, 54)), "html", null, true);
yield ")</span>
</a>
</li>
";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_key'], $context['category'], $context['_parent']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 58
yield " </ul>
</div>
<!-- Statistiques modernes inline -->
<div class=\"sidebar-filter mt-4\">
<div class=\"top-filter-head\">Statistiques</div>
<div class=\"modern-stats\">
<div class=\"stat-item-inline mt-3\">
<i class=\"lnr lnr-store\"></i>
<div>
<div class=\"stat-value\">";
// line 68
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", null, true);
yield "</div>
<div class=\"stat-label\">Total</div>
</div>
</div>
<div class=\"stat-item-inline\">
<i class=\"lnr lnr-star\"></i>
<div>
<div class=\"stat-value\">";
// line 75
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", false, false, false, 75); })), "html", null, true);
yield "</div>
<div class=\"stat-label\">Actives</div>
</div>
</div>
<div class=\"stat-item-inline\">
<i class=\"lnr lnr-checkmark-circle\"></i>
<div>
<div class=\"stat-value\">";
// line 82
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", false, false, false, 82); })), "html", null, true);
yield "</div>
<div class=\"stat-label\">Vérifiées</div>
</div>
</div>
</div>
</div>
</div>
<div class=\"col-xl-9 col-lg-8 col-md-7\">
<!-- Liste des boutiques -->
<div class=\"row\" id=\"shopsContainer\">
";
// line 94
$context['_parent'] = $context;
$context['_seq'] = CoreExtension::ensureTraversable(Twig\Extension\CoreExtension::slice($this->env->getCharset(), ($context["shops"] ?? null), 0, 9));
foreach ($context['_seq'] as $context["_key"] => $context["shop"]) {
// line 95
yield " <div class=\"mt-4 col-lg-4 col-md-6 shop-item\" data-shop-id=\"";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["shop"], "id", [], "any", false, false, false, 95), "html", null, true);
yield "\">
<div class=\"single-shop h-100\">
<div class=\"shop-image\">
<a href=\"";
// line 98
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", false, false, false, 98)]), "html", null, true);
yield "\">
";
// line 99
if ((($tmp = CoreExtension::getAttribute($this->env, $this->source, $context["shop"], "logo", [], "any", false, false, false, 99)) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
// line 100
yield " <img class=\"img-fluid\" src=\"";
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", false, false, false, 100)), "html", null, true);
yield "\" alt=\"";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["shop"], "name", [], "any", false, false, false, 100), "html", null, true);
yield "\">
";
} else {
// line 102
yield " <img class=\"img-fluid\" src=\"";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("ui/img/shop/default-shop.jpg"), "html", null, true);
yield "\" alt=\"";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["shop"], "name", [], "any", false, false, false, 102), "html", null, true);
yield "\">
";
}
// line 104
yield " </a>
";
// line 105
if ((($tmp = CoreExtension::getAttribute($this->env, $this->source, $context["shop"], "isVerified", [], "any", false, false, false, 105)) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
// line 106
yield " <div class=\"verified-badge\">
<i class=\"lnr lnr-checkmark-circle\"></i>
</div>
";
}
// line 110
yield " </div>
<div class=\"shop-details\">
<div class=\"shop-header\">
<h6 class=\"shop-name\">
<a href=\"";
// line 115
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", false, false, false, 115)]), "html", null, true);
yield "\">";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["shop"], "name", [], "any", false, false, false, 115), "html", null, true);
yield "</a>
</h6>
";
// line 117
if ((($tmp = CoreExtension::getAttribute($this->env, $this->source, $context["shop"], "shopCategory", [], "any", false, false, false, 117)) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
// line 118
yield " <span class=\"shop-category\">";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, $context["shop"], "shopCategory", [], "any", false, false, false, 118), "name", [], "any", false, false, false, 118), "html", null, true);
yield "</span>
";
}
// line 120
yield " </div>
<div class=\"shop-stats\">
<div class=\"stat-item\">
<span class=\"stat-value\">";
// line 124
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["shop"], "getActiveProductsCount", [], "method", false, false, false, 124), "html", null, true);
yield "</span>
<span class=\"stat-label\">Produits</span>
</div>
<div class=\"stat-item\">
<span class=\"stat-value followers-count\" data-shop-id=\"";
// line 128
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["shop"], "id", [], "any", false, false, false, 128), "html", null, true);
yield "\">";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["shop"], "getActiveFollowersCount", [], "method", false, false, false, 128), "html", null, true);
yield "</span>
<span class=\"stat-label\">Suiveurs</span>
</div>
<div class=\"stat-item\">
<span class=\"stat-value\">";
// line 132
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["shop"], "viewCount", [], "any", false, false, false, 132), "html", null, true);
yield "</span>
<span class=\"stat-label\">Vues</span>
</div>
</div>
<div class=\"shop-description\">
<p>";
// line 138
yield (((Twig\Extension\CoreExtension::length($this->env->getCharset(), Twig\Extension\CoreExtension::striptags(CoreExtension::getAttribute($this->env, $this->source, $context["shop"], "description", [], "any", false, false, false, 138))) > 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", false, false, false, 138)), 0, 100) . "..."), "html", null, true)) : ($this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(Twig\Extension\CoreExtension::striptags(CoreExtension::getAttribute($this->env, $this->source, $context["shop"], "description", [], "any", false, false, false, 138)), "html", null, true)));
yield "</p>
</div>
<div class=\"shop-actions\">
<a href=\"";
// line 142
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", false, false, false, 142)]), "html", null, true);
yield "\" class=\"btn btn-primary btn-sm\">
<i class=\"lnr lnr-eye me-1\"></i> Voir
</a>
";
// line 145
if ((($tmp = CoreExtension::getAttribute($this->env, $this->source, ($context["app"] ?? null), "user", [], "any", false, false, false, 145)) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
// line 146
yield " ";
$context["followed_shop_ids"] = ((array_key_exists("followed_shop_ids", $context)) ? (Twig\Extension\CoreExtension::default(($context["followed_shop_ids"] ?? null), [])) : ([]));
// line 147
yield " ";
$context["is_following"] = CoreExtension::inFilter(CoreExtension::getAttribute($this->env, $this->source, $context["shop"], "id", [], "any", false, false, false, 147), ($context["followed_shop_ids"] ?? null));
// line 148
yield " <button class=\"btn btn-sm follow-btn ";
yield (((($tmp = ($context["is_following"] ?? null)) && $tmp instanceof Markup ? (string) $tmp : $tmp)) ? ("btn-outline-danger") : ("btn-outline-secondary"));
yield "\"
data-shop-id=\"";
// line 149
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["shop"], "id", [], "any", false, false, false, 149), "html", null, true);
yield "\"
data-following=\"";
// line 150
yield (((($tmp = ($context["is_following"] ?? null)) && $tmp instanceof Markup ? (string) $tmp : $tmp)) ? ("true") : ("false"));
yield "\"
onclick=\"toggleFollow(";
// line 151
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["shop"], "id", [], "any", false, false, false, 151), "html", null, true);
yield ", this)\">
<i class=\"lnr ";
// line 152
yield (((($tmp = ($context["is_following"] ?? null)) && $tmp instanceof Markup ? (string) $tmp : $tmp)) ? ("lnr-cross") : ("lnr-plus"));
yield " me-1\"></i>
<span class=\"follow-text\">
";
// line 154
yield (((($tmp = ($context["is_following"] ?? null)) && $tmp instanceof Markup ? (string) $tmp : $tmp)) ? ("Ne plus suivre") : ("Suivre"));
yield "
</span>
</button>
";
}
// line 158
yield " </div>
</div>
</div>
</div>
";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_key'], $context['shop'], $context['_parent']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 163
yield " </div>
<!-- Bouton Voir plus -->
";
// line 166
if (((Twig\Extension\CoreExtension::length($this->env->getCharset(), ($context["shops"] ?? null)) > 9) || (($context["current_page"] ?? null) < ($context["total_pages"] ?? null)))) {
// line 167
yield " <div class=\"text-center mt-4 mb-4\" id=\"loadMoreContainer\">
<button class=\"btn btn-primary btn-lg\" id=\"loadMoreBtn\" onclick=\"loadMoreShops()\">
<i class=\"lnr lnr-plus-circle me-2\"></i>Voir plus de boutiques
</button>
</div>
";
}
// line 173
yield "
<!-- Message si aucune boutique -->
";
// line 175
if ((Twig\Extension\CoreExtension::length($this->env->getCharset(), ($context["shops"] ?? null)) == 0)) {
// line 176
yield " <div class=\"text-center py-5\">
<i class=\"lnr lnr-store\" style=\"font-size: 4rem; color: #ccc;\"></i>
<h4 class=\"mt-3\">Aucune boutique trouvée</h4>
<p class=\"text-muted\">Aucune boutique ne correspond à vos critères de recherche.</p>
</div>
";
}
// line 182
yield " </div>
</div>
</div>
";
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
yield from [];
}
// line 187
/**
* @return iterable<null|scalar|\Stringable>
*/
public function block_stylesheets(array $context, array $blocks = []): iterable
{
$macros = $this->macros;
$__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "stylesheets"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "stylesheets"));
// line 188
yield "<style>
.single-shop {
background: white;
border-radius: 12px;
padding: 20px;
margin-bottom: 30px;
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
transition: all 0.3s ease;
display: flex;
flex-direction: column;
height: 100%;
overflow: hidden; /* Empêcher le débordement */
}
.single-shop:hover {
transform: translateY(-5px);
box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}
.shop-image {
position: relative;
margin-bottom: 15px;
}
.shop-image img {
width: 100%;
height: 200px;
object-fit: cover;
border-radius: 8px;
}
.verified-badge {
position: absolute;
top: 10px;
right: 10px;
background: #28a745;
color: white;
padding: 5px 8px;
border-radius: 12px;
font-size: 0.8rem;
}
.shop-header {
margin-bottom: 15px;
}
.shop-name {
margin: 0 0 5px 0;
font-size: 1.1rem;
font-weight: 600;
}
.shop-name a {
color: #333;
text-decoration: none;
}
.shop-name a:hover {
color: #007bff;
}
.shop-category {
background: #f8f9fa;
color: #666;
padding: 2px 8px;
border-radius: 12px;
font-size: 0.8rem;
}
.shop-stats {
display: flex;
justify-content: space-around;
margin: 15px 0;
padding: 15px 0;
border-top: 1px solid #f0f0f0;
border-bottom: 1px solid #f0f0f0;
}
.stat-item {
text-align: center;
}
.stat-value {
display: block;
font-size: 1.2rem;
font-weight: 600;
color: #333;
}
.stat-label {
font-size: 0.8rem;
color: #666;
text-transform: uppercase;
letter-spacing: 0.5px;
}
.shop-description {
margin: 15px 0;
color: #666;
font-size: 0.9rem;
line-height: 1.4;
}
.shop-actions {
display: flex;
gap: 8px;
margin-top: auto;
padding-top: 15px;
flex-wrap: wrap;
}
.shop-actions .btn {
flex: 1 1 auto;
min-width: 0;
font-size: 0.85rem;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
padding: 8px 12px;
}
.shop-actions .btn i {
margin-right: 4px;
flex-shrink: 0;
}
/* Assurer que shop-details utilise flexbox pour garder les boutons en bas */
.shop-details {
display: flex;
flex-direction: column;
flex: 1;
min-height: 0; /* Important pour le flexbox */
}
/* Statistiques modernes inline */
.modern-stats {
display: flex;
flex-direction: column;
gap: 15px;
}
.stat-item-inline {
display: flex;
align-items: center;
gap: 15px;
padding: 15px;
background: #f8f9fa;
border-radius: 10px;
transition: all 0.3s ease;
}
.stat-item-inline:hover {
background: #e9ecef;
transform: translateX(5px);
}
.stat-item-inline i {
font-size: 1.5rem;
color: #007bff;
width: 40px;
text-align: center;
}
.stat-item-inline .stat-value {
font-size: 1.5rem;
font-weight: 700;
color: #333;
line-height: 1;
}
.stat-item-inline .stat-label {
font-size: 0.85rem;
color: #666;
text-transform: uppercase;
letter-spacing: 0.5px;
margin-top: 5px;
}
.stat-number {
font-size: 1.5rem;
font-weight: 700;
color: #007bff;
margin-top: 5px;
}
@media (max-width: 768px) {
.single-shop {
padding: 15px;
}
.shop-stats {
flex-direction: column;
gap: 10px;
}
.shop-actions {
flex-direction: column;
}
}
</style>
";
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
yield from [];
}
// line 390
/**
* @return iterable<null|scalar|\Stringable>
*/
public function block_javascripts(array $context, array $blocks = []): iterable
{
$macros = $this->macros;
$__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "javascripts"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "javascripts"));
// line 391
yield "<script>
let currentPage = ";
// line 392
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(($context["current_page"] ?? null), "html", null, true);
yield ";
let totalPages = ";
// line 393
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(($context["total_pages"] ?? null), "html", null, true);
yield ";
let isLoading = false;
function sortShops(sortValue) {
console.log('Tri des boutiques:', sortValue);
// TODO: Implémenter le tri AJAX
}
function toggleFollow(shopId, button) {
if (!button) {
button = document.querySelector(`.follow-btn[data-shop-id=\"\${shopId}\"]`);
if (!button) return;
}
const isFollowing = button.getAttribute('data-following') === 'true';
const originalHtml = button.innerHTML;
button.disabled = true;
button.innerHTML = '<span class=\"spinner-border spinner-border-sm\"></span>';
fetch(`";
// line 412
yield $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("ui_api_shop_toggle_follow", ["id" => "SHOP_ID"]);
yield "`.replace('SHOP_ID', shopId), {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-Requested-With': 'XMLHttpRequest'
},
body: JSON.stringify({ action: isFollowing ? 'unfollow' : 'follow' })
})
.then(response => response.json())
.then(data => {
if (data.success) {
// Mettre à jour l'état du bouton
const isFollowing = data.isFollowing === true;
button.setAttribute('data-following', isFollowing ? 'true' : 'false');
// Mettre à jour les classes CSS
button.classList.remove('btn-outline-secondary', 'btn-outline-danger');
if (isFollowing) {
button.classList.add('btn-outline-danger');
} else {
button.classList.add('btn-outline-secondary');
}
// Reconstruire le HTML complet du bouton
const iconClass = isFollowing ? 'lnr-cross' : 'lnr-plus';
const textContent = isFollowing ? 'Ne plus suivre' : 'Suivre';
button.innerHTML = `<i class=\"lnr \${iconClass} me-1\"></i><span class=\"follow-text\">\${textContent}</span>`;
// Mettre à jour le compteur
const followersCounter = document.querySelector(`.followers-count[data-shop-id=\"\${shopId}\"]`);
if (followersCounter && typeof data.followersCount !== 'undefined') {
followersCounter.textContent = data.followersCount;
}
if (data.message) {
console.log(data.message);
}
button.disabled = false;
} else {
alert(data.message || 'Impossible de mettre à jour le suivi.');
button.innerHTML = originalHtml;
button.disabled = false;
}
})
.catch(error => {
console.error('Erreur suivi boutique:', error);
alert('Erreur lors de la mise à jour du suivi.');
button.innerHTML = originalHtml;
button.disabled = false;
});
}
function loadMoreShops() {
if (isLoading || currentPage >= totalPages) return;
isLoading = true;
const btn = document.getElementById('loadMoreBtn');
const originalText = btn.innerHTML;
btn.disabled = true;
btn.innerHTML = '<span class=\"spinner-border spinner-border-sm me-2\"></span>Chargement...';
currentPage++;
const url = new URL(window.location.href);
url.searchParams.set('page', currentPage);
fetch(url.toString(), {
headers: {
'X-Requested-With': 'XMLHttpRequest'
}
})
.then(response => response.json())
.then(data => {
if (data.success && data.shops.length > 0) {
const container = document.getElementById('shopsContainer');
data.shops.forEach(shop => {
const shopHtml = createShopCard(shop);
container.insertAdjacentHTML('beforeend', shopHtml);
});
// Mettre à jour le bouton
if (!data.hasMore) {
document.getElementById('loadMoreContainer').style.display = 'none';
} else {
btn.disabled = false;
btn.innerHTML = originalText;
}
} else {
document.getElementById('loadMoreContainer').style.display = 'none';
}
isLoading = false;
})
.catch(error => {
console.error('Erreur:', error);
btn.disabled = false;
btn.innerHTML = originalText;
isLoading = false;
});
}
function createShopCard(shop) {
const logoUrl = shop.logo ? '/' + shop.logo : '";
// line 513
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("ui/img/shop/default-shop.jpg"), "html", null, true);
yield "';
const verifiedBadge = shop.isVerified ?
'<div class=\"verified-badge\"><i class=\"lnr lnr-checkmark-circle\"></i></div>' : '';
const category = shop.category ?
`<span class=\"shop-category\">\${shop.category}</span>` : '';
return `
<div class=\"mt-4 col-lg-4 col-md-6 shop-item\" data-shop-id=\"\${shop.id}\">
<div class=\"single-shop h-100\">
<div class=\"shop-image\">
<a href=\"/shop/\${shop.slug}\">
<img class=\"img-fluid\" src=\"\${logoUrl}\" alt=\"\${shop.name}\">
</a>
\${verifiedBadge}
</div>
<div class=\"shop-details\">
<div class=\"shop-header\">
<h6 class=\"shop-name\">
<a href=\"/shop/\${shop.slug}\">\${shop.name}</a>
</h6>
\${category}
</div>
<div class=\"shop-stats\">
<div class=\"stat-item\">
<span class=\"stat-value\">\${shop.productsCount || 0}</span>
<span class=\"stat-label\">Produits</span>
</div>
<div class=\"stat-item\">
<span class=\"stat-value\">\${shop.followersCount || 0}</span>
<span class=\"stat-label\">Suiveurs</span>
</div>
<div class=\"stat-item\">
<span class=\"stat-value\">\${shop.viewCount || 0}</span>
<span class=\"stat-label\">Vues</span>
</div>
</div>
<div class=\"shop-description\">
<p>\${(shop.description || '').substring(0, 100)}\${(shop.description || '').length > 100 ? '...' : ''}</p>
</div>
<div class=\"shop-actions\">
<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;\">
<i class=\"lnr lnr-eye me-1\"></i> Voir
</a>
";
// line 556
if ((($tmp = CoreExtension::getAttribute($this->env, $this->source, ($context["app"] ?? null), "user", [], "any", false, false, false, 556)) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
// line 557
yield " <button class=\"btn btn-sm follow-btn \${shop.following ? 'btn-outline-danger' : 'btn-outline-secondary'}\"
data-shop-id=\"\${shop.id}\"
data-following=\"\${shop.following ? 'true' : 'false'}\"
onclick=\"toggleFollow(\${shop.id}, this)\"
style=\"flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;\">
<i class=\"lnr \${shop.following ? 'lnr-cross' : 'lnr-plus'} me-1\"></i>
<span class=\"follow-text\">\${shop.following ? 'Ne plus suivre' : 'Suivre'}</span>
</button>
";
}
// line 566
yield " </div>
</div>
</div>
</div>
`;
}
</script>
";
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
yield from [];
}
/**
* @codeCoverageIgnore
*/
public function getTemplateName(): string
{
return "home/shops_list.html.twig";
}
/**
* @codeCoverageIgnore
*/
public function isTraitable(): bool
{
return false;
}
/**
* @codeCoverageIgnore
*/
public function getDebugInfo(): array
{
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,);
}
public function getSourceContext(): Source
{
return new Source("{% extends 'base_home.html.twig' %}
{% block title %}Boutiques | MaketOu{% endblock %}
{% block body %}
<!-- Start Banner Area -->
{% if selectedCategory and selectedCategory.bannerImage %}
<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;\">
<div class=\"banner-overlay\" style=\"position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.3);\"></div>
<div class=\"container\" style=\"position: relative; z-index: 1;\">
<div class=\"breadcrumb-banner d-flex flex-wrap align-items-center justify-content-end\">
<div class=\"col-first text-white\">
<h1 style=\"color: white; text-shadow: 2px 2px 4px rgba(0,0,0,0.5);\">{{ selectedCategory.name }}</h1>
<nav class=\"d-flex align-items-center\">
<a href=\"{{ path('ui_home') }}\" style=\"color: white;\">Accueil<span class=\"lnr lnr-arrow-right\"></span></a>
<a href=\"{{ path('ui_shops_list') }}\" style=\"color: white;\">Boutiques<span class=\"lnr lnr-arrow-right\"></span></a>
<a href=\"javascript:void(0);\" style=\"color: white;\">{{ selectedCategory.name }}</a>
</nav>
</div>
</div>
</div>
</section>
{% else %}
<section class=\"banner-area organic-breadcrumb\">
<div class=\"container\">
<div class=\"breadcrumb-banner d-flex flex-wrap align-items-center justify-content-end\">
<div class=\"col-first\">
<h1>{% if selectedCategory %}{{ selectedCategory.name }}{% else %}Boutiques{% endif %}</h1>
<nav class=\"d-flex align-items-center\">
<a href=\"{{ path('ui_home') }}\">Accueil<span class=\"lnr lnr-arrow-right\"></span></a>
<a href=\"javascript:void(0);\">Boutiques</a>
</nav>
</div>
</div>
</div>
</section>
{% endif %}
<!-- End Banner Area -->
<div class=\"container mt-4 mb-4\">
<div class=\"row\">
<div class=\"col-xl-3 col-lg-4 col-md-5\">
<!-- Filtres des boutiques -->
<div class=\"sidebar-categories\">
<div class=\"head\">Catégories de boutiques</div>
<ul class=\"main-categories\">
{% for category in shopCategories %}
<li class=\"main-nav-list\">
<a href=\"{{ path('ui_shops_list', {'category': category.slug}) }}\"
class=\"category-link {% if app.request.query.get('category') == category.slug %}active{% endif %}\">
<i class=\"lnr lnr-store\"></i>
{{ category.name }}
<span class=\"number\">({{ category.shops|length }})</span>
</a>
</li>
{% endfor %}
</ul>
</div>
<!-- Statistiques modernes inline -->
<div class=\"sidebar-filter mt-4\">
<div class=\"top-filter-head\">Statistiques</div>
<div class=\"modern-stats\">
<div class=\"stat-item-inline mt-3\">
<i class=\"lnr lnr-store\"></i>
<div>
<div class=\"stat-value\">{{ total_shops|default(0) }}</div>
<div class=\"stat-label\">Total</div>
</div>
</div>
<div class=\"stat-item-inline\">
<i class=\"lnr lnr-star\"></i>
<div>
<div class=\"stat-value\">{{ shops|filter(shop => shop.isActive)|length }}</div>
<div class=\"stat-label\">Actives</div>
</div>
</div>
<div class=\"stat-item-inline\">
<i class=\"lnr lnr-checkmark-circle\"></i>
<div>
<div class=\"stat-value\">{{ shops|filter(shop => shop.isVerified)|length }}</div>
<div class=\"stat-label\">Vérifiées</div>
</div>
</div>
</div>
</div>
</div>
<div class=\"col-xl-9 col-lg-8 col-md-7\">
<!-- Liste des boutiques -->
<div class=\"row\" id=\"shopsContainer\">
{% for shop in shops|slice(0, 9) %}
<div class=\"mt-4 col-lg-4 col-md-6 shop-item\" data-shop-id=\"{{ shop.id }}\">
<div class=\"single-shop h-100\">
<div class=\"shop-image\">
<a href=\"{{ path('ui_shop_show', {'slug': shop.slug}) }}\">
{% if shop.logo %}
<img class=\"img-fluid\" src=\"{{ asset(shop.logo) }}\" alt=\"{{ shop.name }}\">
{% else %}
<img class=\"img-fluid\" src=\"{{ asset('ui/img/shop/default-shop.jpg') }}\" alt=\"{{ shop.name }}\">
{% endif %}
</a>
{% if shop.isVerified %}
<div class=\"verified-badge\">
<i class=\"lnr lnr-checkmark-circle\"></i>
</div>
{% endif %}
</div>
<div class=\"shop-details\">
<div class=\"shop-header\">
<h6 class=\"shop-name\">
<a href=\"{{ path('ui_shop_show', {'slug': shop.slug}) }}\">{{ shop.name }}</a>
</h6>
{% if shop.shopCategory %}
<span class=\"shop-category\">{{ shop.shopCategory.name }}</span>
{% endif %}
</div>
<div class=\"shop-stats\">
<div class=\"stat-item\">
<span class=\"stat-value\">{{ shop.getActiveProductsCount() }}</span>
<span class=\"stat-label\">Produits</span>
</div>
<div class=\"stat-item\">
<span class=\"stat-value followers-count\" data-shop-id=\"{{ shop.id }}\">{{ shop.getActiveFollowersCount() }}</span>
<span class=\"stat-label\">Suiveurs</span>
</div>
<div class=\"stat-item\">
<span class=\"stat-value\">{{ shop.viewCount }}</span>
<span class=\"stat-label\">Vues</span>
</div>
</div>
<div class=\"shop-description\">
<p>{{ shop.description|striptags|length > 100 ? shop.description|striptags|slice(0, 100) ~ '...' : shop.description|striptags }}</p>
</div>
<div class=\"shop-actions\">
<a href=\"{{ path('ui_shop_show', {'slug': shop.slug}) }}\" class=\"btn btn-primary btn-sm\">
<i class=\"lnr lnr-eye me-1\"></i> Voir
</a>
{% if app.user %}
{% set followed_shop_ids = followed_shop_ids|default([]) %}
{% set is_following = shop.id in followed_shop_ids %}
<button class=\"btn btn-sm follow-btn {{ is_following ? 'btn-outline-danger' : 'btn-outline-secondary' }}\"
data-shop-id=\"{{ shop.id }}\"
data-following=\"{{ is_following ? 'true' : 'false' }}\"
onclick=\"toggleFollow({{ shop.id }}, this)\">
<i class=\"lnr {{ is_following ? 'lnr-cross' : 'lnr-plus' }} me-1\"></i>
<span class=\"follow-text\">
{{ is_following ? 'Ne plus suivre' : 'Suivre' }}
</span>
</button>
{% endif %}
</div>
</div>
</div>
</div>
{% endfor %}
</div>
<!-- Bouton Voir plus -->
{% if shops|length > 9 or current_page < total_pages %}
<div class=\"text-center mt-4 mb-4\" id=\"loadMoreContainer\">
<button class=\"btn btn-primary btn-lg\" id=\"loadMoreBtn\" onclick=\"loadMoreShops()\">
<i class=\"lnr lnr-plus-circle me-2\"></i>Voir plus de boutiques
</button>
</div>
{% endif %}
<!-- Message si aucune boutique -->
{% if shops|length == 0 %}
<div class=\"text-center py-5\">
<i class=\"lnr lnr-store\" style=\"font-size: 4rem; color: #ccc;\"></i>
<h4 class=\"mt-3\">Aucune boutique trouvée</h4>
<p class=\"text-muted\">Aucune boutique ne correspond à vos critères de recherche.</p>
</div>
{% endif %}
</div>
</div>
</div>
{% endblock %}
{% block stylesheets %}
<style>
.single-shop {
background: white;
border-radius: 12px;
padding: 20px;
margin-bottom: 30px;
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
transition: all 0.3s ease;
display: flex;
flex-direction: column;
height: 100%;
overflow: hidden; /* Empêcher le débordement */
}
.single-shop:hover {
transform: translateY(-5px);
box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}
.shop-image {
position: relative;
margin-bottom: 15px;
}
.shop-image img {
width: 100%;
height: 200px;
object-fit: cover;
border-radius: 8px;
}
.verified-badge {
position: absolute;
top: 10px;
right: 10px;
background: #28a745;
color: white;
padding: 5px 8px;
border-radius: 12px;
font-size: 0.8rem;
}
.shop-header {
margin-bottom: 15px;
}
.shop-name {
margin: 0 0 5px 0;
font-size: 1.1rem;
font-weight: 600;
}
.shop-name a {
color: #333;
text-decoration: none;
}
.shop-name a:hover {
color: #007bff;
}
.shop-category {
background: #f8f9fa;
color: #666;
padding: 2px 8px;
border-radius: 12px;
font-size: 0.8rem;
}
.shop-stats {
display: flex;
justify-content: space-around;
margin: 15px 0;
padding: 15px 0;
border-top: 1px solid #f0f0f0;
border-bottom: 1px solid #f0f0f0;
}
.stat-item {
text-align: center;
}
.stat-value {
display: block;
font-size: 1.2rem;
font-weight: 600;
color: #333;
}
.stat-label {
font-size: 0.8rem;
color: #666;
text-transform: uppercase;
letter-spacing: 0.5px;
}
.shop-description {
margin: 15px 0;
color: #666;
font-size: 0.9rem;
line-height: 1.4;
}
.shop-actions {
display: flex;
gap: 8px;
margin-top: auto;
padding-top: 15px;
flex-wrap: wrap;
}
.shop-actions .btn {
flex: 1 1 auto;
min-width: 0;
font-size: 0.85rem;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
padding: 8px 12px;
}
.shop-actions .btn i {
margin-right: 4px;
flex-shrink: 0;
}
/* Assurer que shop-details utilise flexbox pour garder les boutons en bas */
.shop-details {
display: flex;
flex-direction: column;
flex: 1;
min-height: 0; /* Important pour le flexbox */
}
/* Statistiques modernes inline */
.modern-stats {
display: flex;
flex-direction: column;
gap: 15px;
}
.stat-item-inline {
display: flex;
align-items: center;
gap: 15px;
padding: 15px;
background: #f8f9fa;
border-radius: 10px;
transition: all 0.3s ease;
}
.stat-item-inline:hover {
background: #e9ecef;
transform: translateX(5px);
}
.stat-item-inline i {
font-size: 1.5rem;
color: #007bff;
width: 40px;
text-align: center;
}
.stat-item-inline .stat-value {
font-size: 1.5rem;
font-weight: 700;
color: #333;
line-height: 1;
}
.stat-item-inline .stat-label {
font-size: 0.85rem;
color: #666;
text-transform: uppercase;
letter-spacing: 0.5px;
margin-top: 5px;
}
.stat-number {
font-size: 1.5rem;
font-weight: 700;
color: #007bff;
margin-top: 5px;
}
@media (max-width: 768px) {
.single-shop {
padding: 15px;
}
.shop-stats {
flex-direction: column;
gap: 10px;
}
.shop-actions {
flex-direction: column;
}
}
</style>
{% endblock %}
{% block javascripts %}
<script>
let currentPage = {{ current_page }};
let totalPages = {{ total_pages }};
let isLoading = false;
function sortShops(sortValue) {
console.log('Tri des boutiques:', sortValue);
// TODO: Implémenter le tri AJAX
}
function toggleFollow(shopId, button) {
if (!button) {
button = document.querySelector(`.follow-btn[data-shop-id=\"\${shopId}\"]`);
if (!button) return;
}
const isFollowing = button.getAttribute('data-following') === 'true';
const originalHtml = button.innerHTML;
button.disabled = true;
button.innerHTML = '<span class=\"spinner-border spinner-border-sm\"></span>';
fetch(`{{ path('ui_api_shop_toggle_follow', {'id': 'SHOP_ID'}) }}`.replace('SHOP_ID', shopId), {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-Requested-With': 'XMLHttpRequest'
},
body: JSON.stringify({ action: isFollowing ? 'unfollow' : 'follow' })
})
.then(response => response.json())
.then(data => {
if (data.success) {
// Mettre à jour l'état du bouton
const isFollowing = data.isFollowing === true;
button.setAttribute('data-following', isFollowing ? 'true' : 'false');
// Mettre à jour les classes CSS
button.classList.remove('btn-outline-secondary', 'btn-outline-danger');
if (isFollowing) {
button.classList.add('btn-outline-danger');
} else {
button.classList.add('btn-outline-secondary');
}
// Reconstruire le HTML complet du bouton
const iconClass = isFollowing ? 'lnr-cross' : 'lnr-plus';
const textContent = isFollowing ? 'Ne plus suivre' : 'Suivre';
button.innerHTML = `<i class=\"lnr \${iconClass} me-1\"></i><span class=\"follow-text\">\${textContent}</span>`;
// Mettre à jour le compteur
const followersCounter = document.querySelector(`.followers-count[data-shop-id=\"\${shopId}\"]`);
if (followersCounter && typeof data.followersCount !== 'undefined') {
followersCounter.textContent = data.followersCount;
}
if (data.message) {
console.log(data.message);
}
button.disabled = false;
} else {
alert(data.message || 'Impossible de mettre à jour le suivi.');
button.innerHTML = originalHtml;
button.disabled = false;
}
})
.catch(error => {
console.error('Erreur suivi boutique:', error);
alert('Erreur lors de la mise à jour du suivi.');
button.innerHTML = originalHtml;
button.disabled = false;
});
}
function loadMoreShops() {
if (isLoading || currentPage >= totalPages) return;
isLoading = true;
const btn = document.getElementById('loadMoreBtn');
const originalText = btn.innerHTML;
btn.disabled = true;
btn.innerHTML = '<span class=\"spinner-border spinner-border-sm me-2\"></span>Chargement...';
currentPage++;
const url = new URL(window.location.href);
url.searchParams.set('page', currentPage);
fetch(url.toString(), {
headers: {
'X-Requested-With': 'XMLHttpRequest'
}
})
.then(response => response.json())
.then(data => {
if (data.success && data.shops.length > 0) {
const container = document.getElementById('shopsContainer');
data.shops.forEach(shop => {
const shopHtml = createShopCard(shop);
container.insertAdjacentHTML('beforeend', shopHtml);
});
// Mettre à jour le bouton
if (!data.hasMore) {
document.getElementById('loadMoreContainer').style.display = 'none';
} else {
btn.disabled = false;
btn.innerHTML = originalText;
}
} else {
document.getElementById('loadMoreContainer').style.display = 'none';
}
isLoading = false;
})
.catch(error => {
console.error('Erreur:', error);
btn.disabled = false;
btn.innerHTML = originalText;
isLoading = false;
});
}
function createShopCard(shop) {
const logoUrl = shop.logo ? '/' + shop.logo : '{{ asset(\"ui/img/shop/default-shop.jpg\") }}';
const verifiedBadge = shop.isVerified ?
'<div class=\"verified-badge\"><i class=\"lnr lnr-checkmark-circle\"></i></div>' : '';
const category = shop.category ?
`<span class=\"shop-category\">\${shop.category}</span>` : '';
return `
<div class=\"mt-4 col-lg-4 col-md-6 shop-item\" data-shop-id=\"\${shop.id}\">
<div class=\"single-shop h-100\">
<div class=\"shop-image\">
<a href=\"/shop/\${shop.slug}\">
<img class=\"img-fluid\" src=\"\${logoUrl}\" alt=\"\${shop.name}\">
</a>
\${verifiedBadge}
</div>
<div class=\"shop-details\">
<div class=\"shop-header\">
<h6 class=\"shop-name\">
<a href=\"/shop/\${shop.slug}\">\${shop.name}</a>
</h6>
\${category}
</div>
<div class=\"shop-stats\">
<div class=\"stat-item\">
<span class=\"stat-value\">\${shop.productsCount || 0}</span>
<span class=\"stat-label\">Produits</span>
</div>
<div class=\"stat-item\">
<span class=\"stat-value\">\${shop.followersCount || 0}</span>
<span class=\"stat-label\">Suiveurs</span>
</div>
<div class=\"stat-item\">
<span class=\"stat-value\">\${shop.viewCount || 0}</span>
<span class=\"stat-label\">Vues</span>
</div>
</div>
<div class=\"shop-description\">
<p>\${(shop.description || '').substring(0, 100)}\${(shop.description || '').length > 100 ? '...' : ''}</p>
</div>
<div class=\"shop-actions\">
<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;\">
<i class=\"lnr lnr-eye me-1\"></i> Voir
</a>
{% if app.user %}
<button class=\"btn btn-sm follow-btn \${shop.following ? 'btn-outline-danger' : 'btn-outline-secondary'}\"
data-shop-id=\"\${shop.id}\"
data-following=\"\${shop.following ? 'true' : 'false'}\"
onclick=\"toggleFollow(\${shop.id}, this)\"
style=\"flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;\">
<i class=\"lnr \${shop.following ? 'lnr-cross' : 'lnr-plus'} me-1\"></i>
<span class=\"follow-text\">\${shop.following ? 'Ne plus suivre' : 'Suivre'}</span>
</button>
{% endif %}
</div>
</div>
</div>
</div>
`;
}
</script>
{% endblock %}
", "home/shops_list.html.twig", "/home/u540977899/domains/maketou-ht.com/public_html/templates/home/shops_list.html.twig");
}
}