<?php
use Twig\Environment;
use Twig\Error\LoaderError;
use Twig\Error\RuntimeError;
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;
/* question/show.html.twig */
class __TwigTemplate_66a2fca6fe6a351af2454b9ce806ed4c extends Template
{
private $source;
private $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)
{
// line 1
return "base.html.twig";
}
protected function doDisplay(array $context, array $blocks = [])
{
$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", "question/show.html.twig"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "question/show.html.twig"));
$this->parent = $this->loadTemplate("base.html.twig", "question/show.html.twig", 1);
$this->parent->display($context, array_merge($this->blocks, $blocks));
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
}
// line 3
public function block_title($context, array $blocks = [])
{
$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"));
echo "Question: ";
echo twig_escape_filter($this->env, twig_get_attribute($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", false, false, false, 3), "html", null, true);
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
}
// line 5
public function block_body($context, array $blocks = [])
{
$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
echo "<div class=\"container\">
<div class=\"row\">
<div class=\"col-12\">
<h2 class=\"my-4\">
Topic:
<a href=\"#link-to-topic\">";
// line 11
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, twig_get_attribute($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", false, false, false, 11), "name", [], "any", false, false, false, 11), "html", null, true);
echo "</a>
</h2>
<h2 class=\"my-4\">Question:</h2>
<div style=\"box-shadow: 2px 3px 9px 4px rgba(0,0,0,0.04);\">
<div class=\"q-container-show p-4\">
<div class=\"row\">
<div class=\"col-2 text-center\">
<img src=\"";
// line 18
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl(twig_get_attribute($this->env, $this->source, twig_get_attribute($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", false, false, false, 18), "avatarUrl", [], "any", false, false, false, 18)), "html", null, true);
echo "\" width=\"100\" height=\"100\" alt=\"Tisha avatar\">
<div class=\"mt-3\">
<small>
";
// line 21
if (twig_get_attribute($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", false, false, false, 21)) {
// line 22
echo " Asked <br>
";
// line 23
echo $this->extensions['Knp\Bundle\TimeBundle\Twig\Extension\TimeExtension']->diff(twig_get_attribute($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", false, false, false, 23));
echo "
";
} else {
// line 25
echo " (unpublished)
";
}
// line 27
echo " </small>
<form action=\"";
// line 29
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("app_question_vote", ["slug" => twig_get_attribute($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", false, false, false, 29)]), "html", null, true);
echo "\" method=\"POST\">
<div class=\"vote-arrows vote-arrows-alt flex-fill pt-2\" style=\"min-width: 90px;\">
<button class=\"vote-up btn btn-link\" name=\"direction\" value=\"up\"><i class=\"far fa-arrow-alt-circle-up\"></i></button>
<button class=\"vote-down btn btn-link\" name=\"direction\" value=\"down\"><i class=\"far fa-arrow-alt-circle-down\"></i></button>
<span>";
// line 33
echo twig_escape_filter($this->env, twig_get_attribute($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", false, false, false, 33), "html", null, true);
echo "</span>
</div>
</form>
</div>
</div>
<div class=\"col\">
<div class=\"col\">
<div class=\"d-flex justify-content-between\">
<h1 class=\"q-title-show\">";
// line 41
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, (isset($context["question"]) || array_key_exists("question", $context) ? $context["question"] : (function () { throw new RuntimeError('Variable "question" does not exist.', 41, $this->source); })()), "name", [], "any", false, false, false, 41), "html", null, true);
echo "</h1>
";
// line 42
if ($this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_ADMIN")) {
// line 43
echo " <a class=\"text-white\" href=\"";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, $this->extensions['EasyCorp\Bundle\EasyAdminBundle\Twig\EasyAdminTwigExtension']->getAdminUrlGenerator(), "setController", ["App\\Controller\\Admin\\QuestionCrudController"], "method", false, false, false, 43), "setAction", ["edit"], "method", false, false, false, 44), "setEntityId", [twig_get_attribute($this->env, $this->source, // line 46
(isset($context["question"]) || array_key_exists("question", $context) ? $context["question"] : (function () { throw new RuntimeError('Variable "question" does not exist.', 46, $this->source); })()), "id", [], "any", false, false, false, 46)], "method", false, false, false, 45), "html", null, true);
// line 47
echo "\">
<span class=\"fa fa-edit\"></span>
</a>
";
}
// line 51
echo " </div>
</div>
<div class=\"q-display p-3\">
<i class=\"fa fa-quote-left mr-3\"></i>
<p class=\"d-inline\">";
// line 55
echo twig_escape_filter($this->env, twig_get_attribute($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); })()), "question", [], "any", false, false, false, 55), "html", null, true);
echo "</p>
<p class=\"pt-4\"><strong>--";
// line 56
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["question"]) || array_key_exists("question", $context) ? $context["question"] : (function () { throw new RuntimeError('Variable "question" does not exist.', 56, $this->source); })()), "askedBy", [], "any", false, false, false, 56), "fullName", [], "any", false, false, false, 56), "html", null, true);
echo "</strong></p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class=\"d-flex justify-content-between my-4\">
<h2 class=\"\">Answers <span style=\"font-size:1.2rem;\">(";
// line 66
echo twig_escape_filter($this->env, twig_length_filter($this->env, twig_get_attribute($this->env, $this->source, (isset($context["question"]) || array_key_exists("question", $context) ? $context["question"] : (function () { throw new RuntimeError('Variable "question" does not exist.', 66, $this->source); })()), "answers", [], "any", false, false, false, 66)), "html", null, true);
echo ")</span></h2>
<button class=\"btn btn-sm btn-secondary\">Submit an Answer</button>
</div>
<ul class=\"list-unstyled\">
";
// line 73
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable(twig_get_attribute($this->env, $this->source, (isset($context["question"]) || array_key_exists("question", $context) ? $context["question"] : (function () { throw new RuntimeError('Variable "question" does not exist.', 73, $this->source); })()), "answers", [], "any", false, false, false, 73));
$context['_iterated'] = false;
foreach ($context['_seq'] as $context["_key"] => $context["answer"]) {
// line 74
echo " <li class=\"mb-4\">
<div class=\"d-flex justify-content-center\">
<div class=\"mr-2 pt-2\">
<img src=\"";
// line 77
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl(twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, $context["answer"], "answeredBy", [], "any", false, false, false, 77), "avatarUrl", [], "any", false, false, false, 77)), "html", null, true);
echo "\" width=\"50\" height=\"50\" alt=\"Tisha avatar\">
</div>
<div class=\"mr-3 pt-2\">
";
// line 80
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["answer"], "answer", [], "any", false, false, false, 80), "html", null, true);
echo "
<p>-- ";
// line 81
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, $context["answer"], "answeredBy", [], "any", false, false, false, 81), "fullName", [], "any", false, false, false, 81), "html", null, true);
echo "</p>
</div>
<div class=\"vote-arrows flex-fill pt-2 js-vote-arrows\" style=\"min-width: 90px;\">
<button class=\"vote-up btn btn-link\" name=\"direction\" value=\"up\"><i class=\"far fa-arrow-alt-circle-up\"></i></button>
<button class=\"vote-down btn btn-link\" name=\"direction\" value=\"down\"><i class=\"far fa-arrow-alt-circle-down\"></i></button>
<span>";
// line 86
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["answer"], "votesString", [], "any", false, false, false, 86), "html", null, true);
echo "</span>
</div>
</div>
</li>
";
$context['_iterated'] = true;
}
if (!$context['_iterated']) {
// line 91
echo " <li class=\"mb-4\">
<div class=\"d-flex justify-content-center\">
Be the first to answer!
</div>
</li>
";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['answer'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 97
echo " </ul>
</div>
";
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
}
/**
* @codeCoverageIgnore
*/
public function getTemplateName()
{
return "question/show.html.twig";
}
/**
* @codeCoverageIgnore
*/
public function isTraitable()
{
return false;
}
/**
* @codeCoverageIgnore
*/
public function getDebugInfo()
{
return array ( 246 => 97, 235 => 91, 225 => 86, 217 => 81, 213 => 80, 207 => 77, 202 => 74, 197 => 73, 187 => 66, 174 => 56, 170 => 55, 164 => 51, 158 => 47, 156 => 46, 154 => 43, 152 => 42, 148 => 41, 137 => 33, 130 => 29, 126 => 27, 122 => 25, 117 => 23, 114 => 22, 112 => 21, 106 => 18, 96 => 11, 89 => 6, 79 => 5, 59 => 3, 36 => 1,);
}
public function getSourceContext()
{
return new Source("{% extends 'base.html.twig' %}
{% block title %}Question: {{ question.name }}{% endblock %}
{% block body %}
<div class=\"container\">
<div class=\"row\">
<div class=\"col-12\">
<h2 class=\"my-4\">
Topic:
<a href=\"#link-to-topic\">{{ question.topic.name }}</a>
</h2>
<h2 class=\"my-4\">Question:</h2>
<div style=\"box-shadow: 2px 3px 9px 4px rgba(0,0,0,0.04);\">
<div class=\"q-container-show p-4\">
<div class=\"row\">
<div class=\"col-2 text-center\">
<img src=\"{{ asset(question.askedBy.avatarUrl) }}\" width=\"100\" height=\"100\" alt=\"Tisha avatar\">
<div class=\"mt-3\">
<small>
{% if question.isApproved %}
Asked <br>
{{ question.createdAt|ago }}
{% else %}
(unpublished)
{% endif %}
</small>
<form action=\"{{ path('app_question_vote', { slug: question.slug }) }}\" method=\"POST\">
<div class=\"vote-arrows vote-arrows-alt flex-fill pt-2\" style=\"min-width: 90px;\">
<button class=\"vote-up btn btn-link\" name=\"direction\" value=\"up\"><i class=\"far fa-arrow-alt-circle-up\"></i></button>
<button class=\"vote-down btn btn-link\" name=\"direction\" value=\"down\"><i class=\"far fa-arrow-alt-circle-down\"></i></button>
<span>{{ question.votesString }}</span>
</div>
</form>
</div>
</div>
<div class=\"col\">
<div class=\"col\">
<div class=\"d-flex justify-content-between\">
<h1 class=\"q-title-show\">{{ question.name }}</h1>
{% if is_granted('ROLE_ADMIN') %}
<a class=\"text-white\" href=\"{{ ea_url()
.setController('App\\\\Controller\\\\Admin\\\\QuestionCrudController')
.setAction('edit')
.setEntityId(question.id)
}}\">
<span class=\"fa fa-edit\"></span>
</a>
{% endif %}
</div>
</div>
<div class=\"q-display p-3\">
<i class=\"fa fa-quote-left mr-3\"></i>
<p class=\"d-inline\">{{ question.question }}</p>
<p class=\"pt-4\"><strong>--{{ question.askedBy.fullName }}</strong></p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class=\"d-flex justify-content-between my-4\">
<h2 class=\"\">Answers <span style=\"font-size:1.2rem;\">({{ question.answers|length }})</span></h2>
<button class=\"btn btn-sm btn-secondary\">Submit an Answer</button>
</div>
<ul class=\"list-unstyled\">
{% for answer in question.answers %}
<li class=\"mb-4\">
<div class=\"d-flex justify-content-center\">
<div class=\"mr-2 pt-2\">
<img src=\"{{ asset(answer.answeredBy.avatarUrl) }}\" width=\"50\" height=\"50\" alt=\"Tisha avatar\">
</div>
<div class=\"mr-3 pt-2\">
{{ answer.answer }}
<p>-- {{ answer.answeredBy.fullName }}</p>
</div>
<div class=\"vote-arrows flex-fill pt-2 js-vote-arrows\" style=\"min-width: 90px;\">
<button class=\"vote-up btn btn-link\" name=\"direction\" value=\"up\"><i class=\"far fa-arrow-alt-circle-up\"></i></button>
<button class=\"vote-down btn btn-link\" name=\"direction\" value=\"down\"><i class=\"far fa-arrow-alt-circle-down\"></i></button>
<span>{{ answer.votesString }}</span>
</div>
</div>
</li>
{% else %}
<li class=\"mb-4\">
<div class=\"d-flex justify-content-center\">
Be the first to answer!
</div>
</li>
{% endfor %}
</ul>
</div>
{% endblock %}
", "question/show.html.twig", "/home/u538818725/domains/growupcrypto.site/public_html/templates/question/show.html.twig");
}
}