{% extends 'themesWebsite/blog_cvs/base.html.twig' %}
{% block title %}{{ page.shortTitle }}{% endblock title %}
{% block description %}{{ page.shortDescription }}{% endblock description %}
{% block robots %}{{ page.robots }}{% endblock robots %}
{% block meta_social %}
{{ parent() }}
{% include "/themesWebsite/blog_cpn/components/socialmedia.html.twig" with { 'page':page,'social_type':'website' } %}
{% endblock meta_social %}
{% block body %}
<section class="bg-cover primary-bg-dark" style="background:url(assets/img/bg2.png)no-repeat; margin-top:72px;">
<div class="container">
<div class="row">
<div class="col-lg-12 col-md-12">
<h2 class="ipt-title text-light">{{ page.title|raw }}</h2>
{% if page.description is not null %}<span class="ipn-subtitle text-light opacity-75">{{ page.description|raw }}<</span>{% endif %}
</div>
</div>
</div>
</section>
<section class="gray-simple">
<div class="container">
<div class="row gx-4 gy-4">
{% for article in pagination %}
<div class="col-xl-4 col-lg-4 col-md-12 col-sm-12">
<div class="jobstock-grid-blog">
<div class="jobstock-grid-blog-thumb">
{% if article.image.name is not null %}
<img class="img-fluid" src="{{ vich_uploader_asset(article, 'imageFile')|imagine_filter('articles_preview2') }}" alt="{{ article.title }}" loading="lazy" />
{% else %}
<img class="img-fluid" src="/uploads/no_data.png" loading="lazy" alt="{{ article.title }}" />
{% endif %}
</div>
<div class="jobstock-grid-blog-body">
<div class="jobstock-grid-body-header">
<div class="jobstock-grid-posted"><span>26 Feb 2023</span></div>
<div class="jobstock-grid-title">
<h4>
{% if article.type == "article" %}
<a href="{{ path('blog_article',{'slug': article.slug}) }}">{{ article.title }}</a>
{% elseif article.type == "fiche" %}
<a href="{{ article.url }}">{{ article.title }}</a>
{% endif %}
</h4>
</div>
</div>
<div class="jobstock-grid-body-middle">
{% if article.subtitle is not empty %}<p>{{ article.subtitle }}</p>{% endif %}
</div>
<div class="jobstock-grid-body-footer">
{% if article.type == "article" %}<a href="{{ path('blog_article',{'slug': article.slug}) }}" class="btn btn-blog-link">Lecture</a>
{% elseif article.type == "fiche" %}<a href="{{ article.url }}" class="btn btn-blog-link">Lecture</a>{% endif %}
</div>
</div>
</div>
</div>
{% endfor %}
</div>
{{ knp_pagination_render(pagination,'components/pagination/pagination.html.twig') }}
</div>
</section>
{% if blocks is not empty %}
{% for block in blocks %}
{% if is_granted("ROLE_SUPER_ADMIN") %}<div id='block_{{ block.id }}'>{% endif %}
{% if (block.onlyVisitor == true) and (block.visibilityUser == false) and app.user is null %}
{# VISITEUR #}
{% include "/themesWebsite/blog_cvs/components/pages/collections.html.twig" with {'block':block,'newsletter':formNewsletter,'contact':form} %}
{% elseif (block.onlyVisitor == false) and (block.visibilityUser == true) and app.user is not null %}
{# CONNECTE #}
{% include "/themesWebsite/blog_cvs/components/pages/collections.html.twig" with {'block':block,'newsletter':formNewsletter,'contact':form} %}
{% elseif (block.onlyVisitor is null) and (block.visibilityUser is null) %}
{# VISITEUR + CONNECTE #}
{% include "/themesWebsite/blog_cvs/components/pages/collections.html.twig" with {'block':block,'newsletter':formNewsletter,'contact':form} %}
{% endif %}
{% if is_granted("ROLE_SUPER_ADMIN") %}</div>{% endif %}
{% if is_granted("ROLE_SUPER_ADMIN") %}
{% if (block.onlyVisitor == true) and (block.visibilityUser == false) and app.user is null %}
{# VISITEUR #}
{% include "/themesWebsite/blog_cvs/components/pages/block_superadmin.html.twig" with {'block':block,'page':page} %}
{% elseif (block.onlyVisitor == false) and (block.visibilityUser == true) and app.user is not null %}
{# CONNECTE #}
{% include "/themesWebsite/blog_cvs/components/pages/block_superadmin.html.twig" with {'block':block,'page':page} %}
{% elseif (block.onlyVisitor is null) and (block.visibilityUser is null) %}
{# VISITEUR + CONNECTE #}
{% include "/themesWebsite/blog_cvs/components/pages/block_superadmin.html.twig" with {'block':block,'page':page} %}
{% endif %}
{% endif %}
{% endfor %}
{% endif %}
<div id="show_modal"></div>
{% endblock body %}
{% block footer_js %}
{% if is_granted("ROLE_SUPER_ADMIN") %}
<script>
function displayEdit(state) {
$(".edit-spm").each(function(i) {
$(this).css('display',state)
});
$(".edit-spmd").each(function(i) {
$(this).css('display',state)
});
$(".edit-spmc").each(function(i) {
$(this).css('display',state)
});
$(".edit-spmh").each(function(i) {
$(this).css('display',state)
});
}
var isCtrl = false;$(document).keyup(function (e) {
if(e.which == 17) isCtrl=false;
}).keydown(function (e) {
if(e.which == 17) isCtrl=true;
if(e.which == 66 && isCtrl == true) {
var editDisplay = $("#spm").attr('editspm');
if(editDisplay == "1") {
displayEdit("none");
$("#spm").attr('editspm','0');
} else {
displayEdit("block");
$("#spm").attr('editspm','1');
}
return false;
}
});
$('.edit-spm').click(function (data) {
$.get(Routing.generate('bo_pageshasblocks_components_edit_cover',{'page':$(this).attr('page'),'id':$(this).attr('item')})).done(function(data2) {
$("#show_modal").html(data2);
$("#modaldisplay").modal('show');
});
});
$('.edit-spmd').click(function (data) {
$.get(Routing.generate('bo_pageshasblocks_components_edit_classic',{'page':$(this).attr('page'),'id':$(this).attr('item')})).done(function(data2) {
$("#show_modal").html(data2);
$("#modaldisplay").modal('show');
});
});
$('.edit-spmh').click(function (data) {
$.get(Routing.generate('bo_pageshasblocks_components_edit_html',{'page':$(this).attr('page'),'id':$(this).attr('item')})).done(function(data2) {
$("#show_modal").html(data2);
$("#modaldisplay").modal('show');
});
});
$('.edit-spmc').click(function (data) {
$.get(Routing.generate('bo_pageshasblocks_components_edit_custom',{'page':$(this).attr('page'),'id':$(this).attr('item')})).done(function(data2) {
$("#show_modal").html(data2);
$("#modaldisplay").modal('show');
});
});
</script>
{% endif %}
{% endblock footer_js %}