{% extends 'Layout/layout.html.twig' %}
{% block title %} TIMEPAC ACADEMY: Home {% endblock %}
{% block content %}
<section class="l-container l-container--background">
<div class="l-container__item l-container__item--center ">
<h1 class="title-home">{% trans %}home-title{% endtrans %}</h1>
<h2 class="subt-home">{% trans %}home-subtitle-1{% endtrans %}</h2>
</div>
</section>
<section class="l-container l-container--color l-container--icon" style="position: relative;">
<div class="l-container__item">
<h6 class="color_white text-center">Watch the recordings and download the presentations from the six webinars
<br><br>In-class training will be conducted during April and May. Check timetable on this website</h6>
<!-- <h6 class="color_white text-center">{% trans %}The first of the{% endtrans %} <a href="https://timepac.eu/wp-content/uploads/2024/02/TIMEPAC_webinar_programme.pdf" target="_blank">{% trans %}six TIMEPAC webinars{% endtrans %}</a> {% trans %}is on February 29, 2024{% endtrans %}.<br><br><a href="{{ path('app_register') }}">{% trans %}Sign up_action{% endtrans %}</a> {% trans %}in the TIMEPAC Academy to register in the webinars{% endtrans %}</h6> -->
</div>
</section>
<section class="l-container l-container--min-color">
<div class="l-container__item">
<h3 class="title-section" id="training">{% trans %}Training activities{% endtrans %}</h3>
{% set currentDate = "now"|date('y-m-d') %}
{% set openCurrent = false %}
{% set openComing = false %}
{% set openClosed = false %}
{% for course in courses %}
{% if currentDate >= course.dateStart|date('y-m-d') and currentDate <= course.dateEnd|date('y-m-d') %}
{% set openCurrent = true %}
{% endif %}
{% if currentDate < course.dateStart|date('y-m-d') and currentDate < course.dateEnd|date('y-m-d') %}
{% set openComing = true %}
{% endif %}
{% if currentDate > course.dateStart|date('y-m-d') and currentDate > course.dateEnd|date('y-m-d') %}
{% set openClosed = true %}
{% endif %}
{% endfor %}
{% if openCurrent == true %}
<h4 class="tag-section">{% trans %}Current{% endtrans %}</h4>
<div class="l-grid">
{% for course in courses %}
{% if currentDate >= course.dateStart|date('y-m-d') and currentDate <= course.dateEnd|date('y-m-d') and course.open != 2 %}
{% if course.experts == 1 %} {% set band = 'certified' %}
{% else %} {% set band = 'current' %}
{% endif %}
{{ include('Home/_card.html.twig', {'band': band}) }}
{% endif %}
{% endfor %}
</div>
{% endif %}
{% if openComing == true %}
<h4 class="tag-section">{% trans %}Coming{% endtrans %}</h4>
<div class="l-grid">
{% for course in courses %}
{% if currentDate < course.dateStart|date('y-m-d') and currentDate < course.dateEnd|date('y-m-d') and course.open != 2 %}
{% if course.experts == 1 %} {% set band = 'certified' %}
{% else %} {% set band = 'coming' %}
{% endif %}
{{ include('Home/_card.html.twig', {'band': band}) }}
{% endif %}
{% endfor %}
</div>
{% endif %}
{% if openClosed == true %}
<h4 class="tag-section">{% trans %}Closed{% endtrans %}</h4>
<div class="l-grid">
{% for course in courses %}
{% if currentDate > course.dateStart|date('y-m-d') and currentDate > course.dateEnd|date('y-m-d') and course.open != 2 %}
{% if course.experts == 1 %} {% set band = 'certified' %}
{% else %} {% set band = 'closed' %}
{% endif %}
{{ include('Home/_card.html.twig', {'band': band}) }}
{% endif %}
{% endfor %}
</div>
{% endif %}
</div>
</section>
{# <section class="l-container">
<div class="l-container__item">
<h3 class="title-section">{% trans %}home-section-2{% endtrans %}</h3>
</div>
</section> #}
{% endblock %}