{% extends 'base.html.twig' %}
{% block page_contents %}
<section class="section section-page-title bg-gradient py-xl-5 py-4" data-aos='fade-down'>
<div class="container">
<div class="row">
<div class="col-12 text-center text-white">
<h1 class="page-name font-weight-bold my-2">{% trans %}Portes ouvertes & événements{% endtrans %}</h1>
<div class="font-20">{% trans %}Venez nous rencontrer et discuter lors de nos portes ouvertes pour poser toutes vos questions.{% endtrans %}</div>
</div>
</div>
</div>
</section>
<section class="section section-form section-form-2 mb-4 mt-4" data-aos='fade-up'>
<div class="container">
<div class="row">
<div class="col-12">
<div class="box-shadow radius-30 px-xl-5 px-lg-4 px-3 px-3 pt-4 pb-2">
<div class="form-header font-weight-bold text-center font-20 mb-4">{% trans %}RECHERCHE UN ÉVÉNEMENT PAR CAMPUS{% endtrans %}</div>
<form id="filter-form">
<div class="form-group row list-campus-checkbox">
{% for campus in campuses %}
<div class="col-xl col-lg col-md-3 col-sm-4 col-6">
<div class="form-check mx-0 px-0 mb-3">
<div class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input" id="campuses-{{ campus.id }}" name="campuses[]" value="{{ campus.id }}" required>
<label class="custom-control-label text-dark-purple font-weight-normal text-nowrap" for="campuses-{{ campus.id }}">{{ campus.name }}</label>
</div>
</div>
</div>
{% endfor %}
</div>
</form>
</div>
</div>
</div>
</div>
</section>
<div id="result-data">
{% for key,item in items %}
{% if item|length > 0 and item[0].status != 0 %}
<section class="section section-event mb-4">
<div class="container">
<div class="row">
<div class="col-12 mb-0">
<div class="s-title position-relative" data-aos='fade-right'>
<span class="d-inline-block pr-1 font-weight-bold text-uppercase text-dark-purple">{{ key }}</span>
</div>
</div>
</div>
{% for openDay in item %}
{% if openDay.status == 1 %}
{% include 'open_day/_item.html.twig' %}
{% endif %}
{% endfor %}
</div>
</section>
{% endif %}
{% endfor %}
</div>
{% endblock %}
{% block custom_javascripts %}
<script type="text/javascript">
$(document).ready(function(){
$('.custom-control-input').change(function(){
filterData();
});
function filterData(){
let data = $('#filter-form').serialize();
$.ajax({
url: "{{ path('open_day.filter') }}",
type: "POST",
dataType: 'json',
data : data,
success: function(result) {
$('#result-data').html(result.data);
AOS.init();
}
});
}
});
</script>
{% endblock %}