var/cache/dev/twig/55/552867397c8b9690197bf8cb074dabe03498cc7862571396c16de258ef85b7c4.php line 51

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