{%- set datedujour = "now"|date("Ymd") -%}
{%- if famille|length == 1 %}
{%- set seul = true %}
{%- else %}
{%- set seul = false -%}
{% endif %}
{# Case inscrits #}
Inscrits
{# Mode admin : case action #}
{% if est_admin == true %}
Action
{% endif %}
{# Si connecté : case inscription #}
{% if app.user and est_admin == false %}
Inscription
{% endif %}
{# Date limite d'inscription #}
Date limite inscription
Date
Organisateur
Mandat
Dépt.
Discipline
{% set moisEnCours = "" %}
{% for line in lines %}
{% set affiche = true %}
{# N'afficher que les concours avec des inscrits ? #}
{% if queInscrits == 1 %}
{% if inscriptions[line.id] is defined %}
{% set affiche = true %}
{% else %}
{% set affiche = false %}
{% endif %}
{% endif %}
{# N'afficher que les concours du user courant ? (pas en mode admin) #}
{% if queMesConcours == 1 and app.user and est_admin == false %}
{% set affiche = false %}
{%- for membre in famille -%}
{% if mesInscriptions[line.id ~ '-' ~ membre.licence] is defined %}
{% set affiche = true %}
{% endif %}
{% endfor %}
{% endif %}
{# On affiche la ligne de concours #}
{% if affiche %}
{# Gestion de changements de mois #}
{% set moisLigne = line.dateDebut|date('Y') ~ line.dateDebut|date('m') %}
{% if moisLigne != moisEnCours %}
{% endif %}
{# Si connecté : gestion de ses inscriptions #}
{% if app.user and est_admin == false %}
{# Bouton s'inscrire / modifier, qui est invalidé si on dépasse la date limite. #}
{%- if line.dateLimiteInscription is not null -%}{%- set dateLimiteInscription = line.dateLimiteInscription|date("Ymd") -%}{%- else -%}{%- set dateLimiteInscription = 99999999 -%}{% endif -%}
{%- set datefin = line.dateFin|date("Ymd") -%}
{%- if datedujour <= dateLimiteInscription and not (datedujour > datefin)-%}
{%- for membre in famille -%}
{%- set present = false -%}
{%- if mesInscriptions[line.id ~ '-' ~ membre.licence] is defined -%}{%- set present = true -%}{% endif %}
{# S'incrire ou modifier #}
{# Si concours clôturé : one ne peut que modifier #}
{% if line.cloture != 'O' or present %}
{% endif %}
{# Bouton suppression #}
{%- if present -%}
{%- endif -%}
{# Bouton ICS #}
{%- if present -%}
{%- endif -%}
{% endfor %}
{% endif %}
{% endif %}
{# Afficher la date limite d'inscription s'il y en a une, éditable si on est admin #}
{% if line.cloture == 'O' %}Clôturé
{% else %}
{% if est_admin == true %}{% endif %}
{% if line.dateLimiteInscription is null %}{% else %}{{ line.dateLimiteInscription|date('d/m/Y') }}{% endif %}
{% if est_admin is defined %}{% endif %}
{% endif %}
{{ line.dateDebut|date('d/m/Y') }}
{{ line.dateFin|date('d/m/Y') }}
{% if est_admin == true or line.clubOrganisateur != ''%}
{% if est_admin == true %}Organisateur: {% endif %}
{% if est_admin == true %}{% endif %}
{{ line.clubOrganisateur }}
{% if est_admin == true %}{% endif %}
{% endif %}
{% if est_admin == true or line.nomConcours != ''%}
{% if est_admin == true %}Nom: {% endif %}
{% if est_admin == true %}{% endif %}
{{ line.nomConcours }}
{% if est_admin == true %}{% endif %}
{% endif %}
{% if est_admin == true or line.formule != ''%}
{% if est_admin == true %}Formule: {% endif %}
{% if est_admin == true %}{% endif %}
{{line.formule}}
{% if est_admin == true %}{% endif %}
{% endif %}
{% if est_admin == true or line.caracteristiques != ''%}
{% if est_admin == true %}Caractéristiques: {% endif %}
{% if est_admin == true %}{% endif %}
{% if est_admin == false %}{% endif %}
{{line.caracteristiques}}
{% if est_admin == false %}{% endif %}
{% if est_admin == true %}{% endif %}