{extends "index.tpl"}

{block "meta-description"}
   <meta name="description" content="{$body.article.lead}">
{/block}

{block content}
    {foreach $body.article.tags as $tag}
        {if $tag.id == 1}
            {$old_layout = true}
            {break}
        {/if}
    {/foreach}

   <div class="page-article">
      <h1 class="article-title text-center">{$body.article.title}</h1>

       {block 'article-date'}
           {if $body.article.date}
              <div class="news-date">
               <span>
                  {$body.article.date|date_format:"%e"}
               </span>
                 <span>
                  {$body.article.date|date_format:"%-m"}
               </span>
              </div>
           {/if}
       {/block}

      <div class="page-article-content {if !$old_layout}new-layout{/if}">
          {if $body.article.image.id and $old_layout}
             <div class="article-img">
                <a href="{get_photo photo=$body.article.image size=0}" data-rel="gallery">
                   <img src="{get_photo photo=$body.article.image size=news_lg}" alt="{$body.article.image.descr}"
                        class="img-responsive m-x-auto m-b-2">
                </a>

                 {if $body.article.photos|@count > 1}
                    <div class="row article-gallery">
                        {foreach $body.article.photos as $photo}
                            {if $body.article.image.id != $photo.id}
                               <div class="col-xs-6">
                                  <a href="{get_photo photo=$photo.img size=0}" data-rel="gallery">
                                     <img src="{get_photo photo=$photo.img size=4}" alt="{$photo.img.descr}"
                                          class="img-responsive">
                                  </a>
                               </div>
                            {/if}
                        {/foreach}
                    </div>
                 {/if}
             </div>
          {/if}

          {block 'article-content'}
              {if $old_layout}
                 <div class="article-content">
                     {$body.article.body.body nofilter}
                 </div>
              {else}
                  {$body.article.body.body nofilter}
              {/if}
          {/block}
      </div>

      <div class="row home-products">
         <div class="col-xs-12">
             {insert_products type="article_product" article=$body.article.id image=2 count=18 template="block.products.tpl" catalog_class="col-xxl-2 col-md-4 col-sm-6"}
         </div>
      </div>
   </div>
{/block}
