{% extends 'partials/base.html.twig' %}

{% block content %}

{% set home = page.find('/radiogarage/home') %}
{% set archives = page.find('/radiogarage/archives') %}
{% set player = page.find('/radiogarage/player') %}

{# -------- PLAYER GLOBAL (UNE SEULE FOIS) -------- #}
{% if player %}
  {% include 'partials/player.html.twig' with { player: player } %}
{% endif %}

{# -------- SECTION HOME -------- #}
<div id="home" class="page">
  <div id="home-box">
    <h2>Prochain rdv direct</h2>
    <ul>
      {% for child in home.children %}
        {% include 'partials/home-emission.html.twig' with { child: child } %}
      {% endfor %}
    </ul>
  </div>
</div>

{# -------- SECTION ARCHIVES -------- #}
<div id="archives" class="page" style="display:none;">
  <div id="archives-box">
    {% for child in archives.children %}
      {% include 'partials/archives-emission.html.twig' with { child: child } %}
    {% endfor %}
  </div>
</div>

{% endblock %}
