{*
 * 2019-2020 Team Ever
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Academic Free License (AFL 3.0)
 * that is bundled with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://opensource.org/licenses/afl-3.0.php
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@prestashop.com so we can send you a copy immediately.
 *
 *  @author    Team Ever <https://www.team-ever.com/>
 *  @copyright 2019-2020 Team Ever
 *  @license   http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
*}

{if isset($showArchives) && $showArchives}
{/if}

{if isset($showCategories) && $showCategories}
<div class="columns_everblog_wrapper category_wrapper">
    <p class="text-uppercase h6 hidden-sm-down">{l s='Categories from the blog' mod='everpsblog'}</p>
    <ul>
{foreach from=$categories item=category}
{if $category.is_root_category == 0}
    <li>
        <a href="{$link->getModuleLink('everpsblog', 'category',['id_ever_category'=>$category.id_ever_category, 'link_rewrite'=>$category.link_rewrite])|escape:'htmlall':'UTF-8'}" class="category" title="{$category.title nofilter}">
            {$category.title nofilter}
        </a>
    </li>
{/if}
{/foreach}
    </ul>
</div>
{/if}
{if isset($showTags) && $showTags}
<div class="columns_everblog_wrapper tag_wrapper">
    <p class="text-uppercase h6 hidden-sm-down">{l s='Tags from the blog' mod='everpsblog'}</p>
{foreach from=$tags item=tag}
    <a href="{$link->getModuleLink('everpsblog', 'tag', ['id_ever_tag'=>$tag.id_ever_tag, 'link_rewrite' => $tag.link_rewrite])|escape:'htmlall':'UTF-8'}" class="tag" title="{$tag.title nofilter}">
        {$tag.title nofilter}
    </a>
{/foreach}
</div>
{/if}

{if isset($everpsblog) && $everpsblog}
<div class="columns_everblog_wrapper latests_wrapper">
    <p class="text-uppercase h6 hidden-sm-down">
        <a href="{$blogUrl|escape:'htmlall':'UTF-8'}">
            {l s='Latest from the blog' mod='everpsblog'}
        </a>
    </p>
    <div class="row">
{assign var=postcounter value=1}
{foreach from=$everpsblog item=item}
        <div class="col-12">
            <a href="{$link->getModuleLink('everpsblog', 'post', ['id_ever_post' => $item->id_ever_post , 'link_rewrite' => $item->link_rewrite])|escape:'htmlall':'UTF-8'}" title="{$item->title nofilter}">
                <div class="col-md-6 col-xs-12 article-img p-0">
                    <img src="{$blogImg_dir|escape:'htmlall':'UTF-8'}posts/post_image_{$item->id_ever_post|escape:'htmlall':'UTF-8'}.jpg" class="col-12 col-xs-12 {if $animate}animate flipSideBySide zoomed{/if}" alt="{$item->title nofilter}" title="{$item->title nofilter}" />
                </div>
                <div class="col-md-6 col-xs-12 p-0">
                    <p class="postpublished mb-0" itemprop="datePublished"><i class="fa fa-clock-o" aria-hidden="true"></i> {$item->date_add|date_format:"%d-%m-%y"|escape:'htmlall':'UTF-8'}</p>
                    <p class="everpsblog article-content pt-0" id="everpsblog-post-title-{$item->id_ever_post|escape:'htmlall':'UTF-8'}">
                            {$item->title|strip_tags nofilter}
                    </p>
                </div>
            </a>
        </div>
{$postcounter = $postcounter+1}
{/foreach}
    </div>
</div>
{/if}
