templates/bundles/EasyAdminBundle/layout.html.twig line 1

  1. {# @var ea \EasyCorp\Bundle\EasyAdminBundle\Context\AdminContext #}
  2. {% trans_default_domain ea.i18n.translationDomain %}
  3. <!DOCTYPE html>
  4. <html lang="{{ ea.i18n.htmlLocale }}" dir="{{ ea.i18n.textDirection }}" data-turbo="false">
  5. <head>
  6.     {% block head_metas %}
  7.         <meta charset="utf-8">
  8.         <meta http-equiv="X-UA-Compatible" content="IE=edge">
  9.         <meta name="robots" content="noindex, nofollow, noarchive, nosnippet, noodp, noimageindex, notranslate, nocache" />
  10.         <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
  11.         <meta name="generator" content="EasyAdmin" />
  12.     {% endblock head_metas %}
  13.     {% set page_title_block_output %}{% block page_title %}{{ block('content_title') }}{% endblock %}{% endset %}
  14.     <title>{{ page_title_block_output|striptags|raw }}</title>
  15.     {% block head_stylesheets %}
  16.         <link rel="stylesheet" href="{{ asset('app.css', ea.assets.defaultAssetPackageName) }}">
  17.     {% endblock %}
  18.     {% block configured_stylesheets %}
  19.         {{ include('@EasyAdmin/includes/_css_assets.html.twig', { assets: ea.assets.cssAssets ?? [] }, with_context = false) }}
  20.         {{ include('@EasyAdmin/includes/_encore_link_tags.html.twig', { assets: ea.assets.webpackEncoreAssets ?? [] }, with_context = false) }}
  21.     {% endblock %}
  22.     {% block head_favicon %}
  23.         <link rel="shortcut icon" href="{{ asset(ea.dashboardFaviconPath) }}">
  24.     {% endblock %}
  25.     {% block head_javascript %}
  26.         <script src="{{ asset('app.js', ea.assets.defaultAssetPackageName) }}"></script>
  27.     {% endblock head_javascript %}
  28.     {% block configured_javascripts %}
  29.         {{ include('@EasyAdmin/includes/_js_assets.html.twig', { assets: ea.assets.jsAssets ?? [] }, with_context = false) }}
  30.         {{ include('@EasyAdmin/includes/_encore_script_tags.html.twig', { assets: ea.assets.webpackEncoreAssets ?? [] }, with_context = false) }}
  31.     {% endblock %}
  32.     {% if 'rtl' == ea.i18n.textDirection %}
  33.         <link rel="stylesheet" href="{{ asset('app.rtl.css', ea.assets.defaultAssetPackageName) }}">
  34.     {% endif %}
  35.     {% block configured_head_contents %}
  36.         {% for htmlContent in ea.assets.headContents ?? [] %}
  37.             {{ htmlContent|raw }}
  38.         {% endfor %}
  39.     {% endblock %}
  40.     <link rel="preconnect" href="https://fonts.googleapis.com">
  41.     <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
  42.     <link href="https://fonts.googleapis.com/css2?family=Ubuntu&display=swap" rel="stylesheet">
  43.     <style>
  44.         .header-custom {
  45.             color: #1B75BC;
  46.             font-family: "Ubuntu", sans-serif;
  47.         }
  48.         .header-title-baseline {
  49.             font-weight: 500;
  50.             font-size: 3em;
  51.         }
  52.         .header-title-baseline-baseline {
  53.             font-weight: 300;
  54.             font-size: 1em;
  55.         }
  56.         .header-title {
  57.             margin-right: 2em;
  58.         }
  59.         .header-logo {
  60.             margin-left: 2em;
  61.         }
  62.         .banner-container {
  63.             width: 100%;
  64.             height: 80px;
  65.             background-color: #1B75BC;
  66.             display: flex;
  67.             justify-content: center;
  68.             align-items: center;
  69.         }
  70.         .banner-container > p {
  71.             font-size: 25px;
  72.             color: #e8e8e8;
  73.             text-shadow: 0px 2px 10px #000000;
  74.         }
  75.     </style>
  76.     <link rel="stylesheet" href="{{ asset('style.css') }}">
  77. </head>
  78. {% block body %}
  79.     <body {% block body_attr %}{% endblock %}
  80.             id="{% block body_id %}{% endblock %}"
  81.             class="ea {% block body_class %}{% endblock %}"
  82.             data-ea-content-width="{{ ea.crud.contentWidth ?? ea.dashboardContentWidth ?? 'normal' }}"
  83.             data-ea-sidebar-width="{{ ea.crud.sidebarWidth ?? ea.dashboardSidebarWidth ?? 'normal' }}"
  84.             data-ea-dark-scheme-is-enabled="{{ ea.dashboardHasDarkModeEnabled ? 'true' : 'false' }}"
  85.     >
  86.     {% block javascript_page_layout %}
  87.         <script src="{{ asset('page-layout.js', ea.assets.defaultAssetPackageName) }}"></script>
  88.     {% endblock javascript_page_layout %}
  89.     {% block javascript_page_color_scheme %}
  90.         <script src="{{ asset('page-color-scheme.js', ea.assets.defaultAssetPackageName) }}"></script>
  91.     {% endblock javascript_page_color_scheme %}
  92.     <div class="w-100 bg-white d-flex justify-content-between header-custom">
  93.         <div class="header-logo">
  94.             <img src="{{ asset('/static/admin/image/logo_site.png') }}" alt="Logo Institut d'Études Scientifiques Cargèse">
  95.         </div>
  96.         <div class="header-title d-flex align-items-center">
  97.             <span class="header-title-baseline">Institut d'Études Scientifiques | </span>&nbsp;&nbsp;<span class="header-title-baseline-baseline">Cargèse</span>
  98.         </div>
  99.     </div>
  100.     {% block wrapper_wrapper %}
  101.         {% block flash_messages %}
  102.             {{ include(ea.templatePath('flash_messages')) }}
  103.         {% endblock flash_messages %}
  104.         {% set user_menu_avatar %}
  105.             {% if null == ea.userMenu.avatarUrl %}
  106.                 <span class="user-avatar">
  107.                     <span class="fa-stack">
  108.                         <i class="user-avatar-icon-background fas fa-square fa-stack-2x"></i>
  109.                         <i class="user-avatar-icon-foreground {{ ea.user is not null ? 'fa fa-user' : 'fas fa-user-slash' }} fa-stack-1x fa-inverse"></i>
  110.                     </span>
  111.                 </span>
  112.             {% else %}
  113.                 <img class="user-avatar" src="{{ ea.userMenu.avatarUrl }}" />
  114.             {% endif %}
  115.         {% endset %}
  116.         {% set impersonator_permission = constant('Symfony\\Component\\Security\\Core\\Authorization\\Voter\\AuthenticatedVoter::IS_IMPERSONATOR') is defined ? 'IS_IMPERSONATOR' : 'ROLE_PREVIOUS_ADMIN' %}
  117.     <div class="page-actions">
  118.         <div class="global-actions">
  119.         {% set user_menu_dropdown %}
  120.             <div>
  121.                     <div style="padding-right: 10px">
  122.                         <span class="user-name">{{ ea.user is null ? 'user.anonymous'|trans(domain = 'EasyAdminBundle') : ea.userMenu.name }}</span>
  123.                     </div>
  124.             </div>
  125.                 {% block user_menu %}
  126.                     {% if ea.userMenu.items|length > 0 %}
  127.                         {% for item in ea.userMenu.items %}
  128.                                 {% if not item.isMenuSection %}
  129.                                     <a href="{{ item.linkUrl }}" class="user-action {{ item.cssClass }}"
  130.                                        target="{{ item.linkTarget }}" rel="{{ item.linkRel }}"
  131.                                        referrerpolicy="origin-when-cross-origin">
  132.                                         {% if item.icon is not empty %}<i class="fa fa-fw {{ item.icon }}"></i>{% endif %}
  133.                                         {{ item.label|trans }}
  134.                                     </a>
  135.                                 {% endif %}
  136.                         {% endfor %}
  137.                     {% endif %}
  138.                 {% endblock user_menu %}
  139.         {% endset %}
  140.         {% set settings_dropdown %}
  141.             {% if ea.dashboardLocales or ea.dashboardHasDarkModeEnabled %}
  142.                 <div style="padding-left: 50px">
  143.                         {% if ea.dashboardLocales %}
  144.                             {% for localeDto in ea.dashboardLocales %}
  145.                                     <a href="{{ ea_url().set('_locale', localeDto.locale) }}" class="{% if app.request.locale == localeDto.locale %} active{% endif %}">
  146.                                         {% if localeDto.icon %}
  147.                                             <i class="{{ localeDto.icon }}"></i>
  148.                                         {% endif %}
  149.                                         {{ localeDto.name }}
  150.                                     </a>
  151.                             {% endfor %}
  152.                         {% endif %}
  153.                 </div>
  154.             {% endif %}
  155.         {% endset %}
  156.         </div>
  157.     </div>
  158.         <div class="wrapper">
  159.             {% block wrapper %}
  160.                 <div class="responsive-header">
  161.                     {% block responsive_header %}
  162.                         <button id="navigation-toggler" type="button" aria-label="Toggle navigation">
  163.                             <i class="fa fa-fw fa-bars"></i>
  164.                         </button>
  165.                         <div id="responsive-header-logo" class="text-truncate ms-auto">
  166.                             {% block responsive_header_logo %}
  167.                                 <a class="responsive-logo" title="{{ ea.dashboardTitle|striptags }}" href="{{ path(ea.dashboardRouteName) }}">
  168.                                     {{ ea.dashboardTitle|raw }}
  169.                                 </a>
  170.                             {% endblock responsive_header_logo %}
  171.                         </div>
  172.                         <div class="dropdown user-menu-wrapper {{ is_granted(impersonator_permission) ? 'user-is-impersonated' }} ms-auto">
  173.                             <a class="user-details" type="button" data-bs-toggle="dropdown" data-bs-offset="0,5" aria-expanded="false">
  174.                                 {# to make the site design consistent, always display the user avatar in responsive header
  175.                                    and hide the user name (because there's no space left) regardless of the user config #}
  176.                                 {% if ea.userMenu.avatarDisplayed %}
  177.                                     {{ user_menu_avatar }}
  178.                                 {% else %}
  179.                                     <i class="user-avatar fa fa-fw {{ ea.user is not null ? 'fa-user' : 'fa-user-times' }}"></i>
  180.                                 {% endif %}
  181.                             </a>
  182.                             {{ user_menu_dropdown }}
  183.                         </div>
  184.                         {{ settings_dropdown }}
  185.                     {% endblock responsive_header %}
  186.                 </div>
  187.                 <div class="sidebar-wrapper">
  188.                     <aside class="sidebar">
  189.                         {% block sidebar %}
  190.                             <header class="main-header">
  191.                                 {% block header %}
  192.                                     <nav class="navbar" role="navigation">
  193.                                         {% block header_navbar %}
  194.                                             <div id="header-logo">
  195.                                                 {% block header_logo %}
  196.                                                     <a class="logo" title="{{ ea.dashboardTitle|striptags }}" href="{{ path(ea.dashboardRouteName) }}">
  197.                                                         <span class="logo-custom">{{ ea.dashboardTitle|raw }}</span>
  198.                                                         <span class="logo-compact"><i class="fas fa-home"></i></span>
  199.                                                     </a>
  200.                                                 {% endblock header_logo %}
  201.                                             </div>
  202.                                         {% endblock header_navbar %}
  203.                                     </nav>
  204.                                 {% endblock header %}
  205.                             </header>
  206.                             {% block main_menu_wrapper %}
  207.                                 {{ include(ea.templatePath('main_menu')) }}
  208.                             {% endblock main_menu_wrapper %}
  209.                         {% endblock sidebar %}
  210.                         <div id="sidebar-resizer-handler" class="resizer-handler resizer-handler-left"></div>
  211.                     </aside>
  212.                 </div>
  213.                 <section class="main-content">
  214.                     {% set has_search = ea.crud is not null and ea.crud.isSearchEnabled %}
  215.                     <aside class="content-top {{ has_search ? 'ea-search-enabled' : 'ea-search-disabled' }}">
  216.                         {% block content_top_header %}
  217.                             <div class="content-search">
  218.                                 {% if has_search %}
  219.                                     {% block search %}
  220.                                         <form class="form-action-search" method="get">
  221.                                             {% block search_form %}
  222.                                                 {% block search_form_filters %}
  223.                                                     {% for field, array in ea.search.appliedFilters %}
  224.                                                         {% for key, value in array %}
  225.                                                             {# This code re-applies your filters on searches, an iterable check is needed in cases we have more than one object for a filter #}
  226.                                                             {% if value is iterable %}
  227.                                                                 {% for index, iterValue in value %}
  228.                                                                     {# This sub-level iterable check is needed in cases we have more complex filters like the DateTimeFilter cf. issue #5038 #}
  229.                                                                     {% if iterValue is iterable %}
  230.                                                                         {% for subIndex, subIterValue in iterValue %}
  231.                                                                             <input type="hidden" name="filters[{{ field }}][{{ key }}][{{ index }}][{{ subIndex }}]" value="{{ subIterValue }}">
  232.                                                                         {% endfor %}
  233.                                                                     {% else %}
  234.                                                                         <input type="hidden" name="filters[{{ field }}][{{ key }}][{{ index }}]" value="{{ iterValue }}">
  235.                                                                     {% endif %}
  236.                                                                 {% endfor %}
  237.                                                             {% else %}
  238.                                                                 <input type="hidden" name="filters[{{ field }}][{{ key }}]" value="{{ value }}">
  239.                                                             {% endif %}
  240.                                                         {% endfor %}
  241.                                                     {% endfor %}
  242.                                                 {% endblock %}
  243.                                                 <input type="hidden" name="crudAction" value="index">
  244.                                                 <input type="hidden" name="crudControllerFqcn" value="{{ ea.request.query.get('crudControllerFqcn') }}">
  245.                                                 <input type="hidden" name="menuIndex" value="{{ ea.request.query.get('menuIndex') }}">
  246.                                                 <input type="hidden" name="submenuIndex" value="{{ ea.request.query.get('submenuIndex') }}">
  247.                                                 <input type="hidden" name="page" value="1">
  248.                                                 <div class="form-group">
  249.                                                     <div class="form-widget">
  250.                                                         <i class="fas fa-search content-search-icon"></i>
  251.                                                         <label class="content-search-label" data-value="{{ app.request.get('query') }}">
  252.                                                             <input class="form-control {{ app.request.get('query') is null ? 'is-blank' }}" type="search" name="query" value="{{ app.request.get('query') ?? '' }}" placeholder="{{ t('action.search', ea.i18n.translationParameters, 'EasyAdminBundle')|trans }}" spellcheck="false" autocorrect="off" onInput="this.parentNode.dataset.value=this.value"{% if ea.crud.currentAction == 'index' and ea.crud.autofocusSearch == true %} autofocus="autofocus"{% endif %}>
  253.                                                         </label>
  254.                                                         {% if app.request.get('query') %}
  255.                                                             <a href="{{ ea_url().unset('query') }}" class="content-search-reset">
  256.                                                                 <i class="fas fa-fw fa-times"></i>
  257.                                                             </a>
  258.                                                         {% endif %}
  259.                                                     </div>
  260.                                                 </div>
  261.                                             {% endblock %}
  262.                                         </form>
  263.                                     {% endblock search %}
  264.                                 {% endif %}
  265.                             </div>
  266.                             {% if ea.user is null %}
  267.                                 <a class="btn btn-primary" style="margin-right: 15px;" href="{{ path('app_login') }}">{{ 'menu.btn.login'|trans([], 'admin') }}</a>
  268.                                 <a class="btn btn-secondary" href="{{ path('app_register') }}">{{ 'menu.btn.register'|trans([], 'admin') }}</a>
  269.                             {% endif %}
  270.                             {% if ea.user is not null %}
  271.                                 {% block header_custom_menu %}
  272.                                         {{ user_menu_dropdown }}
  273.                                 {% endblock header_custom_menu %}
  274.                             {% endif %}
  275.                             {{ settings_dropdown }}
  276.                         {% endblock content_top_header %}
  277.                     </aside>
  278.                     <div class="banner-container">
  279.                         {% set has_help_message = (ea.crud.helpMessage ?? '') is not empty %}
  280.                         <p class="mb-0">{% block content_title %}{% endblock %}
  281.                             {% block content_help %}
  282.                                 {% if has_help_message %}
  283.                                     <a tabindex="0" class="content-header-help" data-bs-toggle="popover" data-bs-custom-class="ea-content-help-popover" data-bs-animation="true" data-bs-html="true" data-bs-placement="bottom" data-bs-trigger="focus" data-bs-content="{{ ea.crud.helpMessage|trans|e('html_attr') }}">
  284.                                         <i class="far fa-question-circle"></i>
  285.                                     </a>
  286.                                 {% endif %}
  287.                             {% endblock %}</p>
  288.                     </div>
  289.                     <div class="content-wrapper">
  290.                         {% block content %}
  291.                             <article class="content">
  292.                                 {% block content_header_wrapper %}
  293.                                     {% set has_help_message = (ea.crud.helpMessage ?? '') is not empty %}
  294.                                     <section class="content-header">
  295.                                         {% block content_header %}
  296.                                             <div class="content-header-title">
  297.                                                 <h1 class="title">
  298.                                                 </h1>
  299.                                             </div>
  300.                                             {% block page_actions_wrapper %}
  301.                                                 <div class="page-actions">{% block page_actions %}{% endblock %}</div>
  302.                                             {% endblock %}
  303.                                         {% endblock content_header %}
  304.                                     </section>
  305.                                 {% endblock content_header_wrapper %}
  306.                                 <section id="main" class="content-body">
  307.                                     {% block main %}{% endblock %}
  308.                                 </section>
  309.                                 {% block content_footer_wrapper %}
  310.                                     {% set content_footer = block('content_footer') is defined ? block('content_footer') : '' %}
  311.                                     {% if content_footer is not empty %}
  312.                                         <section class="content-footer">
  313.                                             {{ content_footer }}
  314.                                         </section>
  315.                                     {% endif %}
  316.                                 {% endblock %}
  317.                             </article>
  318.                         {% endblock content %}
  319.                         <div id="content-resizer-handler" class="resizer-handler resizer-handler-right"></div>
  320.                     </div>
  321.                 </section>
  322.             {% endblock wrapper %}
  323.         </div>
  324.     {% endblock wrapper_wrapper %}
  325.     {% block body_javascript %}{% endblock body_javascript %}
  326.     <script type="text/javascript">
  327.         document.addEventListener('DOMContentLoaded', function () {
  328.             // INSCRIPTION
  329.             // VALIDATION PRE-INSCRIPTION / INSCRIPTION
  330.             document.getElementById('soumissionInscription')?.addEventListener('click', function(event) {
  331.                 var isInscription = document.getElementById('tablist-tab-form-inscription-tab-voyage');
  332.                 // Infos personnelles
  333.                 var Inscription_institution = document.getElementById('Inscription_institution')?.value;
  334.                 var Inscription_nationalite = document.getElementById('Inscription_nationalite')?.value;
  335.                 var Inscription_telephone = document.getElementById('Inscription_telephone')?.value;
  336.                 
  337.                 // Infos scientifiques
  338.                 var Inscription_situationScientifique = document.getElementById('Inscription_situationScientifique')?.value;
  339.                 var Inscription_contextScientifique = document.getElementById('Inscription_contextScientifique')?.value;
  340.                 var Inscription_qualiteScientifique = document.getElementById('Inscription_qualiteScientifique')?.value;
  341.                 
  342.                 // Votre voyage
  343.                 var Inscription_dateArrive = document.getElementById('Inscription_dateArrive')?.value;
  344.                 var Inscription_dateDepart = document.getElementById('Inscription_dateDepart')?.value;
  345.                 var Inscription_modeTransport = document.getElementById('Inscription_modeTransport')?.value;
  346.                 var Inscription_villeArrive = document.getElementById('Inscription_villeArrive')?.value;
  347.                 var Inscription_referenceVoyage = document.getElementById('Inscription_referenceVoyage')?.value;
  348.                 var Inscription_modeTransfert = document.getElementById('Inscription_modeTransfert')?.value;
  349.                 
  350.                 // Votre Logement
  351.                 var Inscription_logementDateDebut = document.getElementById('Inscription_logementDateDebut')?.value;
  352.                 var Inscription_logementDateFin = document.getElementById('Inscription_logementDateFin')?.value;
  353.                 var Inscription_logementLieu = document.getElementById('Inscription_logementLieu')?.value;
  354.                 
  355.                 // Votre Régime alimentaire
  356.                 
  357.                 // Accompagnants
  358.                 if(isInscription) {
  359.                     // TODO : ajouter les champs obligatoires pour l'inscription (sur tous les onglets)
  360.                     if (Inscription_institution.trim() === ''
  361.                         || Inscription_nationalite.trim() === ''
  362.                         || Inscription_telephone.trim() === ''
  363.                         || Inscription_situationScientifique.trim() === ''
  364.                         || Inscription_contextScientifique.trim() === ''
  365.                         || Inscription_qualiteScientifique.trim() === ''
  366.                         || Inscription_dateArrive.trim() === ''
  367.                         || Inscription_dateDepart.trim() === ''
  368.                         || Inscription_modeTransport.trim() === ''
  369.                         || Inscription_villeArrive.trim() === ''
  370.                         || Inscription_referenceVoyage.trim() === ''
  371.                         || Inscription_modeTransfert.trim() === ''
  372.                         || Inscription_logementDateDebut.trim() === ''
  373.                         || Inscription_logementDateFin.trim() === ''
  374.                         || Inscription_logementLieu.trim() === ''
  375.                     ) {
  376.                         event.preventDefault();
  377.                         window.alert('{{ 'dialog.action.required'|trans([], 'admin') }}')
  378.                     }
  379.                 } else {
  380.                     // TODO : ajouter les champs obligatoires pour la pre-inscription (Sur les deux premiers onglets)
  381.                     if (Inscription_institution.trim() === ''
  382.                         || Inscription_nationalite.trim() === ''
  383.                         || Inscription_telephone.trim() === ''
  384.                     ) {
  385.                         event.preventDefault();
  386.                         window.alert('{{ 'dialog.action.required'|trans([], 'admin') }}')
  387.                     }
  388.                 }
  389.             });
  390.             // BOUTONS DE VALIDATION
  391.             document.querySelectorAll('.validerInscription').forEach(function(bouton) {
  392.                 bouton.addEventListener('click', function() {
  393.                     var confirmed = window.confirm('{{ 'dialog.action.message'|trans([], 'admin') }}');
  394.                     if (!confirmed) {
  395.                         event.preventDefault();
  396.                     }
  397.                 });
  398.             });
  399.             document.querySelectorAll('.refuserInscription').forEach(function(bouton) {
  400.                 bouton.addEventListener('click', function() {
  401.                     var confirmed = window.confirm('{{ 'dialog.action.message'|trans([], 'admin') }}');
  402.                     if (!confirmed) {
  403.                         event.preventDefault();
  404.                     }
  405.                 });
  406.             });
  407.             document.querySelectorAll('.validerPreInscription').forEach(function(bouton) {
  408.                 bouton.addEventListener('click', function() {
  409.                     var confirmed = window.confirm('{{ 'dialog.action.message'|trans([], 'admin') }}');
  410.                     if (!confirmed) {
  411.                         event.preventDefault();
  412.                     }
  413.                 });
  414.             });
  415.             document.querySelectorAll('.refuserPreInscription').forEach(function(bouton) {
  416.                 bouton.addEventListener('click', function() {
  417.                     var confirmed = window.confirm('{{ 'dialog.action.message'|trans([], 'admin') }}');
  418.                     if (!confirmed) {
  419.                         event.preventDefault();
  420.                     }
  421.                 });
  422.             });
  423.             document.querySelectorAll('.listeAttentePreInscription').forEach(function(bouton) {
  424.                 bouton.addEventListener('click', function() {
  425.                     var confirmed = window.confirm('{{ 'dialog.action.message'|trans([], 'admin') }}');
  426.                     if (!confirmed) {
  427.                         event.preventDefault();
  428.                     }
  429.                 });
  430.             });
  431.             var InscriptionQualiteScientifique = document.getElementById('Inscription_qualiteScientifique');
  432.             InscriptionQualiteScientifique?.addEventListener('change', function () {
  433.                 var InscriptionEcoleSingle = document.getElementById('Inscription_ecole_single');
  434.                 var InscriptionEcoleAccompagnants = document.getElementById('Inscription_ecole_accompagnants');
  435.                 if(InscriptionEcoleSingle != null && !InscriptionEcoleSingle.value) {
  436.                     InscriptionEcoleSingle.value = '0';
  437.                 }
  438.                 if(InscriptionEcoleAccompagnants != null && !InscriptionEcoleAccompagnants.value) {
  439.                     InscriptionEcoleAccompagnants.value = '0';
  440.                 }
  441.                 // Vérifiez si l'option avec la valeur 8 est sélectionnée
  442.                 var isOption8Selected = Array.from(InscriptionQualiteScientifique.options).some(function(option) {
  443.                     return option.value === '8' && option.selected;
  444.                 });
  445.                 // Logique pour déterminer si le champ conditionnel doit être affiché ou masqué
  446.                 // Sélectionnez tous les radios avec le nom "Inscription[logementMode]"
  447.                 var radios = document.querySelectorAll('input[name="Inscription[logementMode]"]');
  448.                 // Désactivez tous les radios
  449.                 radios.forEach(function(radio) {
  450.                     radio.disabled = isOption8Selected && InscriptionEcoleSingle.value === '0';
  451.                 });
  452.                 var tabAccompagnant = document.getElementById('tablist-tab-form-inscription-tab-accompagnant');
  453.                 if(tabAccompagnant != null) {
  454.                     if(isOption8Selected && InscriptionEcoleAccompagnants.value === '0') {
  455.                         tabAccompagnant.style.display = 'none';
  456.                     } else {
  457.                         tabAccompagnant.style.display = 'block';
  458.                     }
  459.                 }
  460.             });
  461.             InscriptionQualiteScientifique?.dispatchEvent(new Event('change'));
  462.             // ECOLE
  463.             document.getElementById('submitAndValidate')?.addEventListener('click', function() {
  464.                 var confirmed = window.confirm('{{ 'dialog.action.message'|trans([], 'admin') }}');
  465.                 if (!confirmed) {
  466.                     event.preventDefault();
  467.                 }
  468.             });
  469.             document.getElementById('submitAndValidateNoEmail')?.addEventListener('click', function() {
  470.                 var confirmed = window.confirm('{{ 'dialog.action.message'|trans([], 'admin') }}');
  471.                 if (!confirmed) {
  472.                     event.preventDefault();
  473.                 }
  474.             });
  475.             document.getElementById('submitAndReject')?.addEventListener('click', function() {
  476.                 var confirmed = window.confirm('{{ 'dialog.action.message'|trans([], 'admin') }}');
  477.                 if (!confirmed) {
  478.                     event.preventDefault();
  479.                 }
  480.             });
  481.             document.getElementById('submitAndDraft')?.addEventListener('click', function() {
  482.                 var confirmed = window.confirm('{{ 'dialog.action.message'|trans([], 'admin') }}');
  483.                 if (!confirmed) {
  484.                     event.preventDefault();
  485.                 }
  486.             });
  487.             var ecoleDatePreInscriptionDebut = document.getElementById('Ecole_datePreInscriptionDebut')
  488.             var ecoleDatePreInscriptionFin = document.getElementById('Ecole_datePreInscriptionFin')
  489.             var ecoleDateInscriptionDebut = document.getElementById('Ecole_dateInscriptionDebut')
  490.             var ecoleDateInscriptionFin = document.getElementById('Ecole_dateInscriptionFin')
  491.             var ecoleModeInscriptionPlaceholder = document.getElementById('Ecole_modeInscription_placeholder');
  492.             var ecoleModeInscriptionPlaceholder0 = document.getElementById('Ecole_modeInscription_0');
  493.             var ecoleModeInscriptionPlaceholder1 = document.getElementById('Ecole_modeInscription_1');
  494.             ecoleModeInscriptionPlaceholder?.addEventListener('change', function () {
  495.                 // tout griser
  496.                 if(ecoleModeInscriptionPlaceholder.checked) {
  497.                     ecoleDatePreInscriptionDebut.disabled = true;
  498.                     ecoleDatePreInscriptionFin.disabled = true;
  499.                     ecoleDateInscriptionDebut.disabled = true;
  500.                     ecoleDateInscriptionFin.disabled = true;
  501.                 }
  502.             })
  503.             ecoleModeInscriptionPlaceholder0?.addEventListener('change', function () {
  504.                 // griser pre inscriptions
  505.                 if(ecoleModeInscriptionPlaceholder0.checked) {
  506.                     ecoleDatePreInscriptionDebut.disabled = true;
  507.                     ecoleDatePreInscriptionFin.disabled = true;
  508.                     ecoleDateInscriptionDebut.disabled = false;
  509.                     ecoleDateInscriptionFin.disabled = false;
  510.                 }
  511.             })
  512.             ecoleModeInscriptionPlaceholder1?.addEventListener('change', function () {
  513.                 // tout visible
  514.                 if(ecoleModeInscriptionPlaceholder1.checked) {
  515.                     ecoleDatePreInscriptionDebut.disabled = false;
  516.                     ecoleDatePreInscriptionFin.disabled = false;
  517.                     ecoleDateInscriptionDebut.disabled = false;
  518.                     ecoleDateInscriptionFin.disabled = false;
  519.                 }
  520.             })
  521.             ecoleModeInscriptionPlaceholder?.dispatchEvent(new Event('change'));
  522.             ecoleModeInscriptionPlaceholder0?.dispatchEvent(new Event('change'));
  523.             ecoleModeInscriptionPlaceholder1?.dispatchEvent(new Event('change'));
  524.         });
  525.     </script>
  526.     {% block configured_body_contents %}
  527.         {% for htmlContent in ea.assets.bodyContents ?? [] %}
  528.             {{ htmlContent|raw }}
  529.         {% endfor %}
  530.     {% endblock %}
  531.     </body>
  532. {% endblock body %}
  533. </html>