<?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;

/* fichier/choix_amis_partage.html.twig */
class __TwigTemplate_26e7c4e40c33a59314c99ae63baaf332 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'],
        ];
    }

    protected function doGetParent(array $context): bool|string|Template|TemplateWrapper
    {
        // line 1
        return "base.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", "fichier/choix_amis_partage.html.twig"));

        $__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
        $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "fichier/choix_amis_partage.html.twig"));

        $this->parent = $this->loadTemplate("base.html.twig", "fichier/choix_amis_partage.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"));

        // line 4
        yield "    ";
        yield from $this->yieldParentBlock("title", $context, $blocks);
        yield " Envoie fichier, choix ami
";
        
        $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);

        
        $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);

        yield from [];
    }

    // line 7
    /**
     * @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 8
        yield "    <div class=\"container-fluid\">
        <h1 class=\"text-center text-primary mt-4 pt-4 display-1 fw-bold\">
            A qui partager le fichier ?
        </h1>
        <div class=\"row justify-content-center\">
            <div class=\"col-12 col-md-8 bg-white p-4 m-0 text-primary\">
                <div class=\"table-responsive\">
                    <table class=\"table table-hover\">
                        <thead>
                            <tr class=\"fw-bold text-primary\">
                                <th scope=\"col\">Prénom</th>
                                <th scope=\"col\">Nom</th>
                                <th scope=\"col\"></th>
                                <th scope=\"col\"></th>
                            </tr>
                        </thead>
                        <tbody>
                            ";
        // line 25
        $context['_parent'] = $context;
        $context['_seq'] = CoreExtension::ensureTraversable(Twig\Extension\CoreExtension::sort($this->env, (isset($context["amis"]) || array_key_exists("amis", $context) ? $context["amis"] : (function () { throw new RuntimeError('Variable "amis" does not exist.', 25, $this->source); })()), function ($__a__, $__b__) use ($context, $macros) { $context["a"] = $__a__; $context["b"] = $__b__; return (CoreExtension::getAttribute($this->env, $this->source, (isset($context["b"]) || array_key_exists("b", $context) ? $context["b"] : (function () { throw new RuntimeError('Variable "b" does not exist.', 25, $this->source); })()), "name", [], "any", false, false, false, 25) <=> CoreExtension::getAttribute($this->env, $this->source, (isset($context["a"]) || array_key_exists("a", $context) ? $context["a"] : (function () { throw new RuntimeError('Variable "a" does not exist.', 25, $this->source); })()), "name", [], "any", false, false, false, 25)); }));
        $context['loop'] = [
          'parent' => $context['_parent'],
          'index0' => 0,
          'index'  => 1,
          'first'  => true,
        ];
        if (is_array($context['_seq']) || (is_object($context['_seq']) && $context['_seq'] instanceof \Countable)) {
            $length = count($context['_seq']);
            $context['loop']['revindex0'] = $length - 1;
            $context['loop']['revindex'] = $length;
            $context['loop']['length'] = $length;
            $context['loop']['last'] = 1 === $length;
        }
        foreach ($context['_seq'] as $context["_key"] => $context["ami"]) {
            // line 26
            yield "                                <tr class=\"";
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(Twig\Extension\CoreExtension::cycle(["table-primary", "table-secondary"], CoreExtension::getAttribute($this->env, $this->source, $context["loop"], "index0", [], "any", false, false, false, 26)), "html", null, true);
            yield "\">
                                    <td>";
            // line 27
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["ami"], "prenom", [], "any", false, false, false, 27), "html", null, true);
            yield "</td>
                                    <td>";
            // line 28
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(Twig\Extension\CoreExtension::upper($this->env->getCharset(), CoreExtension::getAttribute($this->env, $this->source, $context["ami"], "name", [], "any", false, false, false, 28)), "html", null, true);
            yield "</td>
                                    <td>
                                        ";
            // line 30
            if (CoreExtension::inFilter($context["ami"], CoreExtension::getAttribute($this->env, $this->source, (isset($context["fichier"]) || array_key_exists("fichier", $context) ? $context["fichier"] : (function () { throw new RuntimeError('Variable "fichier" does not exist.', 30, $this->source); })()), "getAccesAmis", [], "method", false, false, false, 30))) {
                // line 31
                yield "                                            <a href=\"";
                yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("app_retirer_acces_amis", ["fichierId" => (isset($context["fichierId"]) || array_key_exists("fichierId", $context) ? $context["fichierId"] : (function () { throw new RuntimeError('Variable "fichierId" does not exist.', 31, $this->source); })()), "friendId" => CoreExtension::getAttribute($this->env, $this->source, $context["ami"], "id", [], "any", false, false, false, 31)]), "html", null, true);
                yield "\">
                                                <button type=\"button\" class=\"btn btn-danger\">Retirer l'accès</button>
                                            </a>
                                        ";
            } else {
                // line 35
                yield "                                            <a href=\"";
                yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("app_partage_fichier", ["fichierId" => (isset($context["fichierId"]) || array_key_exists("fichierId", $context) ? $context["fichierId"] : (function () { throw new RuntimeError('Variable "fichierId" does not exist.', 35, $this->source); })()), "friendId" => CoreExtension::getAttribute($this->env, $this->source, $context["ami"], "id", [], "any", false, false, false, 35)]), "html", null, true);
                yield "\">
                                                <button type=\"button\" class=\"btn btn-dark\">Partager</button>
                                            </a>
                                        ";
            }
            // line 39
            yield "                                    </td>
                                </tr>
                            ";
            ++$context['loop']['index0'];
            ++$context['loop']['index'];
            $context['loop']['first'] = false;
            if (isset($context['loop']['revindex0'], $context['loop']['revindex'])) {
                --$context['loop']['revindex0'];
                --$context['loop']['revindex'];
                $context['loop']['last'] = 0 === $context['loop']['revindex0'];
            }
        }
        $_parent = $context['_parent'];
        unset($context['_seq'], $context['_key'], $context['ami'], $context['_parent'], $context['loop']);
        $context = array_intersect_key($context, $_parent) + $_parent;
        // line 42
        yield "                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
";
        
        $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);

        
        $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);

        yield from [];
    }

    /**
     * @codeCoverageIgnore
     */
    public function getTemplateName(): string
    {
        return "fichier/choix_amis_partage.html.twig";
    }

    /**
     * @codeCoverageIgnore
     */
    public function isTraitable(): bool
    {
        return false;
    }

    /**
     * @codeCoverageIgnore
     */
    public function getDebugInfo(): array
    {
        return array (  188 => 42,  172 => 39,  164 => 35,  156 => 31,  154 => 30,  149 => 28,  145 => 27,  140 => 26,  123 => 25,  104 => 8,  91 => 7,  77 => 4,  64 => 3,  41 => 1,);
    }

    public function getSourceContext(): Source
    {
        return new Source("{% extends 'base.html.twig' %}

{% block title %}
    {{ parent() }} Envoie fichier, choix ami
{% endblock %}

{% block body %}
    <div class=\"container-fluid\">
        <h1 class=\"text-center text-primary mt-4 pt-4 display-1 fw-bold\">
            A qui partager le fichier ?
        </h1>
        <div class=\"row justify-content-center\">
            <div class=\"col-12 col-md-8 bg-white p-4 m-0 text-primary\">
                <div class=\"table-responsive\">
                    <table class=\"table table-hover\">
                        <thead>
                            <tr class=\"fw-bold text-primary\">
                                <th scope=\"col\">Prénom</th>
                                <th scope=\"col\">Nom</th>
                                <th scope=\"col\"></th>
                                <th scope=\"col\"></th>
                            </tr>
                        </thead>
                        <tbody>
                            {% for ami in amis|sort((a, b) => b.name <=> a.name) %}
                                <tr class=\"{{ cycle(['table-primary', 'table-secondary'], loop.index0) }}\">
                                    <td>{{ ami.prenom }}</td>
                                    <td>{{ ami.name | upper }}</td>
                                    <td>
                                        {% if ami in fichier.getAccesAmis() %}
                                            <a href=\"{{ path('app_retirer_acces_amis', {'fichierId': fichierId, 'friendId': ami.id }) }}\">
                                                <button type=\"button\" class=\"btn btn-danger\">Retirer l'accès</button>
                                            </a>
                                        {% else %}
                                            <a href=\"{{ path('app_partage_fichier', {'fichierId': fichierId, 'friendId': ami.id }) }}\">
                                                <button type=\"button\" class=\"btn btn-dark\">Partager</button>
                                            </a>
                                        {% endif %}
                                    </td>
                                </tr>
                            {% endfor %}
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
{% endblock %}
", "fichier/choix_amis_partage.html.twig", "/var/www/html/equipe/share/templates/fichier/choix_amis_partage.html.twig");
    }
}
