{% extends 'base.html.twig' %}
{% block seo %}
{% set ruta = app.request.get('_route') %}
{% set params = app.request.attributes.get('_route_params') %}
<title>{{ blog.titulo }}</title>
<meta name="description" content="{{ blog.resumen }}" />
<link rel="image_src" href="{{ blog.imagenGrande }}"/>
<meta property="og:title" content="{{ blog.titulo }}" />
<meta property="og:type" content="article" />
<meta property="og:url" content="{{ url(ruta,params) }}" />
<meta property="og:image" content="{{ blog.imagenGrande }}" />
<meta property="og:description" content="{{ blog.resumen }}" />
{% endblock %}
{% block body %}
{{ include('basic/canales.html.twig') }}
<section class="blog-banner" style="background-image: url('{{ blog.imagenGrande }}');">
<div class="only-mobile">
<i class="color-blanco icon-favblog ml-4"></i>
</div>
<div class="only-desk">
<div class="row title no-margin w-100 bg-naranja d-flex justify-content-center align-items-center">
<h3 class="color-blanco">{{ blog.titulo }}</h3>
<i class="color-blanco icon-favblog ml-4" data-id="{{ blog.id }}" data-user="{% if app.user %}1{% endif %}"></i>
</div>
</div>
</section>
<section class="pt-sm-5 pt-3 px-2">
<div class="only-mobile px-4 py-2">
<h2 class="color-negro">{{ blog.titulo }}</h2>
</div>
<div class="container px-sm-5 px-4">
{{ blog.contenido | raw }}
<div class="row d-flex mt-4 justify-content-between align-items-center">
<div class="d-flex like-cont align-items-center">
<a href="" id="like" data-blog="{{ blog.id }}" data-userid="{{ user_id }}">
{% if like_user == null and like_user == false %}
<img class="likes" src="{{ asset('img/SVG/likes_active.svg') }}" alt="">
{% else %}
<img class="likes" src="{{ asset('img/SVG/likes.svg') }}" alt="">
{% endif %}
</a>
{# {{like_user}} #}
<h6 class="bold color-gris1 ml-2">{{ likes[1] }} Likes</h6>
{# <h6 class="bold color-gris1 ml-2">Likes</h6> #}
</div>
{# compartir en redes sociales #}
<div class="d-flex redes">
{% set enlace = path('blog-interna',{id:blog.id, nombre:qi.slugify(blog.titulo)}) %}
{# facebook #}
{% if qi.Setting('facebook') == 1 %}
{# {% set enlace = path('blog-interna',{id:blog.id, nombre:qi.slugify(blog.titulo)}) %} #}
<a class="rounded mr-2" href="{{ app.request.scheme ~'://' ~ app.request.httpHost ~enlace }}" onclick="window.open(
'https://www.facebook.com/sharer/sharer.php?u='+encodeURIComponent(location.href),
'facebook-share-dialog',
'width=626,height=436')">
<i class="color-negro icon-facebook-single">
</i>
</a>
{% endif %}
{# twitter #}
{% if qi.Setting('twitter') == 1 %}
<a class="rounded mr-2" target="_blank" href="https://twitter.com/share?url={{ app.request.scheme ~'://' ~ app.request.httpHost ~enlace }}&text={{ blog.titulo }}" >
<i class="color-negro icon-twitter">
</i>
</a>
{% endif %}
{# linkendin #}
{% if qi.Setting('linkedin') == 1 %}
<a class="rounded" target="_blank" href="https://www.linkedin.com/shareArticle?mini=true&url={{ app.request.scheme ~'://' ~ app.request.httpHost ~enlace }}&text={{ blog.titulo }}">
<i class="color-negro icon-in"></i>
</a>
{% endif %}
</div>
</div>
<div class="row">
<hr class="w-100">
</div>
<div class="row mt-5" id="comentario">
<h4 class="color-negro w-100">{{ comentarios | length}} Comentario{% if comentarios | length > 0 %}s{% endif %}</h4>
{% if app.user %}
{{ form_start(form,{'attr': {'class':"w-100",'novalidate':'novalidate','action':'#comentario','id':'comentario'}}) }}
{#<textarea class="w-100" name="" id="" cols="10" rows="5" placeholder="Escribe un comentario"></textarea>#}
<div class="form-error">
{{ form_errors(form.comentario) }}
</div>
{{ form_widget(form.comentario,{'attr': {'class':"w-100",'placeholder': 'Escribe un comentario', 'cols': '10','rows': '5'}}) }}
{#{{ form_row(form.captcha, {'attr': { }}) }}#}
{{ form_widget(form.usuario, {'attr': { 'style':'display:none'}}) }}
{{ form_widget(form.blog, {'attr': { 'style':'display:none'}}) }}
<div class="form-group em">
<button type="submit" value="submit" class="btn_3 btn btn-naranja" id="contacto">
Enviar
</button>
</div>
{{ form_end(form) }}
{% endif %}
</div>
</div>
</section>
<section class="resenas pt-3">
<div class="container px-4">
{% for item in comentarios %}
<div class="item">
<div class="d-flex align-items-center">
<img src="{{ asset('img/SVG/avatar.svg') }}" alt="">
<div class="ml-3">
<h6 class="bold color-negro">{{ item.usuario }}</h6>
<p>{{ qi.time_elapsed_string(item.created_at) }}</p>
</div>
</div>
<p class="mt-2">{{ item.comentario }}</p>
</div>
{% endfor %}
</div>
</section>
<section class="bg-naranja direccion">
<div class="container d-flex justify-content-between">
<div class="item-dir">
<a class="d-flex color-blanco" href="{{ path('blog-interna',{id: blog_prev.id, nombre: qi.slugify(blog_prev.titulo)}) }}">
<i class="icon-left"></i>
<p>Anterior</p>
</a>
<h4 class="mt-2 color-blanco">{{ blog_prev.titulo }}</h4>
</div>
<div class="item-dir">
<a class="d-flex color-blanco justify-content-end" href="{{ path('blog-interna',{id: blog_next.id, nombre: qi.slugify(blog_next.titulo)}) }}">
<p>Siguiente</p>
<i class="icon-right"></i>
</a>
<h4 class="mt-2 color-blanco text-right">{{ blog_next.titulo }}</h4>
</div>
</div>
</section>
<div data-remodal-id="modal_blog">
<button data-remodal-action="close" class="remodal-close"></button>
{# <h1>Alerta</h1> #}
<p>
Para dar like a este post debes loguearte en la plataforma
</p>
</div>
<div data-remodal-id="modal_blog_comentario">
<button data-remodal-action="close" class="remodal-close"></button>
<h1>Alerta</h1>
<p>
Para comentar post debes loguearte en la plataforma
</p>
</div>
{% endblock %}
{% block javascripts %}
{% endblock %}