var/cache/dev/twig/26/262276b04fca4e2d658ad915b8d9fcda.php line 50

  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. /* question/show.html.twig */
  15. class __TwigTemplate_a689e2d8ed2cb7708cbb937605be9c9a extends Template
  16. {
  17.     private $source;
  18.     private $macros = [];
  19.     public function __construct(Environment $env)
  20.     {
  21.         parent::__construct($env);
  22.         $this->source $this->getSourceContext();
  23.         $this->blocks = [
  24.             'title' => [$this'block_title'],
  25.             'body' => [$this'block_body'],
  26.         ];
  27.     }
  28.     protected function doGetParent(array $context)
  29.     {
  30.         // line 1
  31.         return "base.html.twig";
  32.     }
  33.     protected function doDisplay(array $context, array $blocks = [])
  34.     {
  35.         $macros $this->macros;
  36.         $__internal_5a27a8ba21ca79b61932376b2fa922d2 $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  37.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template""question/show.html.twig"));
  38.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  39.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template""question/show.html.twig"));
  40.         $this->parent $this->loadTemplate("base.html.twig""question/show.html.twig"1);
  41.         yield from $this->parent->unwrap()->yield($contextarray_merge($this->blocks$blocks));
  42.         
  43.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  44.         
  45.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  46.     }
  47.     // line 3
  48.     public function block_title($context, array $blocks = [])
  49.     {
  50.         $macros $this->macros;
  51.         $__internal_5a27a8ba21ca79b61932376b2fa922d2 $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  52.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""title"));
  53.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  54.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""title"));
  55.         yield "Question: ";
  56.         yield Twig\Extension\EscaperExtension::escape($this->envCoreExtension::getAttribute($this->env$this->source, (isset($context["question"]) || array_key_exists("question"$context) ? $context["question"] : (function () { throw new RuntimeError('Variable "question" does not exist.'3$this->source); })()), "name", [], "any"falsefalsefalse3), "html"nulltrue);
  57.         
  58.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  59.         
  60.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  61.         return; yield '';
  62.     }
  63.     // line 5
  64.     public function block_body($context, array $blocks = [])
  65.     {
  66.         $macros $this->macros;
  67.         $__internal_5a27a8ba21ca79b61932376b2fa922d2 $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  68.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""body"));
  69.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  70.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""body"));
  71.         // line 6
  72.         yield "    <div class=\"container\">
  73.         <div class=\"row\">
  74.             <div class=\"col-12\">
  75.                 <h2 class=\"my-4\">
  76.                     Topic:
  77.                     <a href=\"#link-to-topic\">";
  78.         // line 11
  79.         yield Twig\Extension\EscaperExtension::escape($this->envCoreExtension::getAttribute($this->env$this->sourceCoreExtension::getAttribute($this->env$this->source, (isset($context["question"]) || array_key_exists("question"$context) ? $context["question"] : (function () { throw new RuntimeError('Variable "question" does not exist.'11$this->source); })()), "topic", [], "any"falsefalsefalse11), "name", [], "any"falsefalsefalse11), "html"nulltrue);
  80.         yield "</a>
  81.                 </h2>
  82.                 <h2 class=\"my-4\">Question:</h2>
  83.                 <div style=\"box-shadow: 2px 3px 9px 4px rgba(0,0,0,0.04);\">
  84.                     <div class=\"q-container-show p-4\">
  85.                         <div class=\"row\">
  86.                             <div class=\"col-2 text-center\">
  87.                                 <img src=\"";
  88.         // line 18
  89.         yield Twig\Extension\EscaperExtension::escape($this->env$this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl(CoreExtension::getAttribute($this->env$this->sourceCoreExtension::getAttribute($this->env$this->source, (isset($context["question"]) || array_key_exists("question"$context) ? $context["question"] : (function () { throw new RuntimeError('Variable "question" does not exist.'18$this->source); })()), "askedBy", [], "any"falsefalsefalse18), "avatarUrl", [], "any"falsefalsefalse18)), "html"nulltrue);
  90.         yield "\" width=\"100\" height=\"100\" alt=\"Tisha avatar\">
  91.                                 <div class=\"mt-3\">
  92.                                     <small>
  93.                                         ";
  94.         // line 21
  95.         if (CoreExtension::getAttribute($this->env$this->source, (isset($context["question"]) || array_key_exists("question"$context) ? $context["question"] : (function () { throw new RuntimeError('Variable "question" does not exist.'21$this->source); })()), "isApproved", [], "any"falsefalsefalse21)) {
  96.             // line 22
  97.             yield "                                            Asked <br>
  98.                                             ";
  99.             // line 23
  100.             yield $this->extensions['Knp\Bundle\TimeBundle\Twig\Extension\TimeExtension']->diff(CoreExtension::getAttribute($this->env$this->source, (isset($context["question"]) || array_key_exists("question"$context) ? $context["question"] : (function () { throw new RuntimeError('Variable "question" does not exist.'23$this->source); })()), "createdAt", [], "any"falsefalsefalse23));
  101.             yield "
  102.                                         ";
  103.         } else {
  104.             // line 25
  105.             yield "                                            (unpublished)
  106.                                         ";
  107.         }
  108.         // line 27
  109.         yield "                                    </small>
  110.                                     <form action=\"";
  111.         // line 29
  112.         yield Twig\Extension\EscaperExtension::escape($this->env$this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("app_question_vote", ["slug" => CoreExtension::getAttribute($this->env$this->source, (isset($context["question"]) || array_key_exists("question"$context) ? $context["question"] : (function () { throw new RuntimeError('Variable "question" does not exist.'29$this->source); })()), "slug", [], "any"falsefalsefalse29)]), "html"nulltrue);
  113.         yield "\" method=\"POST\">
  114.                                         <div class=\"vote-arrows vote-arrows-alt flex-fill pt-2\" style=\"min-width: 90px;\">
  115.                                             <button class=\"vote-up btn btn-link\" name=\"direction\" value=\"up\"><i class=\"far fa-arrow-alt-circle-up\"></i></button>
  116.                                             <button class=\"vote-down btn btn-link\" name=\"direction\" value=\"down\"><i class=\"far fa-arrow-alt-circle-down\"></i></button>
  117.                                             <span>";
  118.         // line 33
  119.         yield Twig\Extension\EscaperExtension::escape($this->envCoreExtension::getAttribute($this->env$this->source, (isset($context["question"]) || array_key_exists("question"$context) ? $context["question"] : (function () { throw new RuntimeError('Variable "question" does not exist.'33$this->source); })()), "votesString", [], "any"falsefalsefalse33), "html"nulltrue);
  120.         yield "</span>
  121.                                         </div>
  122.                                     </form>
  123.                                 </div>
  124.                             </div>
  125.                             <div class=\"col\">
  126.                                 <div class=\"d-flex justify-content-between\">
  127.                                     <h1 class=\"q-title-show\">";
  128.         // line 40
  129.         yield Twig\Extension\EscaperExtension::escape($this->envCoreExtension::getAttribute($this->env$this->source, (isset($context["question"]) || array_key_exists("question"$context) ? $context["question"] : (function () { throw new RuntimeError('Variable "question" does not exist.'40$this->source); })()), "name", [], "any"falsefalsefalse40), "html"nulltrue);
  130.         yield "</h1>
  131.                                     ";
  132.         // line 42
  133.         if ($this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_ADMIN")) {
  134.             // line 43
  135.             yield "                                        <a class=\"text-white\" href=\"";
  136.             yield Twig\Extension\EscaperExtension::escape($this->envCoreExtension::getAttribute($this->env$this->sourceCoreExtension::getAttribute($this->env$this->sourceCoreExtension::getAttribute($this->env$this->source$this->extensions['EasyCorp\Bundle\EasyAdminBundle\Twig\EasyAdminTwigExtension']->getAdminUrlGenerator(), "setController", ["App\\Controller\\Admin\\QuestionCrudController"], "method"falsefalsefalse43), "setAction", ["edit"], "method"falsefalsefalse44), "setEntityId", ["question.id"], "method"falsefalsefalse45), "html"nulltrue);
  137.             // line 47
  138.             yield "\">
  139.                                             <span class=\"fa fa-edit\"></span>
  140.                                         </a>
  141.                                     ";
  142.         }
  143.         // line 51
  144.         yield "                                </div>
  145.                                 <div class=\"q-display p-3\">
  146.                                     <i class=\"fa fa-quote-left mr-3\"></i>
  147.                                     <p class=\"d-inline\">";
  148.         // line 54
  149.         yield $this->extensions['App\Twig\MarkdownExtension']->parseMarkdown(CoreExtension::getAttribute($this->env$this->source, (isset($context["question"]) || array_key_exists("question"$context) ? $context["question"] : (function () { throw new RuntimeError('Variable "question" does not exist.'54$this->source); })()), "question", [], "any"falsefalsefalse54));
  150.         yield "</p>
  151.                                     <p class=\"pt-4\"><strong>--";
  152.         // line 55
  153.         yield Twig\Extension\EscaperExtension::escape($this->envCoreExtension::getAttribute($this->env$this->sourceCoreExtension::getAttribute($this->env$this->source, (isset($context["question"]) || array_key_exists("question"$context) ? $context["question"] : (function () { throw new RuntimeError('Variable "question" does not exist.'55$this->source); })()), "askedBy", [], "any"falsefalsefalse55), "fullName", [], "any"falsefalsefalse55), "html"nulltrue);
  154.         yield "</strong></p>
  155.                                 </div>
  156.                             </div>
  157.                         </div>
  158.                     </div>
  159.                 </div>
  160.             </div>
  161.         </div>
  162.         <div class=\"d-flex justify-content-between my-4\">
  163.             <h2 class=\"\">Answers <span style=\"font-size:1.2rem;\">(";
  164.         // line 65
  165.         yield Twig\Extension\EscaperExtension::escape($this->envTwig\Extension\CoreExtension::lengthFilter($this->envCoreExtension::getAttribute($this->env$this->source, (isset($context["question"]) || array_key_exists("question"$context) ? $context["question"] : (function () { throw new RuntimeError('Variable "question" does not exist.'65$this->source); })()), "answers", [], "any"falsefalsefalse65)), "html"nulltrue);
  166.         yield ")</span></h2>
  167.             <button class=\"btn btn-sm btn-secondary\">Submit an Answer</button>
  168.         </div>
  169.         <ul class=\"list-unstyled\">
  170.             ";
  171.         // line 71
  172.         $context['_parent'] = $context;
  173.         $context['_seq'] = CoreExtension::ensureTraversable(CoreExtension::getAttribute($this->env$this->source, (isset($context["question"]) || array_key_exists("question"$context) ? $context["question"] : (function () { throw new RuntimeError('Variable "question" does not exist.'71$this->source); })()), "answers", [], "any"falsefalsefalse71));
  174.         $context['_iterated'] = false;
  175.         foreach ($context['_seq'] as $context["_key"] => $context["answer"]) {
  176.             // line 72
  177.             yield "                <li class=\"mb-4\">
  178.                     <div class=\"d-flex justify-content-center\">
  179.                         <div class=\"mr-2 pt-2\">
  180.                             <img src=\"";
  181.             // line 75
  182.             yield Twig\Extension\EscaperExtension::escape($this->env$this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl(CoreExtension::getAttribute($this->env$this->sourceCoreExtension::getAttribute($this->env$this->source$context["answer"], "answeredBy", [], "any"falsefalsefalse75), "avatarUrl", [], "any"falsefalsefalse75)), "html"nulltrue);
  183.             yield "\" width=\"50\" height=\"50\" alt=\"Tisha avatar\">
  184.                         </div>
  185.                         <div class=\"mr-3 pt-2\">
  186.                             ";
  187.             // line 78
  188.             yield $this->extensions['App\Twig\MarkdownExtension']->parseMarkdown(CoreExtension::getAttribute($this->env$this->source$context["answer"], "answer", [], "any"falsefalsefalse78));
  189.             yield "
  190.                             <p>-- ";
  191.             // line 79
  192.             yield Twig\Extension\EscaperExtension::escape($this->envCoreExtension::getAttribute($this->env$this->sourceCoreExtension::getAttribute($this->env$this->source$context["answer"], "answeredBy", [], "any"falsefalsefalse79), "fullName", [], "any"falsefalsefalse79), "html"nulltrue);
  193.             yield "</p>
  194.                         </div>
  195.                         <div class=\"vote-arrows flex-fill pt-2 js-vote-arrows\" style=\"min-width: 90px;\">
  196.                             <button class=\"vote-up btn btn-link\" name=\"direction\" value=\"up\"><i class=\"far fa-arrow-alt-circle-up\"></i></button>
  197.                             <button class=\"vote-down btn btn-link\" name=\"direction\" value=\"down\"><i class=\"far fa-arrow-alt-circle-down\"></i></button>
  198.                             <span>";
  199.             // line 84
  200.             yield Twig\Extension\EscaperExtension::escape($this->envCoreExtension::getAttribute($this->env$this->source$context["answer"], "votesString", [], "any"falsefalsefalse84), "html"nulltrue);
  201.             yield "</span>
  202.                         </div>
  203.                     </div>
  204.                 </li>
  205.             ";
  206.             $context['_iterated'] = true;
  207.         }
  208.         if (!$context['_iterated']) {
  209.             // line 89
  210.             yield "                <li class=\"mb-4\">
  211.                     <div class=\"d-flex justify-content-center\">
  212.                         Be the first to answer!
  213.                     </div>
  214.                 </li>
  215.             ";
  216.         }
  217.         $_parent $context['_parent'];
  218.         unset($context['_seq'], $context['_iterated'], $context['_key'], $context['answer'], $context['_parent'], $context['loop']);
  219.         $context array_intersect_key($context$_parent) + $_parent;
  220.         // line 95
  221.         yield "        </ul>
  222.     </div>
  223. ";
  224.         
  225.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  226.         
  227.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  228.         return; yield '';
  229.     }
  230.     /**
  231.      * @codeCoverageIgnore
  232.      */
  233.     public function getTemplateName()
  234.     {
  235.         return "question/show.html.twig";
  236.     }
  237.     /**
  238.      * @codeCoverageIgnore
  239.      */
  240.     public function isTraitable()
  241.     {
  242.         return false;
  243.     }
  244.     /**
  245.      * @codeCoverageIgnore
  246.      */
  247.     public function getDebugInfo()
  248.     {
  249.         return array (  245 => 95,  234 => 89,  224 => 84,  216 => 79,  212 => 78,  206 => 75,  201 => 72,  196 => 71,  187 => 65,  174 => 55,  170 => 54,  165 => 51,  159 => 47,  156 => 43,  154 => 42,  149 => 40,  139 => 33,  132 => 29,  128 => 27,  124 => 25,  119 => 23,  116 => 22,  114 => 21,  108 => 18,  98 => 11,  91 => 6,  81 => 5,  60 => 3,  37 => 1,);
  250.     }
  251.     public function getSourceContext()
  252.     {
  253.         return new Source("{% extends 'base.html.twig' %}
  254. {% block title %}Question: {{ question.name }}{% endblock %}
  255. {% block body %}
  256.     <div class=\"container\">
  257.         <div class=\"row\">
  258.             <div class=\"col-12\">
  259.                 <h2 class=\"my-4\">
  260.                     Topic:
  261.                     <a href=\"#link-to-topic\">{{ question.topic.name }}</a>
  262.                 </h2>
  263.                 <h2 class=\"my-4\">Question:</h2>
  264.                 <div style=\"box-shadow: 2px 3px 9px 4px rgba(0,0,0,0.04);\">
  265.                     <div class=\"q-container-show p-4\">
  266.                         <div class=\"row\">
  267.                             <div class=\"col-2 text-center\">
  268.                                 <img src=\"{{ asset(question.askedBy.avatarUrl) }}\" width=\"100\" height=\"100\" alt=\"Tisha avatar\">
  269.                                 <div class=\"mt-3\">
  270.                                     <small>
  271.                                         {% if question.isApproved %}
  272.                                             Asked <br>
  273.                                             {{ question.createdAt|ago }}
  274.                                         {% else %}
  275.                                             (unpublished)
  276.                                         {% endif %}
  277.                                     </small>
  278.                                     <form action=\"{{ path('app_question_vote', { slug: question.slug }) }}\" method=\"POST\">
  279.                                         <div class=\"vote-arrows vote-arrows-alt flex-fill pt-2\" style=\"min-width: 90px;\">
  280.                                             <button class=\"vote-up btn btn-link\" name=\"direction\" value=\"up\"><i class=\"far fa-arrow-alt-circle-up\"></i></button>
  281.                                             <button class=\"vote-down btn btn-link\" name=\"direction\" value=\"down\"><i class=\"far fa-arrow-alt-circle-down\"></i></button>
  282.                                             <span>{{ question.votesString }}</span>
  283.                                         </div>
  284.                                     </form>
  285.                                 </div>
  286.                             </div>
  287.                             <div class=\"col\">
  288.                                 <div class=\"d-flex justify-content-between\">
  289.                                     <h1 class=\"q-title-show\">{{ question.name }}</h1>
  290.                                     {% if is_granted('ROLE_ADMIN') %}
  291.                                         <a class=\"text-white\" href=\"{{ ea_url()
  292.                                             .setController('App\\\\Controller\\\\Admin\\\\QuestionCrudController')
  293.                                             .setAction('edit')
  294.                                             .setEntityId('question.id')
  295.                                         }}\">
  296.                                             <span class=\"fa fa-edit\"></span>
  297.                                         </a>
  298.                                     {% endif %}
  299.                                 </div>
  300.                                 <div class=\"q-display p-3\">
  301.                                     <i class=\"fa fa-quote-left mr-3\"></i>
  302.                                     <p class=\"d-inline\">{{ question.question|parse_markdown }}</p>
  303.                                     <p class=\"pt-4\"><strong>--{{ question.askedBy.fullName }}</strong></p>
  304.                                 </div>
  305.                             </div>
  306.                         </div>
  307.                     </div>
  308.                 </div>
  309.             </div>
  310.         </div>
  311.         <div class=\"d-flex justify-content-between my-4\">
  312.             <h2 class=\"\">Answers <span style=\"font-size:1.2rem;\">({{ question.answers|length }})</span></h2>
  313.             <button class=\"btn btn-sm btn-secondary\">Submit an Answer</button>
  314.         </div>
  315.         <ul class=\"list-unstyled\">
  316.             {% for answer in question.answers %}
  317.                 <li class=\"mb-4\">
  318.                     <div class=\"d-flex justify-content-center\">
  319.                         <div class=\"mr-2 pt-2\">
  320.                             <img src=\"{{ asset(answer.answeredBy.avatarUrl) }}\" width=\"50\" height=\"50\" alt=\"Tisha avatar\">
  321.                         </div>
  322.                         <div class=\"mr-3 pt-2\">
  323.                             {{ answer.answer|parse_markdown }}
  324.                             <p>-- {{ answer.answeredBy.fullName }}</p>
  325.                         </div>
  326.                         <div class=\"vote-arrows flex-fill pt-2 js-vote-arrows\" style=\"min-width: 90px;\">
  327.                             <button class=\"vote-up btn btn-link\" name=\"direction\" value=\"up\"><i class=\"far fa-arrow-alt-circle-up\"></i></button>
  328.                             <button class=\"vote-down btn btn-link\" name=\"direction\" value=\"down\"><i class=\"far fa-arrow-alt-circle-down\"></i></button>
  329.                             <span>{{ answer.votesString }}</span>
  330.                         </div>
  331.                     </div>
  332.                 </li>
  333.             {% else %}
  334.                 <li class=\"mb-4\">
  335.                     <div class=\"d-flex justify-content-center\">
  336.                         Be the first to answer!
  337.                     </div>
  338.                 </li>
  339.             {% endfor %}
  340.         </ul>
  341.     </div>
  342. {% endblock %}
  343. ""question/show.html.twig""/var/www/admin-apag/templates/question/show.html.twig");
  344.     }
  345. }