<?php

/* album.twig */
class __TwigTemplate_49d41f147cc1c2d8f729da2198dce974f53259d88c63a69d2da3fa233d0d3f0a extends Twig_Template
{
    public function __construct(Twig_Environment $env)
    {
        parent::__construct($env);

        // line 1
        $this->parent = $this->loadTemplate("base.tpl", "album.twig", 1);
        $this->blocks = array(
            'content' => array($this, 'block_content'),
        );
    }

    protected function doGetParent(array $context)
    {
        return "base.tpl";
    }

    protected function doDisplay(array $context, array $blocks = array())
    {
        $this->parent->display($context, array_merge($this->blocks, $blocks));
    }

    // line 3
    public function block_content($context, array $blocks = array())
    {
        // line 4
        echo "    <div class=\"page-header\">
        <h1>Фотоальбом ";
        // line 5
        echo twig_escape_filter($this->env, (isset($context["tag"]) ? $context["tag"] : null), "html", null, true);
        echo "</h1>
    </div>

    <div class=\"photoalbum\">
        ";
        // line 9
        $context['_parent'] = $context;
        $context['_seq'] = twig_ensure_traversable((isset($context["files"]) ? $context["files"] : null));
        $context['loop'] = array(
          '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["photo"]) {
            // line 10
            echo "            ";
            if ($this->getAttribute($context["loop"], "first", array())) {
                // line 11
                echo "                <div class=\"photo cover\">
                    <a href=\"/files/";
                // line 12
                echo twig_escape_filter($this->env, $this->getAttribute($context["photo"], "id", array()), "html", null, true);
                echo "?tag=";
                echo twig_escape_filter($this->env, (isset($context["tag"]) ? $context["tag"] : null), "html", null, true);
                echo "\" title=\"";
                echo twig_escape_filter($this->env, $this->getAttribute($context["photo"], "name", array()), "html", null, true);
                echo "\">
                        <img class=\"tile\" src=\"/static/images/pixel.png\" style=\"background-image: url(";
                // line 13
                echo twig_escape_filter($this->env, $this->getAttribute($this->getAttribute($this->getAttribute($this->getAttribute($context["photo"], "metadata", array()), "images", array()), "md", array()), "link", array()), "html", null, true);
                echo ")\" alt=\"";
                echo twig_escape_filter($this->env, $this->getAttribute($context["photo"], "name", array()), "html", null, true);
                echo "\"/>
                    </a>
                </div>
            ";
            } else {
                // line 17
                echo "                <div class=\"photo\">
                    <a href=\"/files/";
                // line 18
                echo twig_escape_filter($this->env, $this->getAttribute($context["photo"], "id", array()), "html", null, true);
                echo "?tag=";
                echo twig_escape_filter($this->env, (isset($context["tag"]) ? $context["tag"] : null), "html", null, true);
                echo "\" title=\"";
                echo twig_escape_filter($this->env, $this->getAttribute($context["photo"], "name", array()), "html", null, true);
                echo "\">
                        <img class=\"tile\" src=\"/static/images/pixel.png\" style=\"background-image: url(";
                // line 19
                echo twig_escape_filter($this->env, $this->getAttribute($this->getAttribute($this->getAttribute($this->getAttribute($context["photo"], "metadata", array()), "images", array()), "md", array()), "link", array()), "html", null, true);
                echo ")\" alt=\"";
                echo twig_escape_filter($this->env, $this->getAttribute($context["photo"], "name", array()), "html", null, true);
                echo "\"/>
                    </a>
                </div>
            ";
            }
            // line 23
            echo "        ";
            ++$context['loop']['index0'];
            ++$context['loop']['index'];
            $context['loop']['first'] = false;
            if (isset($context['loop']['length'])) {
                --$context['loop']['revindex0'];
                --$context['loop']['revindex'];
                $context['loop']['last'] = 0 === $context['loop']['revindex0'];
            }
        }
        $_parent = $context['_parent'];
        unset($context['_seq'], $context['_iterated'], $context['_key'], $context['photo'], $context['_parent'], $context['loop']);
        $context = array_intersect_key($context, $_parent) + $_parent;
        // line 24
        echo "    </div>
";
    }

    public function getTemplateName()
    {
        return "album.twig";
    }

    public function isTraitable()
    {
        return false;
    }

    public function getDebugInfo()
    {
        return array (  115 => 24,  101 => 23,  92 => 19,  84 => 18,  81 => 17,  72 => 13,  64 => 12,  61 => 11,  58 => 10,  41 => 9,  34 => 5,  31 => 4,  28 => 3,  11 => 1,);
    }
}
/* {% extends "base.tpl" %}*/
/* */
/* {% block content %}*/
/*     <div class="page-header">*/
/*         <h1>Фотоальбом {{ tag }}</h1>*/
/*     </div>*/
/* */
/*     <div class="photoalbum">*/
/*         {% for photo in files %}*/
/*             {% if loop.first %}*/
/*                 <div class="photo cover">*/
/*                     <a href="/files/{{ photo.id }}?tag={{ tag }}" title="{{ photo.name }}">*/
/*                         <img class="tile" src="/static/images/pixel.png" style="background-image: url({{ photo.metadata.images.md.link }})" alt="{{ photo.name }}"/>*/
/*                     </a>*/
/*                 </div>*/
/*             {% else %}*/
/*                 <div class="photo">*/
/*                     <a href="/files/{{ photo.id }}?tag={{ tag }}" title="{{ photo.name }}">*/
/*                         <img class="tile" src="/static/images/pixel.png" style="background-image: url({{ photo.metadata.images.md.link }})" alt="{{ photo.name }}"/>*/
/*                     </a>*/
/*                 </div>*/
/*             {% endif %}*/
/*         {% endfor %}*/
/*     </div>*/
/* {% endblock %}*/
/* */
