var/cache/dev/twig/fd/fd432deb61f60bf629f76bc731421b27408e0b6b87feacb58ad12286bd991617.php line 106

Open in your IDE?
  1. <?php
  2. use Twig\Environment;
  3. use Twig\Error\LoaderError;
  4. use Twig\Error\RuntimeError;
  5. use Twig\Extension\SandboxExtension;
  6. use Twig\Markup;
  7. use Twig\Sandbox\SecurityError;
  8. use Twig\Sandbox\SecurityNotAllowedTagError;
  9. use Twig\Sandbox\SecurityNotAllowedFilterError;
  10. use Twig\Sandbox\SecurityNotAllowedFunctionError;
  11. use Twig\Source;
  12. use Twig\Template;
  13. /* blog/post_show.html.twig */
  14. class __TwigTemplate_925da054963f57039d12834368ca1e6b964265eb25605cd076c177f436cb2408 extends Template
  15. {
  16.     private $source;
  17.     private $macros = [];
  18.     public function __construct(Environment $env)
  19.     {
  20.         parent::__construct($env);
  21.         $this->source $this->getSourceContext();
  22.         $this->blocks = [
  23.             'body_id' => [$this'block_body_id'],
  24.             'main' => [$this'block_main'],
  25.             'sidebar' => [$this'block_sidebar'],
  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_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  37.         $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->enter($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template""blog/post_show.html.twig"));
  38.         $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02 $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  39.         $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->enter($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template""blog/post_show.html.twig"));
  40.         $this->parent $this->loadTemplate("base.html.twig""blog/post_show.html.twig"1);
  41.         $this->parent->display($contextarray_merge($this->blocks$blocks));
  42.         
  43.         $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->leave($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof);
  44.         
  45.         $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);
  46.     }
  47.     // line 3
  48.     public function block_body_id($context, array $blocks = [])
  49.     {
  50.         $macros $this->macros;
  51.         $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  52.         $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->enter($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""body_id"));
  53.         $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02 $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  54.         $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->enter($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""body_id"));
  55.         echo "blog_post_show";
  56.         
  57.         $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);
  58.         
  59.         $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->leave($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof);
  60.     }
  61.     // line 5
  62.     public function block_main($context, array $blocks = [])
  63.     {
  64.         $macros $this->macros;
  65.         $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  66.         $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->enter($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""main"));
  67.         $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02 $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  68.         $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->enter($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""main"));
  69.         // line 6
  70.         echo "    <h1>";
  71.         echo twig_escape_filter($this->envtwig_get_attribute($this->env$this->source, (isset($context["post"]) || array_key_exists("post"$context) ? $context["post"] : (function () { throw new RuntimeError('Variable "post" does not exist.'6$this->source); })()), "title", [], "any"falsefalsefalse6), "html"nulltrue);
  72.         echo "</h1>
  73.     <p class=\"post-metadata\">
  74.         <span class=\"metadata\"><i class=\"fa fa-calendar\"></i> ";
  75.         // line 9
  76.         echo twig_escape_filter($this->env$this->extensions['Twig\Extra\Intl\IntlExtension']->formatDateTime($this->envtwig_get_attribute($this->env$this->source, (isset($context["post"]) || array_key_exists("post"$context) ? $context["post"] : (function () { throw new RuntimeError('Variable "post" does not exist.'9$this->source); })()), "publishedAt", [], "any"falsefalsefalse9), "long""medium""""UTC"), "html"nulltrue);
  77.         echo "</span>
  78.         <span class=\"metadata\"><i class=\"fa fa-user\"></i> ";
  79.         // line 10
  80.         echo twig_escape_filter($this->envtwig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source, (isset($context["post"]) || array_key_exists("post"$context) ? $context["post"] : (function () { throw new RuntimeError('Variable "post" does not exist.'10$this->source); })()), "author", [], "any"falsefalsefalse10), "fullName", [], "any"falsefalsefalse10), "html"nulltrue);
  81.         echo "</span>
  82.     </p>
  83.     ";
  84.         // line 13
  85.         echo $this->extensions['HtmlSanitizer\Bundle\Twig\TwigExtension']->sanitize($this->env->getRuntime('Twig\Extra\Markdown\MarkdownRuntime')->convert(twig_get_attribute($this->env$this->source, (isset($context["post"]) || array_key_exists("post"$context) ? $context["post"] : (function () { throw new RuntimeError('Variable "post" does not exist.'13$this->source); })()), "content", [], "any"falsefalsefalse13)));
  86.         echo "
  87.     ";
  88.         // line 15
  89.         echo twig_include($this->env$context"blog/_post_tags.html.twig");
  90.         echo "
  91.     <div id=\"post-add-comment\" class=\"well\">
  92.         ";
  93.         // line 24
  94.         echo "        ";
  95.         if ($this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("IS_AUTHENTICATED_FULLY")) {
  96.             // line 25
  97.             echo "            ";
  98.             echo $this->env->getRuntime('Symfony\Bridge\Twig\Extension\HttpKernelRuntime')->renderFragment(Symfony\Bridge\Twig\Extension\HttpKernelExtension::controller("App\\Controller\\BlogController::commentForm", ["id" => twig_get_attribute($this->env$this->source, (isset($context["post"]) || array_key_exists("post"$context) ? $context["post"] : (function () { throw new RuntimeError('Variable "post" does not exist.'25$this->source); })()), "id", [], "any"falsefalsefalse25)]));
  99.             echo "
  100.         ";
  101.         } else {
  102.             // line 27
  103.             echo "            <p>
  104.                 <a class=\"btn btn-success\" href=\"";
  105.             // line 28
  106.             echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("security_login", ["redirect_to" => twig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source, (isset($context["app"]) || array_key_exists("app"$context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.'28$this->source); })()), "request", [], "any"falsefalsefalse28), "pathInfo", [], "any"falsefalsefalse28)]), "html"nulltrue);
  107.             echo "\">
  108.                     <i class=\"fa fa-sign-in\" aria-hidden=\"true\"></i> ";
  109.             // line 29
  110.             echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("action.sign_in"), "html"nulltrue);
  111.             echo "
  112.                 </a>
  113.                 ";
  114.             // line 31
  115.             echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("post.to_publish_a_comment"), "html"nulltrue);
  116.             echo "
  117.             </p>
  118.         ";
  119.         }
  120.         // line 34
  121.         echo "    </div>
  122.     <h3>
  123.         <i class=\"fa fa-comments\" aria-hidden=\"true\"></i> ";
  124.         // line 37
  125.         echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("post.num_comments", ["count" => twig_length_filter($this->envtwig_get_attribute($this->env$this->source, (isset($context["post"]) || array_key_exists("post"$context) ? $context["post"] : (function () { throw new RuntimeError('Variable "post" does not exist.'37$this->source); })()), "comments", [], "any"falsefalsefalse37))]), "html"nulltrue);
  126.         echo "
  127.     </h3>
  128.     ";
  129.         // line 40
  130.         $context['_parent'] = $context;
  131.         $context['_seq'] = twig_ensure_traversable(twig_get_attribute($this->env$this->source, (isset($context["post"]) || array_key_exists("post"$context) ? $context["post"] : (function () { throw new RuntimeError('Variable "post" does not exist.'40$this->source); })()), "comments", [], "any"falsefalsefalse40));
  132.         $context['_iterated'] = false;
  133.         foreach ($context['_seq'] as $context["_key"] => $context["comment"]) {
  134.             // line 41
  135.             echo "        <div class=\"row post-comment\">
  136.             <a name=\"comment_";
  137.             // line 42
  138.             echo twig_escape_filter($this->envtwig_get_attribute($this->env$this->source$context["comment"], "id", [], "any"falsefalsefalse42), "html"nulltrue);
  139.             echo "\"></a>
  140.             <h4 class=\"col-sm-3\">
  141.                 <strong>";
  142.             // line 44
  143.             echo twig_escape_filter($this->envtwig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source$context["comment"], "author", [], "any"falsefalsefalse44), "fullName", [], "any"falsefalsefalse44), "html"nulltrue);
  144.             echo "</strong> ";
  145.             echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("post.commented_on"), "html"nulltrue);
  146.             echo "
  147.                 ";
  148.             // line 48
  149.             echo "                <strong>";
  150.             echo twig_escape_filter($this->env$this->extensions['Twig\Extra\Intl\IntlExtension']->formatDateTime($this->envtwig_get_attribute($this->env$this->source$context["comment"], "publishedAt", [], "any"falsefalsefalse48), "medium""short""""UTC"), "html"nulltrue);
  151.             echo "</strong>
  152.             </h4>
  153.             <div class=\"col-sm-9\">
  154.                 ";
  155.             // line 51
  156.             echo $this->extensions['HtmlSanitizer\Bundle\Twig\TwigExtension']->sanitize($this->env->getRuntime('Twig\Extra\Markdown\MarkdownRuntime')->convert(twig_get_attribute($this->env$this->source$context["comment"], "content", [], "any"falsefalsefalse51)));
  157.             echo "
  158.             </div>
  159.         </div>
  160.     ";
  161.             $context['_iterated'] = true;
  162.         }
  163.         if (!$context['_iterated']) {
  164.             // line 55
  165.             echo "        <div class=\"post-comment\">
  166.             <p>";
  167.             // line 56
  168.             echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("post.no_comments"), "html"nulltrue);
  169.             echo "</p>
  170.         </div>
  171.     ";
  172.         }
  173.         $_parent $context['_parent'];
  174.         unset($context['_seq'], $context['_iterated'], $context['_key'], $context['comment'], $context['_parent'], $context['loop']);
  175.         $context array_intersect_key($context$_parent) + $_parent;
  176.         
  177.         $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);
  178.         
  179.         $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->leave($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof);
  180.     }
  181.     // line 61
  182.     public function block_sidebar($context, array $blocks = [])
  183.     {
  184.         $macros $this->macros;
  185.         $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  186.         $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->enter($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""sidebar"));
  187.         $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02 $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  188.         $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->enter($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""sidebar"));
  189.         // line 62
  190.         echo "    ";
  191.         if ($this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("edit", (isset($context["post"]) || array_key_exists("post"$context) ? $context["post"] : (function () { throw new RuntimeError('Variable "post" does not exist.'62$this->source); })()))) {
  192.             // line 63
  193.             echo "        <div class=\"section\">
  194.             <a class=\"btn btn-lg btn-block btn-success\" href=\"";
  195.             // line 64
  196.             echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("admin_post_edit", ["id" => twig_get_attribute($this->env$this->source, (isset($context["post"]) || array_key_exists("post"$context) ? $context["post"] : (function () { throw new RuntimeError('Variable "post" does not exist.'64$this->source); })()), "id", [], "any"falsefalsefalse64)]), "html"nulltrue);
  197.             echo "\">
  198.                 <i class=\"fa fa-edit\" aria-hidden=\"true\"></i> ";
  199.             // line 65
  200.             echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("action.edit_post"), "html"nulltrue);
  201.             echo "
  202.             </a>
  203.         </div>
  204.     ";
  205.         }
  206.         // line 69
  207.         echo "
  208.     ";
  209.         // line 73
  210.         echo "    ";
  211.         $this->displayParentBlock("sidebar"$context$blocks);
  212.         echo "
  213.     ";
  214.         // line 75
  215.         echo $this->extensions['App\Twig\SourceCodeExtension']->showSourceCode($this->env$this->getTemplateName());
  216.         echo "
  217.     ";
  218.         // line 76
  219.         echo twig_include($this->env$context"blog/_rss.html.twig");
  220.         echo "
  221. ";
  222.         
  223.         $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);
  224.         
  225.         $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->leave($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof);
  226.     }
  227.     public function getTemplateName()
  228.     {
  229.         return "blog/post_show.html.twig";
  230.     }
  231.     public function isTraitable()
  232.     {
  233.         return false;
  234.     }
  235.     public function getDebugInfo()
  236.     {
  237.         return array (  250 => 76,  246 => 75,  240 => 73,  237 => 69,  230 => 65,  226 => 64,  223 => 63,  220 => 62,  210 => 61,  193 => 56,  190 => 55,  181 => 51,  174 => 48,  168 => 44,  163 => 42,  160 => 41,  155 => 40,  149 => 37,  144 => 34,  138 => 31,  133 => 29,  129 => 28,  126 => 27,  120 => 25,  117 => 24,  111 => 15,  106 => 13,  100 => 10,  96 => 9,  89 => 6,  79 => 5,  60 => 3,  37 => 1,);
  238.     }
  239.     public function getSourceContext()
  240.     {
  241.         return new Source("{% extends 'base.html.twig' %}
  242. {% block body_id 'blog_post_show' %}
  243. {% block main %}
  244.     <h1>{{ post.title }}</h1>
  245.     <p class=\"post-metadata\">
  246.         <span class=\"metadata\"><i class=\"fa fa-calendar\"></i> {{ post.publishedAt|format_datetime('long', 'medium', '', 'UTC') }}</span>
  247.         <span class=\"metadata\"><i class=\"fa fa-user\"></i> {{ post.author.fullName }}</span>
  248.     </p>
  249.     {{ post.content|markdown_to_html|sanitize_html }}
  250.     {{ include('blog/_post_tags.html.twig') }}
  251.     <div id=\"post-add-comment\" class=\"well\">
  252.         {# The 'IS_AUTHENTICATED_FULLY' role ensures that the user has entered
  253.         their credentials (login + password) during this session. If they
  254.         are automatically logged via the 'Remember Me' functionality, they won't
  255.         be able to add a comment.
  256.         See https://symfony.com/doc/current/security/remember_me.html#forcing-the-user-to-re-authenticate-before-accessing-certain-resources
  257.         #}
  258.         {% if is_granted('IS_AUTHENTICATED_FULLY') %}
  259.             {{ render(controller('App\\\\Controller\\\\BlogController::commentForm', {'id': post.id})) }}
  260.         {% else %}
  261.             <p>
  262.                 <a class=\"btn btn-success\" href=\"{{ path('security_login', {'redirect_to': app.request.pathInfo}) }}\">
  263.                     <i class=\"fa fa-sign-in\" aria-hidden=\"true\"></i> {{ 'action.sign_in'|trans }}
  264.                 </a>
  265.                 {{ 'post.to_publish_a_comment'|trans }}
  266.             </p>
  267.         {% endif %}
  268.     </div>
  269.     <h3>
  270.         <i class=\"fa fa-comments\" aria-hidden=\"true\"></i> {{ 'post.num_comments'|trans({ 'count': post.comments|length }) }}
  271.     </h3>
  272.     {% for comment in post.comments %}
  273.         <div class=\"row post-comment\">
  274.             <a name=\"comment_{{ comment.id }}\"></a>
  275.             <h4 class=\"col-sm-3\">
  276.                 <strong>{{ comment.author.fullName }}</strong> {{ 'post.commented_on'|trans }}
  277.                 {# it's not mandatory to set the timezone in localizeddate(). This is done to
  278.                    avoid errors when the 'intl' PHP extension is not available and the application
  279.                    is forced to use the limited \"intl polyfill\", which only supports UTC and GMT #}
  280.                 <strong>{{ comment.publishedAt|format_datetime('medium', 'short', '', 'UTC') }}</strong>
  281.             </h4>
  282.             <div class=\"col-sm-9\">
  283.                 {{ comment.content|markdown_to_html|sanitize_html }}
  284.             </div>
  285.         </div>
  286.     {% else %}
  287.         <div class=\"post-comment\">
  288.             <p>{{ 'post.no_comments'|trans }}</p>
  289.         </div>
  290.     {% endfor %}
  291. {% endblock %}
  292. {% block sidebar %}
  293.     {% if is_granted('edit', post) %}
  294.         <div class=\"section\">
  295.             <a class=\"btn btn-lg btn-block btn-success\" href=\"{{ path('admin_post_edit', {id: post.id}) }}\">
  296.                 <i class=\"fa fa-edit\" aria-hidden=\"true\"></i> {{ 'action.edit_post'|trans }}
  297.             </a>
  298.         </div>
  299.     {% endif %}
  300.     {# the parent() function includes the contents defined by the parent template
  301.       ('base.html.twig') for this block ('sidebar'). This is a very convenient way
  302.       to share common contents in different templates #}
  303.     {{ parent() }}
  304.     {{ show_source_code(_self) }}
  305.     {{ include('blog/_rss.html.twig') }}
  306. {% endblock %}
  307. ""blog/post_show.html.twig""/app/templates/blog/post_show.html.twig");
  308.     }
  309. }