<?php

/* file-edit.tpl */
class __TwigTemplate_2c6229d48eafc9ffb1c4df6116e1ca6eac183dfe4ffe7d4b969627bdc565d555 extends Twig_Template
{
    public function __construct(Twig_Environment $env)
    {
        parent::__construct($env);

        // line 1
        $this->parent = $this->loadTemplate("base.tpl", "file-edit.tpl", 1);
        $this->blocks = array(
            'page_title' => array($this, 'block_page_title'),
            '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_page_title($context, array $blocks = array())
    {
        echo twig_escape_filter($this->env, $this->getAttribute((isset($context["object"]) ? $context["object"] : null), "title", array()), "html", null, true);
        echo " — Edit — ";
        echo twig_escape_filter($this->env, (isset($context["site_name"]) ? $context["site_name"] : null), "html", null, true);
    }

    // line 5
    public function block_content($context, array $blocks = array())
    {
        // line 6
        echo "  <div class=\"page-header\">
    <h1>";
        // line 7
        echo twig_escape_filter($this->env, $this->getAttribute((isset($context["object"]) ? $context["object"] : null), "title", array()), "html", null, true);
        echo "</h1>
  </div>

  <form method=\"post\" class=\"form async wait editor\" enctype=\"multipart/form-data\">
    <div class=\"row\">
      <div class=\"col-md-6\">
        <div class=\"form-group\">
          <label>Название файла:</label>
          <input type=\"text\" name=\"name\" class=\"form-control\" readonly=\"readonly\" value=\"";
        // line 15
        echo twig_escape_filter($this->env, $this->getAttribute((isset($context["object"]) ? $context["object"] : null), "name", array()), "html", null, true);
        echo "\"/>
        </div>

        <div class=\"imgedit\"><img src=\"";
        // line 18
        echo twig_escape_filter($this->env, $this->getAttribute($this->getAttribute($this->getAttribute($this->getAttribute((isset($context["object"]) ? $context["object"] : null), "metadata", array()), "images", array()), "md", array()), "link", array()), "html", null, true);
        echo "\" alt=\"preview\" /></div>

        <p class=\"waitmsg\">Сохраняю данные, подождите...</p>

        <div class=\"progressbar\" style=\"display:none\"><div class=\"done\"></div><div class=\"label\"></div></div>
      </div>

      <div class=\"col-md-6\">
        <div class=\"form-group\">
          <label>Заголовок:</label>
          <input type=\"text\" name=\"title\" class=\"form-control\" required=\"required\" value=\"";
        // line 28
        echo twig_escape_filter($this->env, $this->getAttribute((isset($context["object"]) ? $context["object"] : null), "title", array()), "html", null, true);
        echo "\" autofocus=\"autofocus\"/>
        </div>

        <div class=\"form-group\">
          <label>Описание:</label>
          <textarea class=\"form-control\" name=\"description\">";
        // line 33
        echo twig_escape_filter($this->env, $this->getAttribute((isset($context["object"]) ? $context["object"] : null), "description", array()), "html", null, true);
        echo "</textarea>
        </div>

        <div class=\"form-group\">
          <label>Метки:</label>
          <input type=\"text\" name=\"tags\" class=\"form-control\" value=\"";
        // line 38
        echo twig_escape_filter($this->env, $this->getAttribute((isset($context["object"]) ? $context["object"] : null), "tags", array()), "html", null, true);
        echo "\"/>
          ";
        // line 39
        if ((isset($context["top_tags"]) ? $context["top_tags"] : null)) {
            // line 40
            echo "            <p class=\"help-block\">Популярные тэги: ";
            $context['_parent'] = $context;
            $context['_seq'] = twig_ensure_traversable((isset($context["top_tags"]) ? $context["top_tags"] : 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["tag"]) {
                if (($this->getAttribute($context["loop"], "index", array()) > 1)) {
                    echo ", ";
                }
                echo "<a href=\"/search?tag=";
                echo twig_escape_filter($this->env, $context["tag"], "html", null, true);
                echo "\" target=\"_blank\" data-value=\"";
                echo twig_escape_filter($this->env, $context["tag"], "html", null, true);
                echo "\" class=\"tag\">";
                echo twig_escape_filter($this->env, $context["tag"], "html", null, true);
                echo "</a>";
                ++$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['tag'], $context['_parent'], $context['loop']);
            $context = array_intersect_key($context, $_parent) + $_parent;
            echo ".</p>
          ";
        }
        // line 42
        echo "        </div>

        <div class=\"form-group\">
          <label>Тип:</label>
          <input type=\"text\" name=\"type\" class=\"form-control\" required=\"required\" value=\"";
        // line 46
        echo twig_escape_filter($this->env, $this->getAttribute((isset($context["object"]) ? $context["object"] : null), "type", array()), "html", null, true);
        echo "\"/>
        </div>

        <div class=\"form-group\">
          <label>Дата создания:</label>
          <input type=\"text\" name=\"created\" class=\"form-control\" required=\"required\" value=\"";
        // line 51
        echo twig_escape_filter($this->env, $this->getAttribute((isset($context["object"]) ? $context["object"] : null), "created", array()), "html", null, true);
        echo "\"/>
        </div>

        <hr/>

        <div class=\"form-group actions\">
          <button class=\"btn btn-primary\">Сохранить</button>
          <a class=\"btn btn-default\" href=\"";
        // line 58
        echo twig_escape_filter($this->env, $this->getAttribute((isset($context["object"]) ? $context["object"] : null), "download", array()), "html", null, true);
        echo "\">Скачать оригинал</a>
        </div>
      </div>
    </div>
  </form>
";
    }

    public function getTemplateName()
    {
        return "file-edit.tpl";
    }

    public function isTraitable()
    {
        return false;
    }

    public function getDebugInfo()
    {
        return array (  162 => 58,  152 => 51,  144 => 46,  138 => 42,  95 => 40,  93 => 39,  89 => 38,  81 => 33,  73 => 28,  60 => 18,  54 => 15,  43 => 7,  40 => 6,  37 => 5,  29 => 3,  11 => 1,);
    }
}
/* {% extends "base.tpl" %}*/
/* */
/* {% block page_title %}{{ object.title }} — Edit — {{ site_name }}{% endblock %}*/
/* */
/* {% block content %}*/
/*   <div class="page-header">*/
/*     <h1>{{ object.title }}</h1>*/
/*   </div>*/
/* */
/*   <form method="post" class="form async wait editor" enctype="multipart/form-data">*/
/*     <div class="row">*/
/*       <div class="col-md-6">*/
/*         <div class="form-group">*/
/*           <label>Название файла:</label>*/
/*           <input type="text" name="name" class="form-control" readonly="readonly" value="{{ object.name }}"/>*/
/*         </div>*/
/* */
/*         <div class="imgedit"><img src="{{ object.metadata.images.md.link }}" alt="preview" /></div>*/
/* */
/*         <p class="waitmsg">Сохраняю данные, подождите...</p>*/
/* */
/*         <div class="progressbar" style="display:none"><div class="done"></div><div class="label"></div></div>*/
/*       </div>*/
/* */
/*       <div class="col-md-6">*/
/*         <div class="form-group">*/
/*           <label>Заголовок:</label>*/
/*           <input type="text" name="title" class="form-control" required="required" value="{{ object.title }}" autofocus="autofocus"/>*/
/*         </div>*/
/* */
/*         <div class="form-group">*/
/*           <label>Описание:</label>*/
/*           <textarea class="form-control" name="description">{{ object.description }}</textarea>*/
/*         </div>*/
/* */
/*         <div class="form-group">*/
/*           <label>Метки:</label>*/
/*           <input type="text" name="tags" class="form-control" value="{{ object.tags }}"/>*/
/*           {% if top_tags %}*/
/*             <p class="help-block">Популярные тэги: {% for tag in top_tags %}{% if loop.index > 1 %}, {% endif %}<a href="/search?tag={{ tag }}" target="_blank" data-value="{{ tag }}" class="tag">{{ tag }}</a>{% endfor %}.</p>*/
/*           {% endif %}*/
/*         </div>*/
/* */
/*         <div class="form-group">*/
/*           <label>Тип:</label>*/
/*           <input type="text" name="type" class="form-control" required="required" value="{{ object.type }}"/>*/
/*         </div>*/
/* */
/*         <div class="form-group">*/
/*           <label>Дата создания:</label>*/
/*           <input type="text" name="created" class="form-control" required="required" value="{{ object.created }}"/>*/
/*         </div>*/
/* */
/*         <hr/>*/
/* */
/*         <div class="form-group actions">*/
/*           <button class="btn btn-primary">Сохранить</button>*/
/*           <a class="btn btn-default" href="{{ object.download }}">Скачать оригинал</a>*/
/*         </div>*/
/*       </div>*/
/*     </div>*/
/*   </form>*/
/* {% endblock %}*/
/* */
