{% extends 'base.html.twig' %}
{% block stylesheets %}
{{ parent() }}
<style>
.xhibit_masonry{width:100%}
.xhibit_masonry .xhibit-item {width:calc(20% - 4px);margin:2px}
._toolbar {position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); background-color: rgba(0, 0, 0, 0.5); padding: 10px; border-radius: 10px; z-index: 99999999;}
.xhibit_masonry .xhibit-item:after{content:'';float:left;display:inline-block;width:100%;height:100%;background:rgba(29,140,242,.15);position:absolute;left:0;top:0;z-index:-1;border-radius:5px}
</style>
{% endblock stylesheets %}
{% block headerJS %}
{{ parent() }}
<link type="text/css" rel="stylesheet" href="{{ asset('assets/js/jquery.xhibit/jquery.xhibit.css') }}"/>
<script src="{{ asset('assets/js/jquery.xhibit/jquery.xhibit.js') }}"></script>
{% endblock headerJS %}
{% block content %}
<div class="container mt-3 text-center mb-5">
<div class="mb-3 _grid" style="">
{% include 'ContentBlock/block.html.twig' with {
'aParams': {
'contentType': 'posts',
'aStatus': [constant('App\\Entity\\Post::STATUS_READY')],
'sorting': 'date',
'max_results': 20,
'page': app.request.get('page') ? app.request.get('page') : 1,
'show_pagination': true,
'item_template': 'item/post.html.twig',
'results_items_wrapper_class': 'row justify-content-center g-2',
'results_item_class': 'col-md-3 position-relative',
'no_results_html': '<div class="_noContent text-center"><i class="fas fa-images mt-5 mb-4" style="font-size: 2.5em;"></i><h5>No posts found</h5></div>'
}
} %}
</div>
{#
{% set posts = getResults({
'contentType': 'posts',
'sorting': 'date',
'max_results': 20,
'page': app.request.get('page') ? app.request.get('page') : 1
}) %}
<div class="row" style="">
<div class="_grid">
{% for post in posts.results %}
{% include 'item/post.html.twig' with {
'post': post
} %}
{% endfor %}
</div>
</div>
<div class="container-xl row" style="">
{% if posts.pagination %}
<div class="_pagination" style="">
{{ knp_pagination_render(posts.pagination, 'ContentBlock/pagination.html.twig') }}
</div>
{% endif %}
</div>
#}
</div>
{% endblock content %}
{% block javascripts %}
<script>
$(document).ready(function(){
{% if app.user %}
$('._delete_post').on('click', function(e){
e.preventDefault();
let path = $(this).attr('href');
Swal.fire({
title: '',
html: 'Are you sure you want to delete this post?',
showDenyButton: true,
confirmButtonText: 'Yes',
denyButtonText: `Cancel`,
}).then((result) => {
if(result.isConfirmed)
{
parent.location.href = path;
/*let container = $('._xlabs_results_wrapper');
let results = container.resultsContainer();
$.ajax({
url: path,
type: 'post',
dataType: 'html',
success: function(data){
results.reload();
},
error: function(){
results.reload();
}
});*/
} else if (result.isDenied) {
}
});
});
{% endif %}
/*
$('._grid').xhibit({
item_class: '._grid-item',
//panning: {{ not isMobile() and not isTablet() ? 'true' : 'false' }},
panning: false,
popup: false,
shine_hover: false,
masonry: true,
onInitialized: function(plugin){
},
onItemClick: function(item){
}
});
*/
/*
$('._grid2').xhibit({
item_class: '._grid-item',
//panning: {{ not isMobile() and not isTablet() ? 'true' : 'false' }},
panning: false,
popup: false,
masonry: false,
size_classes: ['wide', 'tall', 'big', 'small'],
onItemClick: function(item){
}
});
*/
});
</script>
{% endblock javascripts %}