{% extends 'Common/base.html.twig' %}
{% import 'Common/parts/functions.html.twig' as function %}
{% block title %}{{ article.title(locale) }} | {{ parent() }}{% endblock %}
{% block classBody %}blog {{ parent() }}{% endblock %}
{% block description %}{% apply spaceless %}
{% if article.metaDescription(locale) != '' %}
{{ article.metaDescription(locale) }}
{% else %}
{{ parent() }}
{% endif %}
{% endapply %}{% endblock%}
{% block keywords %}{% apply spaceless %}
{% if article.metaKeywords(locale) != '' %}
{{ article.metaKeywords(locale)|join(',') }}
{% else %}
{{ parent() }}
{% endif %}
{% endapply %}{% endblock%}
{% block javascripts %}
{{ parent() }}
{{ encore_entry_script_tags('wt_show_article') }}
{% endblock javascripts %}
{% block contents %}
<div class="container-small" ng-controller="showArticleCtrl">
<nav class="mb-2" aria-label="breadcrumb">
<ol class="breadcrumb mb-0">
<li class="breadcrumb-item"><a href="{{path('web_init')}}">Inicio</a></li>
{% if article.showInBlog %}
<li class="breadcrumb-item"><a href="{{path('web_blog_list_articles')}}">Blog</a></li>
{% endif %}
<li class="breadcrumb-item active" aria-current="page">{{ article.title(locale) }}</li>
</ol>
</nav>
<h2 class="my-2">{{ article.title(locale) }}</h2>
<div class="my-2">
<div class="article_publich_at fs--1">{{ article.publishAt | date('d-m-Y') }} - {{ article.publishAt | ago }}</div>
{% if article.showInBlog %}
<div class="article-categories">
{% for category in article.categories(locale) %}
<a class="text-muted" href="{{ url('web_blog_list_articles_category', { 'categorySlug': category.slug(locale), '_locale': locale} )}}">{{ category.title(locale) }}</a>
{% if not loop.last %} | {%endif%}
{% endfor %}
</div>
{% endif %}
{% if is_granted('IS_AUTHENTICATED_REMEMBERED') and app.user.user.hasRole('ROLE_ADMIN') %}
<a class="text-muted fs--1" href="{{ path('web_admin_blog_edit_article', {'articleId':article.id, 'locale': locale}) }}" >Editar</a>
{% endif %}
</div>
<div class="article-image">
{% if article.headerImageUrl %}
<img class="ui large centered bordered rounded image text-center w-100" src="{{ article.headerImageUrl | imagine_filter('whater_blog_header_image_1200_300') }}">
{% endif %}
</div>
<div class="article-content my-3">
{{ article.content(locale) | raw }}
</div>
<div class="article-keywords">
{% for metaKeyword in article.metaKeywords(locale) %}
<a>#{{ metaKeyword }}</a>
{% endfor %}
</div>
</div>
{% endblock contents %}