templates/inscription/form-eligibilite-inscription.html.twig line 1

Open in your IDE?
  1. {% extends "layout.html.twig" %}
  2. {# Configs Générales #}
  3. {% set nbSlide = 16 %}
  4. {% block content %}
  5. <main id="main" role="main">
  6.     {{ pimcore_areablock('contentTop') }}
  7.     {% if editmode %}
  8.         <div class="uk-container apk-container-600 uk-text-center uk-margin-top">
  9.             <h3>Image par défaut</h3>
  10.             {{ pimcore_image("section-questions-img_default", {'width' : 100, 'height' : 100}) }}
  11.         </div>
  12.         <!-- .section-questions -->
  13.         <section class="uk-section">
  14.             <div class="section-questions">
  15.                 
  16.                 {% for i in 1..nbSlide %}
  17.                     <div class="uk-container uk-margin-bottom">
  18.                         <div uk-grid>
  19.                             <div class="uk-width-1-1">
  20.                                 <div class="section-questions-container">
  21.                                     <div style="background: #1e87f0; color: #FFF; width: 50px; height: 50px; line-height: 50px; text-align: center; font-size: 20px; font-weight: bold; position: absolute; left: 0; top: 50%; transform: translate(-50%, -50%); border-radius: 50%;">
  22.                                         {{ i }}
  23.                                     </div>
  24.                                     <div class="section-questions-container-icon uk-align-center uk-position-relative uk-flex uk-flex-middle">
  25.                                         {{ pimcore_image("section-questions-img_" ~ i, {'width' : 100, 'height' : 100}) }}
  26.                                     </div>
  27.                                     <div class="uk-container apk-container-600">
  28.                                         <h3 class="h-big-lowcase-grey">{{ pimcore_input("label-question_" ~ i) }}</h3>
  29.                                         <!--<div class="questions">
  30.                                             contenu
  31.                                         </div>-->
  32.                                     </div>
  33.                                 </div>
  34.                             </div>
  35.                         </div>
  36.                     </div>
  37.                     {% if i == 2 or i == 5 %}
  38.                         <div class="uk-container uk-margin-bottom">
  39.                             <div uk-grid>
  40.                                 <div class="uk-width-1-1">
  41.                                     <div class="section-questions-container">
  42.                                         <div style="background: #1e87f0; color: #FFF; width: 50px; height: 50px; line-height: 50px; text-align: center; font-size: 20px; font-weight: bold; position: absolute; left: 0; top: 50%; transform: translate(-50%, -50%); border-radius: 50%;">
  43.                                             {{ i }}.1
  44.                                         </div>
  45.                                         <div class="section-questions-container-icon uk-align-center uk-position-relative uk-flex uk-flex-middle">
  46.                                             {{ pimcore_image("section-questions-img_" ~ i ~ "-1", {'width' : 100, 'height' : 100}) }}
  47.                                         </div>
  48.                                         <div class="uk-container apk-container-600">
  49.                                             <h3 class="h-big-lowcase-grey">{{ pimcore_input("label-question_" ~ i ~ "-1") }}</h3>
  50.                                         <!-- <div class="questions">
  51.                                                 contenu
  52.                                             </div>-->
  53.                                         </div>
  54.                                     </div>
  55.                                 </div>
  56.                             </div>
  57.                         </div>
  58.                     {% endif %}
  59.                 {% endfor %}
  60.                     <div class="uk-container uk-margin-bottom">
  61.                         <div uk-grid>
  62.                             <div class="uk-width-1-1">
  63.                                 <div class="section-questions-container">
  64.                                     <div style="background: #1e87f0; color: #FFF; width: 50px; height: 50px; line-height: 50px; text-align: center; font-size: 16px; font-weight: bold; position: absolute; left: 0; top: 50%; transform: translate(-50%, -50%); border-radius: 50%;">
  65.                                         END
  66.                                     </div>
  67.                                     <div class="section-questions-container-icon uk-align-center uk-position-relative uk-flex uk-flex-middle">
  68.                                         {{ pimcore_image("section-questions-img_end", {"width" : 100, "height" : 100}) }}
  69.                                     </div>
  70.                                     <div class="uk-container apk-container-600">
  71.                                         <h3 class="h-big-lowcase-grey">{{ pimcore_input("label-question_end") }}</h3>
  72.                                         <div class="questions">
  73.                                             <div>
  74.                                                 {{ pimcore_wysiwyg("content-question_end") }}
  75.                                             </div>
  76.                                         </div>
  77.                                         {% if not pimcore_website_config('akimediaActivate') %}
  78.                                         <div class="uk-alert uk-alert-primary" uk-alert>
  79.                                             {{ pimcore_link("btn-action-question-end") }}                
  80.                                         </div>
  81.                                         {% endif %}
  82.                                     </div>
  83.                                 </div>
  84.                             </div>
  85.                         </div>
  86.                         {% if not pimcore_website_config('akimediaActivate') %}
  87.                         <div class="section-questions-container">
  88.                             <div class="uk-alert-primary uk-margin-medium-bottom" uk-alert>
  89.                                 <h3 class="uk-h3">SKIP TEST LINK</h3>
  90.                                 {{ pimcore_link("btn-action-skip-test") }}
  91.                             </div>
  92.                         </div>
  93.                         {% endif %}
  94.                     </div>
  95.             </div>
  96.         
  97.         </section>
  98.         
  99.     {% else %}
  100.         <!-- .section-questions -->
  101.         <div class="uk-container apk-container-1400">
  102.             <div>
  103.                 <section class="section-questions-padding">
  104.                     <div class="section-questions">
  105.                         <div uk-grid>
  106.                             <div class="uk-width-1-1">
  107.                                 <div class="section-questions-container">
  108.                                     <progress class="uk-progress" id="apk-progress-bar-question" value="0" max="100"></progress>
  109.                                     <div class="section-questions-container-icon uk-align-center uk-position-relative uk-flex uk-flex-middle">
  110.                                         {{ pimcore_image("section-questions-img_1", {
  111.                                             "attributes" : {
  112.                                                 "data-apk-image-step" : "1"
  113.                                             }
  114.                                         }) }}
  115.                                     </div>
  116.                                     <form id="form-quipeutdonnersonsang" class="uk-form-stacked" data-prev-step="0"
  117.                                         data-current-step="1">
  118.                                         <div class="uk-container">
  119.                                             <div class="questions">
  120.                                                 {#
  121.                                                 #--------------------------------
  122.                                                 # Question 1 : Homme / Femme
  123.                                                 #--------------------------------
  124.                                                 #}
  125.                                                 <div data-question="1">
  126.                                                     <h3 class="h-big-lowcase-grey">
  127.                                                         <span class="step-number">1.</span>
  128.                                                         {{ pimcore_input("label-question_1") }}
  129.                                                     </h3>
  130.                                                     <div class="question-message-before"></div>
  131.                                                     <div class="uk-form-controls">
  132.                                                         <label><input class="uk-radio is-autovalidate" type="radio" name="q1" value="Homme"
  133.                                                                         autocomplete="false"/>
  134.                                                                 <span>{{ 'Homme'|trans }}</span></label>
  135.                                                         <label><input class="uk-radio is-autovalidate" type="radio" name="q1" value="Femme"
  136.                                                                         autocomplete="false"/>
  137.                                                                 <span>{{ 'Femme'|trans }}</span></label>
  138.                                                         <button type="button" class="next apk-btn-secondary uk-hidden">{{ 'Valider'|trans }}</button>
  139.                                                     </div>
  140.                                                 </div>
  141.                                                 {#
  142.                                                 #--------------------------------
  143.                                                 # Question 2 : Date de naissance
  144.                                                 #--------------------------------
  145.                                                 #}
  146.                                                 <div data-question="2" class="uk-hidden">
  147.                                                     <h3 class="h-big-lowcase-grey">
  148.                                                         <span class="step-number">2.</span>
  149.                                                         {{ pimcore_input("label-question_2") }}
  150.                                                     </h3>
  151.                                                     <div class="question-message-before"></div>
  152.                                                     <div class="uk-form-controls">
  153.                                                         <div class="apk-form-inline">
  154.                                                             <input class="uk-input" type="text" name="q2"
  155.                                                                 placeholder="{{"jj/mm/aaaa"|trans }}"
  156.                                                                 value=""
  157.                                                                 data-toggle="datepicker" autocomplete="false"/>
  158.                                                             <button type="button" class="next apk-btn-secondary">{{ 'Valider'|trans }}</button>
  159.                                                         </div>
  160.                                                     </div>
  161.                                                 </div>
  162.                                                 {#
  163.                                                 #--------------------------------
  164.                                                 # Question 2.1 : Avez-vous fait un don ces trois dernières années ?
  165.                                                 #--------------------------------
  166.                                                 #}
  167.                                                 <div data-question="2.1" class="uk-hidden">
  168.                                                     <h3 class="h-big-lowcase-grey">
  169.                                                         
  170.                                                         {{ pimcore_input("label-question_2-1") }}
  171.                                                     </h3>
  172.                                                     <div class="question-message-before"></div>
  173.                                                     <div class="uk-form-controls">
  174.                                                         <label><input class="uk-radio is-autovalidate" type="radio" name="q2.1" value="Oui"
  175.                                                                         autocomplete="false"/>
  176.                                                                 <span>{{ 'Oui'|trans }}</span></label>
  177.                                                         <label><input class="uk-radio is-autovalidate" type="radio" name="q2.1" value="Non"
  178.                                                                         autocomplete="false" data-message="i18ln_erreur5"
  179.                                                                         data-color="red" data-where="after"/>
  180.                                                                 <span>{{ 'Non'|trans }}</span></label>
  181.                                                         <label><input class="uk-radio is-autovalidate" type="radio" name="q2.1"
  182.                                                                         value="Je ne sais pas"
  183.                                                                         autocomplete="false" data-message="i18ln_erreur6"
  184.                                                                         data-color="red" data-where="after"/>
  185.                                                             {{ 'Je ne sais pas'|trans }}</label>
  186.                                                         <button type="button" class="next apk-btn-secondary uk-hidden">{{ 'Valider'|trans }}</button>
  187.                                                     </div>
  188.                                                 </div>
  189.                                                 {#
  190.                                                 #--------------------------------
  191.                                                 # Question 3 : Quel est votre poids et votre taille ?
  192.                                                 #--------------------------------
  193.                                                 #}
  194.                                                 <div data-question="3" class="uk-hidden">
  195.                                                     <h3 class="h-big-lowcase-grey">
  196.                                                         <span class="step-number">3.</span>
  197.                                                         {{ pimcore_input("label-question_3") }}
  198.                                                     </h3>
  199.                                                     <div class="question-message-before"></div>
  200.                                                     <div class="uk-form-controls">
  201.                                                         <div class="apk-form-inline">
  202.                                                             <input class="uk-input" type="number" name="q3" min="0" max="200"
  203.                                                                 autocomplete="false"/> {{ 'Kg'|trans }}
  204.                                                             <input class="uk-input uk-margin-left" type="number" name="q3taille" min="0" max="300"
  205.                                                                 autocomplete="false"/> {{ 'Cm'|trans }}
  206.                                                             <button type="button" class="uk-margin-left next apk-btn-secondary">{{ 'Valider'|trans }}</button>
  207.                                                         </div>
  208.                                                     </div>
  209.                                                 </div>
  210.                                                 {#
  211.                                                 #--------------------------------
  212.                                                 # Question 4 : De 1980 à 1996, avez-vous séjourné plus de 6 mois (tous séjours confondus) au Royaume-Uni
  213.                                                 #--------------------------------
  214.                                                 #}
  215.                                                 <div data-question="4" class="uk-hidden">
  216.                                                     <h3 class="h-big-lowcase-grey">
  217.                                                         <span class="step-number">4.</span>
  218.                                                         {{ pimcore_input("label-question_4") }}
  219.                                                     </h3>
  220.                                                     <div class="question-message-before"></div>
  221.                                                     <div class="uk-form-controls">
  222.                                                         <label><input class="uk-radio" type="radio" name="q4" value="Oui"
  223.                                                                         autocomplete="false" data-message="i18ln_erreur9"
  224.                                                                         data-color="red" data-where="after"/>
  225.                                                                 <span>{{ 'Oui'|trans }}</span></label>
  226.                                                         <label><input class="uk-radio is-autovalidate" type="radio" name="q4" value="Non"
  227.                                                                         autocomplete="false"/>
  228.                                                                 <span>{{ 'Non'|trans }}</span></label>
  229.                                                         <button type="button" class="next apk-btn-secondary uk-hidden">{{ 'Valider'|trans }}</button>
  230.                                                     </div>
  231.                                                 </div>
  232.                                                 {#
  233.                                                 #--------------------------------
  234.                                                 # Question 5 : Avez-vous voyagé hors de la Belgique ces 6 derniers mois?
  235.                                                 #--------------------------------
  236.                                                 #}
  237.                                                 <div data-question="5" class="uk-hidden">
  238.                                                     <h3 class="h-big-lowcase-grey">
  239.                                                         <span class="step-number">5.</span>
  240.                                                         {{ pimcore_input("label-question_5") }}
  241.                                                     </h3>
  242.                                                     <div class="question-message-before"></div>
  243.                                                     <div class="uk-form-controls">
  244.                                                         <label><input class="uk-radio is-autovalidate" type="radio" name="q5" value="Oui"
  245.                                                                         autocomplete="false"/>
  246.                                                                 <span>{{ 'Oui'|trans }}</span></label>
  247.                                                         <label><input class="uk-radio is-autovalidate" type="radio" name="q5" value="Non"
  248.                                                                         autocomplete="false"/>
  249.                                                                 <span>{{ 'Non'|trans }}</span></label>
  250.                                                         <button type="button" class="next apk-btn-secondary uk-hidden">{{ 'Valider'|trans }}</button>
  251.                                                     </div>
  252.                                                 </div>
  253.                                                 {#
  254.                                                 #--------------------------------
  255.                                                 # Question 5.1 : Avez-vous voyagé à l’extérieur de l’Europe ?
  256.                                                 #--------------------------------
  257.                                                 #}
  258.                                                 <div data-question="5.1" class="uk-hidden">
  259.                                                     <h3 class="h-big-lowcase-grey">
  260.                                                         <span class="step-number">5.1.</span>
  261.                                                         {{ pimcore_input("label-question_5-1") }}
  262.                                                     </h3>
  263.                                                     <div class="question-message-before"></div>
  264.                                                     <div class="uk-form-controls">
  265.                                                         <label><input class="uk-radio" type="radio" name="q5.1" value="Oui"
  266.                                                                     autocomplete="false" data-message="i18ln_erreur11"
  267.                                                                     data-color="red" data-where="after"/>
  268.                                                             <span>{{ 'Oui'|trans }}</span></label>
  269.                                                         <label><input class="uk-radio" type="radio" name="q5.1" value="Non"
  270.                                                                         autocomplete="false" data-message="i18ln_erreur10"
  271.                                                                         data-color="red" data-where="after"/>
  272.                                                                 <span>{{ 'Non'|trans }}</span></label>
  273.                                                         <button type="button" class="next apk-btn-secondary uk-hidden">{{ 'Valider'|trans }}</button>
  274.                                                     </div>
  275.                                                 </div>
  276.                                                 {#
  277.                                                 #--------------------------------
  278.                                                 # Question 6 : êtes-vous enceinte ou avez-vous accouché dans les 6 derniers mois ?
  279.                                                 #--------------------------------
  280.                                                 #}
  281.                                                 
  282.                                                 <div data-question="6" class="uk-hidden">
  283.                                                     <h3 class="h-big-lowcase-grey">
  284.                                                         <span class="step-number">6.</span>
  285.                                                         {{ pimcore_input("label-question_6") }}
  286.                                                     </h3>
  287.                                                     <div class="question-message-before"></div>
  288.                                                     <div class="uk-form-controls">
  289.                                                         <label><input class="uk-radio" type="radio" name="q6" value="Oui"
  290.                                                                         autocomplete="false" data-message="i18ln_erreur12"
  291.                                                                         data-color="red" data-where="after"/>
  292.                                                                 <span>{{ 'Oui'|trans }}</span></label>
  293.                                                         <label><input class="uk-radio is-autovalidate" type="radio" name="q6" value="Non"/>
  294.                                                             <span>{{ 'Non'|trans }}</span></label>
  295.                                                         <button type="button" class="next apk-btn-secondary uk-hidden">{{ 'Valider'|trans }}</button>
  296.                                                     </div>
  297.                                                 </div>
  298.                                                 
  299.                                                 {#
  300.                                                 #--------------------------------
  301.                                                 # Question 7 : Avez-vous eu récemment de la fièvre ou une infection (bronchite, infection urinaire...) ?
  302.                                                 #--------------------------------
  303.                                                 #}
  304.                                                 <div data-question="7" class="uk-hidden">
  305.                                                     <h3 class="h-big-lowcase-grey">
  306.                                                         <span class="step-number">7.</span>
  307.                                                         {{ pimcore_input("label-question_7") }}
  308.                                                     </h3>
  309.                                                     <div class="question-message-before"></div>
  310.                                                     <div class="uk-form-controls">
  311.                                                         <label><input class="uk-radio" type="radio" name="q7" value="Oui"
  312.                                                                         autocomplete="false" data-message="i18ln_erreur13"
  313.                                                                         data-color="red" data-where="after"/>
  314.                                                                 <span>{{ 'Oui'|trans }}</span></label>
  315.                                                         <label><input class="uk-radio is-autovalidate" type="radio" name="q7" value="Non"/>
  316.                                                             <span>{{ 'Non'|trans }}</span></label>
  317.                                                         <button type="button" class="next apk-btn-secondary uk-hidden">{{ 'Valider'|trans }}</button>
  318.                                                     </div>
  319.                                                 </div>
  320.                                                 {#
  321.                                                 #--------------------------------
  322.                                                 # Question 8 : Prenez-vous des médicaments ?
  323.                                                 #--------------------------------
  324.                                                 #}
  325.                                                 <div data-question="8" class="uk-hidden">
  326.                                                     <h3 class="h-big-lowcase-grey">
  327.                                                         <span class="step-number">8.</span>
  328.                                                         {{ pimcore_input("label-question_8") }}
  329.                                                     </h3>
  330.                                                     <div class="question-message-before"></div>
  331.                                                     <div class="uk-form-controls" data-apk-toggle-target="#toggle-q8-yes">
  332.                                                         <label><input class="uk-radio" type="radio" name="q8" value="Oui"
  333.                                                                         autocomplete="false" data-apk-toggle="true"/>
  334.                                                                 <span>{{ 'Oui'|trans }}</span></label>
  335.                                                         <label><input class="uk-radio is-autovalidate" type="radio" name="q8" value="Non"
  336.                                                                         autocomplete="false" data-apk-toggle="false"/>
  337.                                                                 <span>{{ 'Non'|trans }}</span></label>
  338.                                                         <button type="button" class="next apk-btn-secondary uk-hidden">{{ 'Valider'|trans }}</button>
  339.                                                     </div>
  340.                                                     <div id="toggle-q8-yes" class="apk-listing-medicine" style="display: none;">
  341.                                                         <h4>{{ 'Cochez les médicaments que vous prenez dans la liste ci-dessous'|trans }}</h4>
  342.                                                         <div class="uk-form-controls has-serialize-checkbox">
  343.                                                             <div class="uk-text-left uk-grid-small" uk-grid>
  344.                                                                 <div class="uk-width-1-3@s">
  345.                                                                     <!-- complement_1 -->
  346.                                                                     <div class="uk-position-relative"><label><input class="uk-checkbox" type="checkbox" name="q8.1"
  347.                                                                                     value="{{ 'Spray nasal'|trans }}"
  348.                                                                                     autocomplete="false" data-message="false"
  349.                                                                                     data-complement="true"
  350.                                                                                     data-where="complement_1" />
  351.                                                                             <span>{{ 'Spray nasal'|trans }}</span>
  352.                                                                         </label></div>
  353.                                                                     <div class="uk-position-relative"><label><input class="uk-checkbox" type="checkbox" name="q8.1"
  354.                                                                                     value="{{ 'Spray pour la gorge'|trans }}"
  355.                                                                                     autocomplete="false" data-message="false"
  356.                                                                                     data-complement="true"
  357.                                                                                     data-where="complement_1" />
  358.                                                                             <span>{{ 'Spray pour la gorge'|trans }}</span>
  359.                                                                         </label></div>
  360.                                                                     <div class="uk-position-relative"><label><input class="uk-checkbox" type="checkbox" name="q8.1"
  361.                                                                                     value="{{ 'Spray pour la toux'|trans }}"
  362.                                                                                     autocomplete="false" data-message="false"
  363.                                                                                     data-complement="true"
  364.                                                                                     data-where="complement_1" />
  365.                                                                             <span>{{ 'Spray pour la toux'|trans }}</span>
  366.                                                                         </label></div>
  367.                                                                     <div class="uk-position-relative"><label><input class="uk-checkbox" type="checkbox" name="q8.1"
  368.                                                                                     value="{{ 'Anthihistaminiques'|trans }}"
  369.                                                                                     autocomplete="false" data-message="false"
  370.                                                                                     data-complement="true"
  371.                                                                                     data-where="complement_1"/>
  372.                                                                             <span>{{ 'Anthihistaminiques'|trans }}</span>
  373.                                                                         </label></div>
  374.                                                                     <!-- complement_2 -->
  375.                                                                     <div class="uk-position-relative"><label><input class="uk-checkbox" type="checkbox" name="q8.2"
  376.                                                                                     value="{{ 'Antibiotiques'|trans }}"
  377.                                                                                     autocomplete="false" data-message="false"
  378.                                                                                     data-complement="true"
  379.                                                                                     data-where="complement_2" />
  380.                                                                             <span>{{ 'Antibiotiques'|trans }}</span>
  381.                                                                         </label></div>
  382.                                                                     <!-- complement_1 -->
  383.                                                                     <div class="uk-position-relative"><label><input class="uk-checkbox" type="checkbox" name="q8.1"
  384.                                                                                     value="{{ 'Dafalgan / paracétamol'|trans }}"
  385.                                                                                     autocomplete="false" data-message="false"
  386.                                                                                     data-complement="true"
  387.                                                                                     data-where="complement_1"/>
  388.                                                                             <span>{{ 'Dafalgan / paracétamol'|trans }}</span>
  389.                                                                         </label></div>
  390.                                                                     <!-- complement_3 -->
  391.                                                                     <div class="uk-position-relative"><label><input class="uk-checkbox" type="checkbox" name="q8.3"
  392.                                                                                     value="{{ 'Aspirine / anti-inflammatoires (Nurofen, Ibruprofen, Perdofemina...)'|trans }}"
  393.                                                                                     autocomplete="false" data-message="false"
  394.                                                                                     data-complement="true"
  395.                                                                                     data-where="complement_3"/>
  396.                                                                             <span>{{ 'Aspirine / anti-inflammatoires (Nurofen, Ibruprofen, Perdofemina...)'|trans }}</span>
  397.                                                                         </label></div>
  398.                                                                 </div>
  399.                                                                 <div class="uk-width-1-3@s">
  400.                                                                     <!-- complement_1 -->
  401.                                                                     <div class="uk-position-relative"><label><input class="uk-checkbox" type="checkbox" name="q8.1"
  402.                                                                                     value="{{ 'Antiacides comme Pantomed (Pantoprazole), Losec (Omeprazole)'|trans }}"
  403.                                                                                     autocomplete="false" data-message="false"
  404.                                                                                     data-complement="true"
  405.                                                                                     data-where="complement_1"/>
  406.                                                                             <span>{{ 'Antiacides comme Pantomed (Pantoprazole), Losec (Omeprazole)'|trans }}</span>
  407.                                                                         </label></div>
  408.                                                                     <div class="uk-position-relative"><label><input class="uk-checkbox" type="checkbox" name="q8.1"
  409.                                                                                     value="{{ 'Somnifères'|trans }}"
  410.                                                                                     autocomplete="false" data-message="false"
  411.                                                                                     data-complement="true"
  412.                                                                                     data-where="complement_1"/>
  413.                                                                             <span>{{ 'Somnifères'|trans }}</span>
  414.                                                                         </label></div>
  415.                                                                     <!-- complement_4 -->
  416.                                                                     <div class="uk-position-relative"><label><input class="uk-checkbox" type="checkbox" name="q8.4"
  417.                                                                                     value="{{ 'Isotrétinoïne (Traitement contre l\'acné)'|trans }}"
  418.                                                                                     autocomplete="false" data-message="false"
  419.                                                                                     data-complement="true"
  420.                                                                                     data-where="complement_4"/>
  421.                                                                             <span>{{ 'Isotrétinoïne (Traitement contre l\'acné)'|trans }}</span>
  422.                                                                         </label></div>
  423.                                                                     <div class="uk-position-relative"><label><input class="uk-checkbox" type="checkbox" name="q8.4"
  424.                                                                                     value="{{ 'Finastéride (Traitement pour la prostate ou contre la perte de cheveux)'|trans }}"
  425.                                                                                     autocomplete="false" data-message="false"
  426.                                                                                     data-complement="true"
  427.                                                                                     data-where="complement_4"/>
  428.                                                                             <span>{{ 'Finastéride (Traitement pour la prostate ou contre la perte de cheveux)'|trans }}</span>
  429.                                                                         </label></div>
  430.                                                                 </div>
  431.                                                                 <div class="uk-width-1-3@s">
  432.                                                                     <!-- complement_4 -->
  433.                                                                     <div class="uk-position-relative"><label><input class="uk-checkbox" type="checkbox" name="q8.4"
  434.                                                                                     value="{{ 'Dutastéride (Traitement pour la prostate)'|trans }}"
  435.                                                                                     autocomplete="false" data-message="false"
  436.                                                                                     data-complement="true"
  437.                                                                                     data-where="complement_4"/>
  438.                                                                             <span>{{ 'Dutastéride (Traitement pour la prostate)'|trans }}</span>
  439.                                                                         </label></div>
  440.                                                                     <!-- complement_5 -->
  441.                                                                     <div class="uk-position-relative"><label><input class="uk-checkbox" type="checkbox" name="q8.5"
  442.                                                                                     value="{{ 'Acitrétine (Traitement contre le psoriasis)'|trans }}"
  443.                                                                                     autocomplete="false" data-message="false"
  444.                                                                                     data-complement="true"
  445.                                                                                     data-where="complement_5"/>
  446.                                                                             <span>{{ 'Acitrétine (Traitement contre le psoriasis)'|trans }}</span>
  447.                                                                         </label></div>
  448.                                                                     <!-- complement_6 -->
  449.                                                                     <div class="uk-position-relative"><label><input class="uk-checkbox" type="checkbox" name="q8.6"
  450.                                                                                     value="Oui"
  451.                                                                                     autocomplete="false"
  452.                                                                                     data-message="i18ln_complement_14_6"
  453.                                                                                     data-complement="true"
  454.                                                                                     data-where="complement_6"/>
  455.                                                                             <span>{{ 'Autre(s)'|trans }}</span>
  456.                                                                         </label></div>
  457.                                                                 </div>
  458.                                                             </div>
  459.                                                         </div>
  460.                                                     </div>
  461.                                                 </div>
  462.                                                 {#
  463.                                                 #--------------------------------
  464.                                                 # Question 9 : Avez-vous été vacciné.e il y a moins d’un mois ?
  465.                                                 #--------------------------------
  466.                                                 #}
  467.                                                 <div data-question="9" class="uk-hidden">
  468.                                                     <h3 class="h-big-lowcase-grey">
  469.                                                         <span class="step-number">9.</span>
  470.                                                         {{ pimcore_input("label-question_9") }}
  471.                                                     </h3>
  472.                                                     <div class="question-message-before"></div>
  473.                                                     <div class="uk-form-controls" data-apk-toggle-target="#toggle-q9-yes">
  474.                                                         <label><input class="uk-radio" type="radio" name="q9" value="Oui"
  475.                                                                         autocomplete="false" data-apk-toggle="true"/>
  476.                                                                 <span>{{ 'Oui'|trans }}</span></label>
  477.                                                         <label><input class="uk-radio is-autovalidate" type="radio" name="q9" value="Non"
  478.                                                                         data-apk-toggle="false"/>
  479.                                                                 <span>{{ 'Non'|trans }}</span></label>
  480.                                                         <button type="button" class="next apk-btn-secondary uk-hidden">{{ 'Valider'|trans }}</button>
  481.                                                     </div>
  482.                                                     <div id="toggle-q9-yes" style="display: none; padding-bottom: 15px;">
  483.                                                         <hr class="uk-margin-medium-top"/>
  484.                                                         <div class="uk-form-controls" data-apk-where="common"
  485.                                                             data-apk-message="i18ln_complement_15_common"
  486.                                                             data-apk-question="9">
  487.                                                             <div class="uk-text-left uk-grid-small" uk-grid>
  488.                                                                 <div class="uk-width-1-3@s">
  489.                                                                     <div><label><input class="uk-checkbox" type="checkbox" name="q9.1"
  490.                                                                                     value="{{ 'Hépatite B'|trans }}"
  491.                                                                                     autocomplete="false"
  492.                                                                                     data-message="i18ln_complement_15_1"
  493.                                                                                     data-color="false" data-complement="true"
  494.                                                                                     data-where="complement_1"/>
  495.                                                                             <span>{{ 'Hépatite B'|trans }}</span>
  496.                                                                         </label>
  497.                                                                     </div>
  498.                                                                     <div><label><input class="uk-checkbox" type="checkbox" name="q9.2"
  499.                                                                                     value="{{ 'Coqueluche'|trans }}"
  500.                                                                                     autocomplete="false"
  501.                                                                                     data-message="i18ln_complement_15_3"
  502.                                                                                     data-color="false" data-complement="true"
  503.                                                                                     data-where="complement_3"/>
  504.                                                                             <span>{{ 'Coqueluche'|trans }}</span>
  505.                                                                         </label>
  506.                                                                     </div>
  507.                                                                     <div><label><input class="uk-checkbox" type="checkbox" name="q9.3"
  508.                                                                                     value="{{ 'Grippe'|trans }}"
  509.                                                                                     autocomplete="false"
  510.                                                                                     data-message="i18ln_complement_15_3"
  511.                                                                                     data-color="false" data-complement="true"
  512.                                                                                     data-where="complement_3"/>
  513.                                                                             <span>{{ 'Grippe'|trans }}</span>
  514.                                                                         </label>
  515.                                                                     </div>
  516.                                                                 </div>
  517.                                                                 <div class="uk-width-1-3@s">
  518.                                                                     <div><label><input class="uk-checkbox" type="checkbox" name="q9.4"
  519.                                                                                     value="{{ 'Fièvre Jaune'|trans }}"
  520.                                                                                     autocomplete="false"
  521.                                                                                     data-message="i18ln_complement_15_2"
  522.                                                                                     data-color="false" data-complement="true"
  523.                                                                                     data-where="complement_2"/>
  524.                                                                             <span>{{ 'Fièvre Jaune'|trans }}</span>
  525.                                                                         </label>
  526.                                                                     </div>
  527.                                                                     <div><label><input class="uk-checkbox" type="checkbox" name="q9.5"
  528.                                                                                     value="{{ 'Tétanos'|trans }}"
  529.                                                                                     autocomplete="false"
  530.                                                                                     data-message="i18ln_complement_15_3"
  531.                                                                                     data-color="false" data-complement="true"
  532.                                                                                     data-where="complement_3"/>
  533.                                                                             <span>{{ 'Tétanos'|trans }}</span>
  534.                                                                         </label>
  535.                                                                     </div>
  536.                                                                 </div>
  537.                                                                 <div class="uk-width-1-3@s">
  538.                                                                     <div><label><input class="uk-checkbox" type="checkbox" name="q9.7"
  539.                                                                                     value="{{ 'SARS-CoV-2 (COVID 19)'|trans }}"
  540.                                                                                     autocomplete="false"
  541.                                                                                     data-message="i18ln_complement_15_5"
  542.                                                                                     data-color="false" data-complement="true"
  543.                                                                                     data-where="complement_5"/>
  544.                                                                             <span>{{ 'SARS-CoV-2 (COVID 19)'|trans }}</span>
  545.                                                                         </label>
  546.                                                                     </div>
  547.                                                                     <div><label><input class="uk-checkbox" type="checkbox" name="q9.6"
  548.                                                                                     value="{{ 'Autre'|trans }}"
  549.                                                                                     autocomplete="false"
  550.                                                                                     data-message="i18ln_complement_15_4"
  551.                                                                                     data-color="false" data-complement="true"
  552.                                                                                     data-where="complement_4"/>
  553.                                                                             <span>{{ 'Autre'|trans }}</span>
  554.                                                                         </label>
  555.                                                                     </div>
  556.                                                                 </div>
  557.                                                             </div>
  558.                                                         </div>
  559.                                                     </div>
  560.                                                 </div>
  561.                                                 {#
  562.                                                 #--------------------------------
  563.                                                 # Question 10 : Avez-vous subi une endoscopie (arthroscopie, gastroscopie, coloscopie…) ou une opération dans les 4 derniers mois ?
  564.                                                 #--------------------------------
  565.                                                 #}
  566.                                                 <div data-question="10" class="uk-hidden">
  567.                                                     <h3 class="h-big-lowcase-grey">
  568.                                                         <span class="step-number">10.</span>
  569.                                                         {{ pimcore_input("label-question_10") }}
  570.                                                     </h3>
  571.                                                     <div class="question-message-before"></div>
  572.                                                     <div class="uk-form-controls">
  573.                                                         <label><input class="uk-radio" type="radio" name="q10" value="Oui"
  574.                                                                         autocomplete="false" data-message="i18ln_erreur16"
  575.                                                                         data-color="red" data-where="after"/>
  576.                                                                 <span>{{ 'Oui'|trans }}</span></label>
  577.                                                         <label><input class="uk-radio is-autovalidate" type="radio" name="q10"
  578.                                                                         value="Non"/>
  579.                                                                 <span>{{ 'Non'|trans }}</span></label>
  580.                                                         <button type="button" class="next apk-btn-secondary uk-hidden">{{ 'Valider'|trans }}</button>
  581.                                                     </div>
  582.                                                 </div>
  583.                                                 {#
  584.                                                 #--------------------------------
  585.                                                 # Question 11 : êtes-vous allé.e chez le dentiste au cours des 7 derniers jours ?
  586.                                                 #--------------------------------
  587.                                                 #}
  588.                                                 <div data-question="11" class="uk-hidden">
  589.                                                     <h3 class="h-big-lowcase-grey"><span class="step-number">11.</span>
  590.                                                         {{ pimcore_input("label-question_11") }}
  591.                                                     </h3>
  592.                                                     <div class="question-message-before"></div>
  593.                                                     <div class="uk-form-controls">
  594.                                                         <label><input class="uk-radio" type="radio" name="q11" value="Oui"
  595.                                                                         autocomplete="false" data-message="i18ln_info17"
  596.                                                                         data-color="red" data-where="after"/>
  597.                                                             <span>{{ 'Oui'|trans }}</span></label>
  598.                                                         <label><input class="uk-radio is-autovalidate" type="radio" name="q11"
  599.                                                                         value="Non"/>
  600.                                                             <span>{{ 'Non'|trans }}</span></label>
  601.                                                         <button type="button" class="next apk-btn-secondary uk-hidden">{{ 'Valider'|trans }}</button>
  602.                                                     </div>
  603.                                                 </div>
  604.                                                 {#
  605.                                                 #--------------------------------
  606.                                                 # Question 12 : Avez-vous fait un piercing (y compris boucles d’oreilles) ou un tatouage (y compris maquillage permanent) durant ces 4 derniers mois ?
  607.                                                 #--------------------------------
  608.                                                 #}
  609.                                                 <div data-question="12" class="uk-hidden">
  610.                                                     <h3 class="h-big-lowcase-grey">
  611.                                                         <span class="step-number">12.</span>
  612.                                                         {{ pimcore_input("label-question_12") }}
  613.                                                     </h3>
  614.                                                     <div class="question-message-before"></div>
  615.                                                     <div class="uk-form-controls">
  616.                                                         <label><input class="uk-radio" type="radio" name="q12" value="Oui"
  617.                                                                         autocomplete="false" data-message="i18ln_erreur18"
  618.                                                                         data-color="red" data-where="after"/>
  619.                                                             <span>{{ 'Oui'|trans }}</span></label>
  620.                                                         <label><input class="uk-radio is-autovalidate" type="radio" name="q12"
  621.                                                                         value="Non"/>
  622.                                                             <span>{{ 'Non'|trans }}</span></label>
  623.                                                         <button type="button" class="next apk-btn-secondary uk-hidden">{{ 'Valider'|trans }}</button>
  624.                                                     </div>
  625.                                                 </div>
  626.                                                 {#
  627.                                                 #--------------------------------
  628.                                                 # Question 13 : Avez-vous déjà consommé de la drogue ?
  629.                                                 #--------------------------------
  630.                                                 #}
  631.                                                 <div data-question="13" class="uk-hidden">
  632.                                                     <h3 class="h-big-lowcase-grey">
  633.                                                         <span class="step-number">13.</span>
  634.                                                         {{ pimcore_input("label-question_13") }}
  635.                                                     </h3>
  636.                                                     <div class="question-message-before"></div>
  637.                                                     <div class="uk-form-controls">
  638.                                                         <label><input class="uk-radio" type="radio" name="q13" value="Oui"
  639.                                                                         autocomplete="false" data-message="i18ln_info19"
  640.                                                                         data-color="red" data-where="after"/>
  641.                                                             <span>{{ 'Oui'|trans }}</span></label>
  642.                                                         <label><input class="uk-radio is-autovalidate" type="radio" name="q13"
  643.                                                                         value="Non"/>
  644.                                                             <span>{{ 'Non'|trans }}</span></label>
  645.                                                         <button type="button" class="next apk-btn-secondary uk-hidden">{{ 'Valider'|trans }}</button>
  646.                                                     </div>
  647.                                                 </div>
  648.                                                 {#
  649.                                                 #--------------------------------
  650.                                                 # Question 14 : Avez-vous eu un.e nouveau.elle partenaire sexuel.le au cours des 4 derniers mois ? (avec ou sans préservatif)
  651.                                                 #--------------------------------
  652.                                                 #}
  653.                                                 <div data-question="14" class="uk-hidden">
  654.                                                     {# Si répondu F (femme) à la Q2 #}
  655.                                                     <h3 class="h-big-lowcase-grey">
  656.                                                         <span class="step-number">14.</span>
  657.                                                         {{ pimcore_input("label-question_14") }}
  658.                                                     </h3>
  659.                                                     <div class="question-message-before"></div>
  660.                                                     <div class="uk-form-controls">
  661.                                                         <label><input class="uk-radio" type="radio" name="q14" value="Oui"
  662.                                                                         autocomplete="false" data-message="i18ln_erreur20"
  663.                                                                         data-color="red" data-where="after"/>
  664.                                                                 <span>{{ 'Oui'|trans }}</span></label>
  665.                                                         <label><input class="uk-radio is-autovalidate" type="radio" name="q14"
  666.                                                                         value="Non"/>
  667.                                                                 <span>{{ 'Non'|trans }}</span></label>
  668.                                                         <button type="button" class="next apk-btn-secondary uk-hidden">{{ 'Valider'|trans }}</button>
  669.                                                     </div>
  670.                                                 </div>
  671.                                                 {#
  672.                                                 #--------------------------------
  673.                                                 # Question 15 : Avez-vous eu une nouvelle partenaire sexuelle au cours des 4 derniers mois ? (avec ou sans préservatif)
  674.                                                 #--------------------------------
  675.                                                 #}
  676.                                                 <div data-question="15" class="uk-hidden">
  677.                                                     {# Si répondu H (homme) à la Q2 #}
  678.                                                     <h3 class="h-big-lowcase-grey">
  679.                                                         <span class="step-number">15.</span>
  680.                                                         {{ pimcore_input("label-question_15") }}
  681.                                                     </h3>
  682.                                                     <div class="question-message-before"></div>
  683.                                                     <div class="uk-form-controls">
  684.                                                         <label><input class="uk-radio" type="radio" name="q15" value="Oui"
  685.                                                                         autocomplete="false" data-message="i18ln_erreur21"
  686.                                                                         data-color="red" data-where="after"/>
  687.                                                             <span>{{ 'Oui'|trans }}</span></label>
  688.                                                         <label><input class="uk-radio is-autovalidate" type="radio" name="q15"
  689.                                                                         value="Non"/>
  690.                                                             <span>{{ 'Non'|trans }}</span></label>
  691.                                                         <button type="button" class="next apk-btn-secondary uk-hidden">{{ 'Valider'|trans }}</button>
  692.                                                     </div>
  693.                                                 </div>
  694.                                                 {#
  695.                                                 #--------------------------------
  696.                                                 # Question 16 : Au cours des 12 derniers mois, avez-vous eu une relation sexuelle avec un homme ?
  697.                                                 #--------------------------------
  698.                                                 #}
  699.                                                 <div data-question="16" class="uk-hidden">
  700.                                                     {# Si répondu H (homme) à la Q2 #}
  701.                                                     <h3 class="h-big-lowcase-grey">
  702.                                                         <span class="step-number">16.</span>
  703.                                                         {{ pimcore_input("label-question_16") }}
  704.                                                     </h3>
  705.                                                     <div class="question-message-before"></div>
  706.                                                     <div class="uk-form-controls">
  707.                                                         <label><input class="uk-radio" type="radio" name="q16" value="Oui"
  708.                                                                         autocomplete="false" data-message="i18ln_erreur22"
  709.                                                                         data-color="red" data-where="after"/>
  710.                                                             <span>{{ 'Oui'|trans }}</span></label>
  711.                                                         <label><input class="uk-radio is-autovalidate" type="radio" name="q16"
  712.                                                                         value="Non"/>
  713.                                                             <span>{{ 'Non'|trans }}</span></label>
  714.                                                         <button type="button" class="next apk-btn-secondary uk-hidden">{{ 'Valider'|trans }}</button>
  715.                                                     </div>
  716.                                                 </div>
  717.                                                 {#
  718.                                                 #--------------------------------
  719.                                                 # END : Merci d’avoir fait le test !
  720.                                                 #--------------------------------
  721.                                                 #}
  722.                                                 <div data-question="end" class="uk-hidden">
  723.                                                     {# fin #}
  724.                                                     <h3 class="h-big-lowcase-grey">
  725.                                                         <span class="step-number">End.</span>
  726.                                                         {{ pimcore_input("label-question_end") }}
  727.                                                     </h3>
  728.                                                     <div>
  729.                                                         {{ pimcore_wysiwyg("content-question_end") }}
  730.                                                     </div>
  731.                                                     <div class="uk-margin-top">
  732.                                                         {% if pimcore_website_config('akimediaActivate') %}
  733.                                                             <a href="{{ path("inscriptionCentre", {id: centre}) }}" class="uk-button uk-button-primary">{{ "Je m'inscris"|trans }}</a>
  734.                                                         {% else %}
  735.                                                             {{ pimcore_link("btn-action-question-end") }}            
  736.                                                         {% endif %}
  737.                                                     </div>
  738.                                                 </div>
  739.                                             </div>
  740.                                             <div class="apk-step-actions uk-grid uk-text-center uk-text-left@s">
  741.                                                 <div class="uk-width-expand@s">
  742.                                                     <button type="button" class="start">{{ 'Retour au début'|trans }}</button>
  743.                                                 </div>
  744.                                                 <div class="uk-width-auto@s">
  745.                                                     <button type="button" class="prev uk-hidden">
  746.                                                         {{ 'Précédent'|trans }}
  747.                                                     </button>
  748.                                                     <button type="button" class="next-no-matter uk-hidden">
  749.                                                         {{ 'Continuer le test'|trans }}
  750.                                                     </button>
  751.                                                 </div>
  752.                                                 <div class="uk-text-center uk-width-1-1 uk-margin-top">
  753.                                                     {% if pimcore_website_config('akimediaActivate') %}
  754.                                                         <a href="{{ path("inscriptionCentre", {id: centre}) }}">{{ "M'inscrire sans passer le test"|trans }}</a>    
  755.                                                     {% else %}
  756.                                                         {{ pimcore_link("btn-action-skip-test") }}
  757.                                                     {% endif %}
  758.                                                 </div>                                    
  759.                                             </div>
  760.                                             <div class="question-message-container-complement">
  761.                                                 <div class="question-message-complement_1"></div>
  762.                                                 <div class="question-message-complement_2"></div>
  763.                                                 <div class="question-message-complement_3"></div>
  764.                                                 <div class="question-message-complement_4"></div>
  765.                                                 <div class="question-message-complement_5"></div>
  766.                                                 <div class="question-message-complement_6"></div>
  767.                                                 <div class="question-message-common"></div>
  768.                                             </div>
  769.                                             <div class="question-message-after"></div>
  770.                                         </div>
  771.                                     </form>
  772.                                     <div class="apk-step-informations uk-hidden">
  773.                                         <div>Previous Step: <strong id="data-apk-prev-step">0</strong></div>
  774.                                         <div>Current Step: <strong id="data-apk-current-step">1</strong></div>
  775.                                         <!--<span id="data-apk-percent-step">0%</span>-->
  776.                                     </div>
  777.                                 </div>
  778.                             </div>
  779.                         </div>
  780.                     </div>
  781.                 </section>
  782.             </div>
  783.         </div>
  784.         
  785.             {# Pre-chargement des images des différentes étapes #}
  786.             <div data-apk-image-wrapper-step="default" class="uk-hidden uk-invisible">
  787.                 {{ pimcore_image("section-questions-img_default", {
  788.                     "imgAttributes" : {
  789.                         "data-apk-image-step" : "default"
  790.                     }
  791.                 }) }}
  792.             </div>
  793.             {% for i in 1..nbSlide %}
  794.                 <div data-apk-image-wrapper-step="{{i}}" class="uk-hidden uk-invisible">
  795.                     {{ pimcore_image("section-questions-img_" ~ i, {
  796.                         "imgAttributes" : {
  797.                             "data-apk-image-step" : i
  798.                         }
  799.                     }) }}
  800.                 </div>
  801.                 {% if i == 2 or i == 5 %}
  802.                     <div data-apk-image-wrapper-step="{{i}}.1" class="uk-hidden uk-invisible">
  803.                         {{ pimcore_image("section-questions-img_" ~ i ~'-1') }}
  804.                     </div>
  805.                 {% endif %}
  806.             {% endfor %}
  807.             <div data-apk-image-wrapper-step="end" class="uk-hidden uk-invisible">
  808.                 {{ pimcore_image("section-questions-img_end", {
  809.                     "imgAttributes" : {
  810.                         "data-apk-image-step" : "end"    
  811.                     }    
  812.                 }) }}
  813.             </div>
  814.         {% endif %}
  815.         {{ pimcore_areablock('contentBottom') }}
  816.     </main>
  817.     {% endblock content %}
  818.     {% block inlinescripts %}
  819.         
  820.     {% if not editmode %}
  821.     {% if app.request.locale =="nl" %}
  822.         {% set datePickerLang = "nl-NL" %}    
  823.     {% elseif app.request.locale == "de" %}
  824.         {% set datePickerLang = "de-DE" %}    
  825.     {% else %}
  826.         {% set datePickerLang = "fr-FR" %}    
  827.     {% endif %}
  828.     <link rel="stylesheet" href="/static/vendors/datepicker-master/dist/datepicker.min.css">
  829.     <script src="/static/vendors/datepicker-master/dist/datepicker.min.js"></script>
  830.     <script src="/static/vendors/datepicker-master/i18n/datepicker.{{datePickerLang|raw}}.js"></script>
  831.     <script src="/static/vendors/jQuery-Mask-Plugin-master/dist/jquery.mask.min.js"></script>
  832.     
  833.     <script>
  834.         var datepickerInput;
  835.         try {
  836.             datepickerInput = $('[data-toggle="datepicker"]').datepicker({
  837.                 format: 'dd/mm/yyyy',
  838.                 language: '{{datePickerLang}}',
  839.                 autoHide: true
  840.             });
  841.         }
  842.         catch (e) {
  843.     
  844.         }
  845.         $(function () {
  846.             $(document).ready(function () {
  847.                 $('input[data-toggle="datepicker"]').mask('00/00/0000').on('change input paste', function () {
  848.                     var isValid = isValidDate($(this));
  849.                 });
  850.             });
  851.         });
  852.             var $form = $('#form-quipeutdonnersonsang');
  853.             function getAge(dateString) {
  854.                 var today = new Date();
  855.                 var birthDate = new Date(dateString);
  856.                 var age = today.getFullYear() - birthDate.getFullYear();
  857.                 var m = today.getMonth() - birthDate.getMonth();
  858.                 if (m < 0 || (m === 0 && today.getDate() < birthDate.getDate())) {
  859.                     age--;
  860.                 }
  861.                 return age;
  862.             }
  863.             function removeMessage($question) {
  864.                 $question.find('.question-message-before').html('');
  865.                 $form.find('.question-message-after').html('');
  866.                 enableNext();
  867.             }
  868.             function showMessage($question, message, color, where) {
  869.                 removeMessage($question);
  870.                 if(where=='after'){
  871.                     var $error = $form.find('.question-message-' + where);
  872.                 } else if( where=='complement_1' || where=='complement_2' || where=='complement_3' || where=='complement_4' || where=='complement_5' || where=='complement_6') {
  873.                     var $error = $form.find('.question-message-' + where);
  874.                 } else {
  875.                     var $error = $question.find('.question-message-' + where);
  876.                 }
  877.                 $error.html(message).removeClass('question-message--red').removeClass('question-message--yellow').addClass('question-message--' + color);
  878.                 if (color == 'red') {
  879.                     disableNext();
  880.                 } else {
  881.                     enableNext();
  882.                 }
  883.             }
  884.             function resetAllMessage() {
  885.                 $form.find('.question-message-complement_1').html('');
  886.                 $form.find('.question-message-complement_2').html('');
  887.                 $form.find('.question-message-complement_3').html('');
  888.                 $form.find('.question-message-complement_4').html('');
  889.                 $form.find('.question-message-complement_5').html('');
  890.                 $form.find('.question-message-complement_6').html('');
  891.                 $form.find('.question-message-common').html('');
  892.                 $form.find('.question-message-after').html('');
  893.             }
  894.             function disableNext() {
  895.                 $('#form-quipeutdonnersonsang .next').addClass('apk-disabled-button').prop('disabled', true);
  896.                 $('#form-quipeutdonnersonsang .next-no-matter').removeClass('uk-hidden');
  897.             }
  898.             function enableNext() {
  899.                 $('#form-quipeutdonnersonsang .next').removeClass('apk-disabled-button').prop('disabled', false);
  900.                 $('#form-quipeutdonnersonsang .next-no-matter').addClass('uk-hidden');
  901.             }
  902.             function hideNext() {
  903.                 $('#form-quipeutdonnersonsang .next').addClass('uk-hidden');
  904.                 $('#form-quipeutdonnersonsang .next-no-matter').addClass('uk-hidden');
  905.             }
  906.             function hidePrev() {
  907.                 $('#form-quipeutdonnersonsang .prev').addClass('uk-hidden');
  908.             }
  909.             function showPrev() {
  910.                 $('#form-quipeutdonnersonsang .prev').removeClass('uk-hidden');
  911.             }
  912.             function updatePicto(currentStep) {
  913.                 if($('[data-apk-image-wrapper-step = "' + currentStep + '"] img').length){
  914.                     var $html = $('[data-apk-image-wrapper-step = "' + currentStep + '"]').html();
  915.                 } else {
  916.                     var $html = $('[data-apk-image-wrapper-step = "default"]').html();
  917.                 }
  918.                 $('.section-questions-container-icon').html($html)
  919.             }
  920.             var sexe = "";
  921.             function showQuestion(prevNumber, number) {
  922.               if(prevNumber == "1"){
  923.                 sexe = $('input[name="q1"]:checked').val();
  924.               }
  925.                 //console.log('showQuestion ' + number);
  926.                 $form.find('[data-question]').addClass("uk-hidden");
  927.                 $form.find('[data-question="' + number + '"]').removeClass("uk-hidden");
  928.                 if($('#form-quipeutdonnersonsang .next-no-matter').hasClass('uk-hidden')==false){
  929.                     $('#form-quipeutdonnersonsang .next-no-matter').addClass('uk-hidden');
  930.                 }
  931.                 resetAllMessage();
  932.                 //tracking
  933.                 var labelStep = getStepLabelForGATracking(prevNumber);
  934.                 var langue = " {{ app.request.locale }}";
  935.               if(sexe == "Homme" && prevNumber == "16"){
  936.                 window.dataLayer = window.dataLayer || [];
  937.                 window.dataLayer.push({
  938.                   'event': 'test_elibility',
  939.                   'step': "15"+labelStep,
  940.                   'language': langue,
  941.                 });
  942.               }else{
  943.                 window.dataLayer = window.dataLayer || [];
  944.                 window.dataLayer.push({
  945.                   'event': 'test_elibility',
  946.                   'step': prevNumber+labelStep,
  947.                   'language': langue,
  948.                 });
  949.                 if(sexe == "Femme" && prevNumber == "14"){
  950.                   window.dataLayer = window.dataLayer || [];
  951.                   window.dataLayer.push({
  952.                     'event': 'test_elibility',
  953.                     'step': "15-merci",
  954.                     'language': langue,
  955.                   });
  956.                 }
  957.               }
  958.                 if($('#data-apk-prev-step').text()!=false){
  959.                     showPrev();
  960.                 }
  961.                 updateStep(prevNumber, number);
  962.                 updatePicto(number);
  963.                 progressBar(number);
  964.             }
  965.             function getStepLabelForGATracking(step){
  966.               switch (step) {
  967.                 case '1':
  968.                   return "-genre";
  969.                   break;
  970.                 case '2':
  971.                   //case '2.1':
  972.                   return "-date-naissance";
  973.                   break;
  974.                 case '3':
  975.                   return "-poids";
  976.                   break;
  977.                 case '4':
  978.                   return "-sejour-uk";
  979.                   break;
  980.                 case '5':
  981.                   //case '5.1':
  982.                   return "-voyage-hors-Belgique";
  983.                   break;
  984.                 case '6':
  985.                   return "-grossesse";
  986.                   break;
  987.                 case '7':
  988.                   return "-fievre-infection";
  989.                   break;
  990.                 case '8':
  991.                   return "-medicaments";
  992.                   break;
  993.                 case '9':
  994.                   return "-vaccins";
  995.                   break;
  996.                 case '10':
  997.                   return "-endoscopie";
  998.                   break;
  999.                 case '11':
  1000.                   return "-dentiste";
  1001.                   break;
  1002.                 case '12':
  1003.                   return "-piercing-tattoo";
  1004.                   break;
  1005.                 case '13':
  1006.                   return "-drogues";
  1007.                   break;
  1008.                 case '14':
  1009.                   return "-partenaire";
  1010.                   break;
  1011.                 case '15':
  1012.                   if(sexe == "Homme"){
  1013.                     return "-partenaire";
  1014.                   }else{
  1015.                     return '';
  1016.                   }
  1017.                   break;
  1018.                 case '16':
  1019.                   if(sexe == "Homme"){
  1020.                     return "-merci";
  1021.                   }else{
  1022.                     return '';
  1023.                   }
  1024.                   break;
  1025.                 case 'end':
  1026.                   return "-merci";
  1027.                   break;
  1028.               }
  1029.             }
  1030.             function updateStep(prevStep, currentStep) {
  1031.                 // var prev_step = $form.attr('data-prev-step');
  1032.                 // var current_step = $form.attr('data-current-step');
  1033.                 // $('#data-apk-prev-step').text(prev_step);
  1034.                 // $('#data-apk-current-step').text(current_step);
  1035.                 $('#data-apk-prev-step').text(prevStep);
  1036.                 $('#data-apk-current-step').text(currentStep);
  1037.             }
  1038.             function progressBar(currentStep) {
  1039.                 var totalSteps = ($('[data-question]').length - $('[data-question*="."]').length);
  1040.                 var totalProgress = currentStep * 100 / totalSteps;
  1041.                 if(currentStep=='1'){
  1042.                     $('#apk-progress-bar-question').attr('value', 0);
  1043.                 } else if(currentStep=='end') {
  1044.                     $('#apk-progress-bar-question').attr('value', 100);
  1045.                 } else {
  1046.                     $('#apk-progress-bar-question').attr('value', Math.round(totalProgress));
  1047.                 }
  1048.                 // Only for debug/dev
  1049.                 $('#data-apk-percent-step').text(currentStep + '/' + totalSteps + '=>' + Math.round(totalProgress) + '%');
  1050.             }
  1051.             function serializeCheckbox(element, arrayName) {
  1052.                 /*var fields = element.serializeArray();
  1053.                 jQuery.each( fields, function( i, field ) {
  1054.                     console.log( field.value + " " );
  1055.                 });*/
  1056.                 var returnArray = [];
  1057.                 var fields = element.serializeArray();
  1058.                 jQuery.each(fields, function (i, field) {
  1059.                     //console.log( field.value + " " );
  1060.                     returnArray.push(field.value);
  1061.                 });
  1062.                 returnArray = [arrayName, returnArray];
  1063.                 //console.log(returnArray);
  1064.             }
  1065.                 var i18ln_erreur1 = '{{"!!Eligibilité!!erreur1"|trans|raw}}';
  1066.                 var i18ln_erreur2 = '{{"!!Eligibilité!!erreur2"|trans|raw}}';
  1067.                 var i18ln_erreur3 = '{{"!!Eligibilité!!erreur3"|trans|raw}}';
  1068.                 var i18ln_erreur4 = '{{"!!Eligibilité!!erreur4"|trans|raw}}';
  1069.                 var i18ln_erreur5 = '{{"!!Eligibilité!!erreur5"|trans|raw}}';
  1070.                 var i18ln_erreur6 = '{{"!!Eligibilité!!erreur6"|trans|raw}}';
  1071.                 var i18ln_erreur7 = '{{"!!Eligibilité!!erreur7"|trans|raw}}';
  1072.                 var i18ln_erreur8 = '{{"!!Eligibilité!!erreur8"|trans|raw}}';
  1073.                 var i18ln_erreur8_2 = '{{"!!Eligibilité!!erreur8_2"|trans|raw}}';
  1074.                 var i18ln_erreur9 = '{{"!!Eligibilité!!erreur9"|trans|raw}}';
  1075.                 var i18ln_erreur10 = '{{"!!Eligibilité!!erreur10"|trans|raw}}';
  1076.                 var i18ln_erreur11 = '{{"!!Eligibilité!!erreur11"|trans|raw}}';
  1077.                 var i18ln_complement_10_11 = '{{"!!Eligibilité!!complement10_11"|trans|raw}}';
  1078.                 i18ln_erreur10 += '<br/><br/>' + i18ln_complement_10_11;
  1079.                 i18ln_erreur11 += '<br/><br/>' + i18ln_complement_10_11;
  1080.                 var i18ln_erreur12 = '{{"!!Eligibilité!!erreur12"|trans|raw}}';
  1081.                 var i18ln_erreur13 = '{{"!!Eligibilité!!erreur13"|trans|raw}}';
  1082.                 //var i18ln_info14 = 'Attention ! Il arrive que la prise d’un médicament ne pose pas de problème pour le don de sang, mais que la maladie pour laquelle vous le prenez ou l’avez pris soit une contre-indication. En cas de doute, contactez-nous au <strong>0800 92 245</strong> ou envoyez-nous un mail à <strong>info@croix-rouge.be</strong><br /><br />Mentionnez toujours les médicaments que vous prenez au médecin de la collecte.';
  1083.                 var i18ln_complement_14_1 = '{{"!!Eligibilité!!complement14_1"|trans|raw}}';
  1084.                 var i18ln_complement_14_2 = '{{"!!Eligibilité!!complement14_2"|trans|raw}}';
  1085.                 var i18ln_complement_14_3 = '{{"!!Eligibilité!!complement14_3"|trans|raw}}';
  1086.                 var i18ln_complement_14_4 = '{{"!!Eligibilité!!complement14_4"|trans|raw}}';
  1087.                 var i18ln_complement_14_5 = '{{"!!Eligibilité!!complement14_5"|trans|raw}}';
  1088.                 var i18ln_complement_14_6 = '{{"!!Eligibilité!!complement14_6"|trans|raw}}';
  1089.                 var i18ln_complement_14_common = '{{"!!Eligibilité!!complement14_common"|trans|raw}}';
  1090.                 var i18ln_erreur15 = 'CONTENU ETAPE 9';
  1091.                 var i18ln_complement_15_1 = '{{"!!Eligibilité!!complement15_1"|trans|raw}}';
  1092.                 var i18ln_complement_15_2 = '{{"!!Eligibilité!!complement15_2"|trans|raw}}';
  1093.                 var i18ln_complement_15_3 = '{{"!!Eligibilité!!complement15_3"|trans|raw}}';
  1094.                 var i18ln_complement_15_4 = '{{"!!Eligibilité!!complement15_4"|trans|raw}}';
  1095.                 var i18ln_complement_15_5 = '{{"!!Eligibilité!!complement15_5"|trans|raw}}';
  1096.                 var i18ln_complement_15_common = '{{"!!Eligibilité!!complement15_common"|trans|raw}}';
  1097.                 var i18ln_erreur16 = '{{"!!Eligibilité!!erreur16"|trans|raw}}';
  1098.                 var i18ln_info17 = '{{"!!Eligibilité!!info17"|trans|raw}}';
  1099.                 var i18ln_erreur18 = '{{"!!Eligibilité!!erreur18"|trans|raw}}';
  1100.                 var i18ln_info19 = '{{"!!Eligibilité!!info19"|trans|raw}}';
  1101.                 var i18ln_erreur20 = '{{"!!Eligibilité!!erreur20"|trans|raw}}';
  1102.                 var i18ln_erreur21 = '{{"!!Eligibilité!!erreur21"|trans|raw}}';
  1103.                 var i18ln_erreur22 = '{{"!!Eligibilité!!erreur22"|trans|raw}}';    
  1104.             (function ($) {
  1105.                 var $form = $('#form-quipeutdonnersonsang');
  1106.                 $form.find('.start').click(function (e) {
  1107.                     e.preventDefault();
  1108.                     $form.trigger('reset');
  1109.                     var currentStep = $('#data-apk-current-step').text();
  1110.                     showQuestion(currentStep, "1");
  1111.                     hidePrev();
  1112.                     updateStep("0", "1");
  1113.                 });
  1114.                 $form.find('.prev').click(function (e) {
  1115.                     e.preventDefault();
  1116.                     var targetStep = $('#data-apk-prev-step').text();
  1117.                     var currentStep = $('#data-apk-current-step').text();
  1118.                     var activePrev = false;
  1119.                     $("[data-question='" + currentStep + "'] input[type='radio'], [data-question='" + currentStep + "'] input[type='checkbox']").prop('checked', false);
  1120.                     $("[data-question='" + currentStep + "'] input[type='text'], [data-question='" + currentStep + "'] input[type='date']").prop('value', '');
  1121.                     $("[data-question='" + targetStep + "'] input[type='radio'], [data-question='" + targetStep + "'] input[type='checkbox']").prop('checked', false);
  1122.                     $("[data-question='" + targetStep + "'] input[type='text'], [data-question='" + targetStep + "'] input[type='date']").prop('value', '');
  1123.                     showQuestion(currentStep, targetStep);
  1124.                     updateStep(false, targetStep);
  1125.                     enableNext();
  1126.                     if (targetStep == '1' || activePrev == false) {
  1127.                         hidePrev();
  1128.                     }
  1129.                 });
  1130.                 $form.find('.next, .next-no-matter').click(function (e) {
  1131.                     e.preventDefault();
  1132.                     //$form.find('prev').removeClass('uk-invisible');
  1133.                     var $question = $form.find('[data-question]').not('.uk-hidden');
  1134.                     var questionN = $question.attr('data-question');
  1135.                     var $error = $question.find('.question-message');
  1136.                     // êtes-vous un homme ou une femme ?
  1137.                     if (questionN == "1") {
  1138.                         if ($form.find('[name="q' + questionN + '"]:checked').val() == '') {
  1139.                             // Veuillez répondre à la question.
  1140.                             showMessage($question, i18ln_erreur1, 'red', 'before');
  1141.                         } else {
  1142.                             showQuestion(questionN, "2");
  1143.                             showPrev();
  1144.                         }
  1145.                         if($(this).hasClass('next-no-matter')) {
  1146.                             showQuestion(questionN, "2");
  1147.                             showPrev();
  1148.                         }
  1149.                     }
  1150.                     // Quelle est votre date de naissance ?
  1151.                     else if (questionN == "2") {
  1152.                         if ($form.find('[name="q' + questionN + '"]').val() == '') {
  1153.                             // Veuillez répondre à la question.
  1154.                             showMessage($question, i18ln_erreur1, 'red', 'before');
  1155.                         }
  1156.                         else if (!isValidDate($form.find('[name="q' + questionN + '"]'))) {
  1157.                             // Veuillez répondre à la question.
  1158.                             showMessage($question, i18ln_erreur2, 'red', 'before');
  1159.                         } else {
  1160.                             var age = getAge(datepickerInput.datepicker('getDate'));
  1161.                             //console.log('age ' + age);
  1162.                             if (isNaN(age) || age < 0) {
  1163.                                 // Veuillez entrer une date valide.
  1164.                                 showMessage($question, i18ln_erreur2, 'red', 'before');
  1165.                             } else {
  1166.                                 if (age < 18) {
  1167.                                     // Vous êtes actuellement trop jeune pour donner votre sang. Mais nous vous remercions pour votre intérêt. Revenez nous voir dès que vous aurez 18 ans !
  1168.                                     showMessage($question, i18ln_erreur3, 'red', 'after');
  1169.                                 } else if (age >= 18 && age <= 65) {
  1170.                                     showQuestion(questionN, "3");
  1171.                                 } else if (age >= 66 && age <= 74) {
  1172.                                     showQuestion(questionN, "2.1");
  1173.                                 } else {
  1174.                                     // Malheureusement, vous ne pouvez pas donner votre sang car le 1er don de sang doit avoir été effectué avant votre 66ème anniversaire et le dernier don doit remonter à moins de 3 ans.
  1175.                                     showMessage($question, i18ln_erreur4, 'red', 'after');
  1176.                                 }
  1177.                             }
  1178.                         }
  1179.                         if($(this).hasClass('next-no-matter')) {
  1180.                             showQuestion(questionN, "3");
  1181.                         }
  1182.                     }
  1183.                     // Avez-vous fait un don ces trois dernières années ?
  1184.                     else if (questionN == "2.1") {
  1185.                         if ($form.find('[name="q' + questionN + '"]:checked').val() == '') {
  1186.                             // Veuillez répondre à la question.
  1187.                             showMessage($question, i18ln_erreur1, 'red');
  1188.                         } else {
  1189.                             if ($('#form-quipeutdonnersonsang .next').prop("disabled") !== true) {
  1190.                                 showQuestion(questionN, "3");
  1191.                             }
  1192.                         }
  1193.                         if($(this).hasClass('next-no-matter')) {
  1194.                             showQuestion(questionN, "3");
  1195.                         }
  1196.                     }
  1197.                     // Quel est votre poids et votre taille ? Si <50kg
  1198.                     else if (questionN == "3") {
  1199.                         if ($form.find('[name="q' + questionN + '"]').val() == '') {
  1200.                             // Veuillez répondre à la question.
  1201.                             showMessage($question, i18ln_erreur1, 'red', 'before');
  1202.                         } else if (isNaN($form.find('[name="q' + questionN + '"]').val())) {
  1203.                             // Veuillez entrer un nombre valide.
  1204.                             showMessage($question, i18ln_erreur7, 'red', 'before');
  1205.                         } else if ($form.find('[name="q' + questionN + '"]').val() < parseInt($form.find('[name="q' + questionN + '"]').attr('min')) || $form.find('[name="q' + questionN + '"]').val() > parseInt($form.find('[name="q' + questionN + '"]').attr('max'))) {
  1206.                             // Veuillez entrer un nombre valide.
  1207.                             showMessage($question, i18ln_erreur7, 'red', 'before');
  1208.                         } else if ($form.find('[name="q' + questionN + '"]').val() < 50) {
  1209.                             // Vous ne pouvez actuellement pas donner votre sang, car vous devez peser au minimum 50kg. C'est une condition légale, et ce dans le but de vous protéger. En effet, un don de sang ne peut pas dépasser 13% du volume sanguin total ; ce dernier dépend de la taille, du poids et du sexe.
  1210.                             showMessage($question, i18ln_erreur8, 'red', 'after');
  1211.                         } else {
  1212.                             if ($form.find('[name="q' + questionN + 'taille"]').val() == '') {
  1213.                                 // Veuillez répondre à la question.
  1214.                                 showMessage($question, i18ln_erreur1, 'red', 'before');
  1215.                             } else if (isNaN($form.find('[name="q' + questionN + 'taille"]').val())) {
  1216.                                 // Veuillez entrer un nombre valide.
  1217.                                 showMessage($question, i18ln_erreur7, 'red', 'before');
  1218.                             } else if ($form.find('[name="q' + questionN + 'taille"]').val() < parseInt($form.find('[name="q' + questionN + 'taille"]').attr('min')) || $form.find('[name="q' + questionN + 'taille"]').val() > parseInt($form.find('[name="q' + questionN + 'taille"]').attr('max'))) {
  1219.                                 // Veuillez entrer un nombre valide.
  1220.                                 showMessage($question, i18ln_erreur7, 'red', 'before');
  1221.                             } else {
  1222.                                 var $poids = $form.find('[name="q' + questionN + '"]').val();
  1223.                                 var $taille = $form.find('[name="q' + questionN + 'taille"]').val();
  1224.                                 if (
  1225.                                     ($poids < 51 && $taille < 156) ||
  1226.                                     ($poids == 51 && $taille < 155) ||
  1227.                                     ($poids == 52 && $taille < 153) ||
  1228.                                     ($poids == 53 && $taille < 151) ||
  1229.                                     ($poids == 54 && $taille < 149) ||
  1230.                                     ($poids == 55 && $taille < 148) ||
  1231.                                     ($poids == 56 && $taille < 146)
  1232.                                 ) {
  1233.                                     // Attention ! La correspondance entre votre poids et votre taille ne convient pas pour donner votre sang.
  1234.                                     showMessage($question, i18ln_erreur8_2, 'red', 'after');
  1235.                                 } else {
  1236.                                     if ($('#form-quipeutdonnersonsang .next').prop("disabled") !== true) {
  1237.                                         showQuestion(questionN, "4");
  1238.                                     }
  1239.                                 }
  1240.                             }
  1241.                         }
  1242.                         if($(this).hasClass('next-no-matter')) {
  1243.                             showQuestion(questionN, "4");
  1244.                         }
  1245.                     }
  1246.                     // De 1980 à 1996, avez-vous séjourné plus de 6 mois (tous séjours confondus) au Royaume- Uni (Angleterre, Écosse, Pays de Galles et Irlande du Nord)?
  1247.                     else if (questionN == "4") {
  1248.                         if ($form.find('[name="q' + questionN + '"]:checked').val() == '') {
  1249.                             // Veuillez répondre à la question.
  1250.                             showMessage($question, i18ln_erreur1, 'red', 'before');
  1251.                         } else {
  1252.                             if ($('#form-quipeutdonnersonsang .next').prop("disabled") !== true) {
  1253.                                 showQuestion(questionN, "5");
  1254.                             }
  1255.                         }
  1256.                         if($(this).hasClass('next-no-matter')) {
  1257.                             showQuestion(questionN, "5");
  1258.                         }
  1259.                     }
  1260.                     // Avez-vous voyagé hors de la Belgique ces 6 derniers mois?
  1261.                     else if (questionN == "5") {
  1262.                         if ($form.find('[name="q' + questionN + '"]:checked').val() == '') {
  1263.                             // Veuillez répondre à la question.
  1264.                             showMessage($question, i18ln_erreur1, 'red', 'before');
  1265.                         } else {
  1266.                             if ($('#form-quipeutdonnersonsang .next').prop("disabled") !== true) {
  1267.                                 if ($form.find('[name="q' + questionN + '"]:checked').val() == 'Oui') {
  1268.                                     showQuestion(questionN, "5.1");
  1269.                                 } else {
  1270.                                     //alert($form.find('[name="q1"]:checked').val());
  1271.                                     if ($form.find('[name="q1"]:checked').val() == 'Femme') {
  1272.                                         showQuestion(questionN, "6");
  1273.                                     } else {
  1274.                                         showQuestion(questionN, "7");
  1275.                                     }
  1276.                                 }
  1277.                             }
  1278.                         }
  1279.                         if($(this).hasClass('next-no-matter')) {
  1280.                             if ($form.find('[name="q1"]:checked').val() == 'Femme') {
  1281.                                 showQuestion(questionN, "6");
  1282.                             } else {
  1283.                                 showQuestion(questionN, "7");
  1284.                             }
  1285.                         }
  1286.                     }
  1287.                     // Avez-vous voyagé à l’extérieur de l’Europe ?
  1288.                     else if (questionN == "5.1") {
  1289.                         if ($form.find('[name="q' + questionN + '"]:checked').val() == '') {
  1290.                             // Veuillez répondre à la question.
  1291.                             showMessage($question, i18ln_erreur1, 'red', 'before');
  1292.                         } else {
  1293.                             if ($('#form-quipeutdonnersonsang .next').prop("disabled") !== true) {
  1294.                                 if ($form.find('[name="q1"]:checked').val() == 'Femme') {
  1295.                                     showQuestion(questionN, "6");
  1296.                                 } else {
  1297.                                     showQuestion(questionN, "7");
  1298.                                 }
  1299.                             }
  1300.                         }
  1301.                         if($(this).hasClass('next-no-matter')) {
  1302.                             if ($form.find('[name="q1"]:checked').val() == 'Femme') {
  1303.                                 showQuestion(questionN, "6");
  1304.                             } else {
  1305.                                 showQuestion(questionN, "7");
  1306.                             }
  1307.                         }
  1308.                     }
  1309.                     // Si répondu F à la Q1 : êtes-vous enceinte ou avez-vous accouché dans les 6 derniers mois ?
  1310.                     else if (questionN == "6") {
  1311.                         if ($form.find('[name="q' + questionN + '"]:checked').val() == '') {
  1312.                             // Veuillez répondre à la question.
  1313.                             showMessage($question, i18ln_erreur1, 'red', 'before');
  1314.                         } else {
  1315.                             if ($('#form-quipeutdonnersonsang .next').prop("disabled") !== true) {
  1316.                                 if ($form.find('[name="q' + questionN + '"]:checked').val() == 'Non') {
  1317.                                     showQuestion(questionN, "7");
  1318.                                 }
  1319.                             }
  1320.                         }
  1321.                         if($(this).hasClass('next-no-matter')) {
  1322.                             showQuestion(questionN, "7");
  1323.                         }
  1324.                     }
  1325.                     // Q7 : Avez-vous eu récemment de la fièvre ou une infection (bronchite, infection urinaire...) ?
  1326.                     else if (questionN == "7") {
  1327.                         if ($('#form-quipeutdonnersonsang .next').prop("disabled") !== true) {
  1328.                             showQuestion(questionN, "8");
  1329.                         }
  1330.                         if($(this).hasClass('next-no-matter')) {
  1331.                             showQuestion(questionN, "8");
  1332.                         }
  1333.                     }
  1334.                     // Q8 : Prenez-vous des médicaments ?
  1335.                     else if (questionN == "8") {
  1336.                         // Veuillez répondre à la question.
  1337.                         //showMessage($question, i18ln_erreur1, 'red', 'before');
  1338.                         // if ($form.find('[name="q' + questionN + '"]:checked').val() == 'Non') {
  1339.                         //     disableNext();
  1340.                         // }
  1341.                         if ($form.find('[name="q' + questionN + '"]:checked').val() == '') {
  1342.                             // Veuillez répondre à la question.
  1343.                             showMessage($question, i18ln_erreur1, 'red', 'before');
  1344.                         } else {
  1345.                             if ($('#form-quipeutdonnersonsang .next').prop("disabled") !== true) {
  1346.                                 if ($form.find('[name="q' + questionN + '"]:checked').val() == 'Non') {
  1347.                                     showQuestion(questionN, "9");
  1348.                                 }
  1349.                             }
  1350.                         }
  1351.                         if($(this).hasClass('next-no-matter')) {
  1352.                             showQuestion(questionN, "9");
  1353.                         }
  1354.                     }
  1355.                     // 9. Avez-vous été vacciné(e) il y a moins d’un mois ?
  1356.                     else if (questionN == "9") {
  1357.                         if ($form.find('[name="q' + questionN + '"]:checked').val() == '') {
  1358.                             // Veuillez répondre à la question.
  1359.                             showMessage($question, i18ln_erreur1, 'red', 'before');
  1360.                         } else {
  1361.                             if ($('#form-quipeutdonnersonsang .next').prop("disabled") !== true) {
  1362.                                 if ($form.find('[name="q' + questionN + '"]:checked').val() != '') {
  1363.                                     showQuestion(questionN, "10");
  1364.                                 }
  1365.                             }
  1366.                         }
  1367.                     }
  1368.                     // 10. Avez-vous subi une endoscopie (arthroscopie, gastroscopie, coloscopie…) ou une opération dans les 4 derniers mois ?
  1369.                     else if (questionN == "10") {
  1370.                         if ($form.find('[name="q' + questionN + '"]:checked').val() == '') {
  1371.                             // Veuillez répondre à la question.
  1372.                             showMessage($question, i18ln_erreur1, 'red', 'before');
  1373.                         } else {
  1374.                             if ($('#form-quipeutdonnersonsang .next').prop("disabled") !== true) {
  1375.                                 if ($form.find('[name="q' + questionN + '"]:checked').val() == 'Non') {
  1376.                                     showQuestion(questionN, "11");
  1377.                                 }
  1378.                             }
  1379.                         }
  1380.                         if($(this).hasClass('next-no-matter')) {
  1381.                             showQuestion(questionN, "11");
  1382.                         }
  1383.                     }
  1384.                     // 11. êtes-vous allé.e chez le dentiste au cours des 7 derniers jours ?
  1385.                     else if (questionN == "11") {
  1386.                         if ($form.find('[name="q' + questionN + '"]:checked').val() == '') {
  1387.                             // Veuillez répondre à la question.
  1388.                             showMessage($question, i18ln_erreur1, 'red', 'before');
  1389.                         } else {
  1390.                             if ($('#form-quipeutdonnersonsang .next').prop("disabled") !== true) {
  1391.                                 if ($form.find('[name="q' + questionN + '"]:checked').val() == 'Non' || $form.find('[name="q' + questionN + '"]:checked').val() == 'Oui') {
  1392.                                     showQuestion(questionN, "12");
  1393.                                 }
  1394.                             }
  1395.                         }
  1396.                         if($(this).hasClass('next-no-matter')) {
  1397.                             showQuestion(questionN, "12");
  1398.                         }
  1399.                     }
  1400.                     // 12. Avez-vous fait un piercing (y compris boucles d’oreilles) ou un tatouage (y compris maquillage permanent) durant ces 4 derniers mois ?
  1401.                     else if (questionN == "12") {
  1402.                         if ($form.find('[name="q' + questionN + '"]:checked').val() == '') {
  1403.                             // Veuillez répondre à la question.
  1404.                             showMessage($question, i18ln_erreur1, 'red', 'before');
  1405.                         } else {
  1406.                             if ($('#form-quipeutdonnersonsang .next').prop("disabled") !== true) {
  1407.                                 if ($form.find('[name="q' + questionN + '"]:checked').val() == 'Non') {
  1408.                                     showQuestion(questionN, "13");
  1409.                                 }
  1410.                             }
  1411.                         }
  1412.                         if($(this).hasClass('next-no-matter')) {
  1413.                             showQuestion(questionN, "13");
  1414.                         }
  1415.                     }
  1416.                     // 13. Avez-vous déjà consommé de la drogue ?
  1417.                     else if (questionN == "13") {
  1418.                         if ($form.find('[name="q' + questionN + '"]:checked').val() == '') {
  1419.                             // Veuillez répondre à la question.
  1420.                             showMessage($question, i18ln_erreur1, 'red', 'before');
  1421.                         } else {
  1422.                             if ($('#form-quipeutdonnersonsang .next').prop("disabled") !== true) {
  1423.                                 if ($form.find('[name="q' + questionN + '"]:checked').val() == 'Non' || $form.find('[name="q' + questionN + '"]:checked').val() == 'Oui') {
  1424.                                     if ($form.find('[name="q1"]:checked').val() == 'Femme') {
  1425.                                         showQuestion(questionN, "14");
  1426.                                     } else {
  1427.                                         showQuestion(questionN, "15");
  1428.                                     }
  1429.                                 }
  1430.                             }
  1431.                         }
  1432.                         if($(this).hasClass('next-no-matter')) {
  1433.                             if ($form.find('[name="q1"]:checked').val() == 'Femme') {
  1434.                                 showQuestion(questionN, "14");
  1435.                             } else {
  1436.                                 showQuestion(questionN, "15");
  1437.                             }
  1438.                         }
  1439.                     }
  1440.                     // 14. Si répondu F (femme) à la Q2: Avez-vous eu un.e nouveau.elle partenaire sexuel.le au cours des 4 derniers mois ? (avec ou sans préservatif)
  1441.                     else if (questionN == "14") {
  1442.                         if ($form.find('[name="q' + questionN + '"]:checked').val() == '') {
  1443.                             // Veuillez répondre à la question.
  1444.                             showMessage($question, i18ln_erreur1, 'red', 'before');
  1445.                         } else {
  1446.                             if ($('#form-quipeutdonnersonsang .next').prop("disabled") !== true) {
  1447.                                 if ($form.find('[name="q' + questionN + '"]:checked').val() == 'Non') {
  1448.                                     showQuestion(questionN, "end");
  1449.                                     hideNext();
  1450.                                     hidePrev();
  1451.                                 }
  1452.                             }
  1453.                         }
  1454.                         if($(this).hasClass('next-no-matter')) {
  1455.                             showQuestion(questionN, "end");
  1456.                             hideNext();
  1457.                             hidePrev();
  1458.                         }
  1459.                     }
  1460.                     // 15. Si répondu H (hommme) à la Q2: Avez-vous eu une nouvelle partenaire sexuelle au cours des 4 derniers mois ? (avec ou sans préservatif)
  1461.                     else if (questionN == "15") {
  1462.                         if ($form.find('[name="q' + questionN + '"]:checked').val() == '') {
  1463.                             // Veuillez répondre à la question.
  1464.                             showMessage($question, i18ln_erreur1, 'red', 'before');
  1465.                         } else {
  1466.                             if ($('#form-quipeutdonnersonsang .next').prop("disabled") !== true) {
  1467.                                 if ($form.find('[name="q' + questionN + '"]:checked').val() == 'Non') {
  1468.                                     showQuestion(questionN, "16");
  1469.                                 }
  1470.                             }
  1471.                         }
  1472.                         if($(this).hasClass('next-no-matter')) {
  1473.                             showQuestion(questionN, "16");
  1474.                         }
  1475.                     }
  1476.                     // 16. Si répondu H (hommme) à la Q2: Au cours des 12 derniers mois, avez-vous eu une relation sexuelle avec un homme ?
  1477.                     else if (questionN == "16") {
  1478.                         if ($form.find('[name="q' + questionN + '"]:checked').val() == '') {
  1479.                             // Veuillez répondre à la question.
  1480.                             showMessage($question, i18ln_erreur1, 'red', 'before');
  1481.                         } else {
  1482.                             if ($('#form-quipeutdonnersonsang .next').prop("disabled") !== true) {
  1483.                                 if ($form.find('[name="q' + questionN + '"]:checked').val() == 'Non') {
  1484.                                     showQuestion(questionN, "end");
  1485.                                     hideNext();
  1486.                                     hidePrev();
  1487.                                 }
  1488.                             }
  1489.                         }
  1490.                         if($(this).hasClass('next-no-matter')) {
  1491.                             showQuestion(questionN, "end");
  1492.                             hideNext();
  1493.                             hidePrev();
  1494.                         }
  1495.                     }
  1496.                 });
  1497.                 $(document).on('change input cut copy paste', '#form-quipeutdonnersonsang :input', function () {
  1498.                     var $question = $(this).closest('[data-question]');
  1499.                     enableNext();
  1500.                     removeMessage($question)
  1501.                 });
  1502.                 $(document).on('change', '#form-quipeutdonnersonsang input[type="radio"]', function () {
  1503.                     var $question = $(this).closest('[data-question]');
  1504.                     if ($(this).attr('data-message') && $(this).attr('data-message') != 'false') {
  1505.                         showMessage($question, eval($(this).attr('data-message')), $(this).attr('data-color'), $(this).attr('data-where'));
  1506.                     } else {
  1507.                         removeMessage($question);
  1508.                     }
  1509.                     if($(this).hasClass('is-autovalidate')) {
  1510.                         $(this).parents('.uk-form-controls').find('.next').trigger( "click" );
  1511.                     }
  1512.                     if ($(this).attr('data-apk-toggle') == 'true' || $(this).attr('data-apk-toggle') == 'false') {
  1513.                         var toggleTarget = $(this).parents('[data-apk-toggle-target]').attr('data-apk-toggle-target');
  1514.                         if ($(this).attr('data-apk-toggle') == 'true') { // Note: Ajout du namespace 'atp' pour éviter des conflits avec d'autres functions JS (vendor)
  1515.                             $(toggleTarget).show();
  1516.                             $('#form-quipeutdonnersonsang .next-no-matter').removeClass('uk-hidden');
  1517.                         } else if ($(this).attr('data-apk-toggle') == 'false') {
  1518.                             $(toggleTarget).hide();
  1519.                         }
  1520.                     }
  1521.                 });
  1522.                 $(document).on('change', '#form-quipeutdonnersonsang input[type="checkbox"]', function () {
  1523.                     var $question = $(this).closest('[data-question]');
  1524.                     if ($(this).prop('checked')) {
  1525.                         if ($(this).attr('data-message') && $(this).attr('data-message') != 'false') {
  1526.                             showMessage($question, eval($(this).attr('data-message')), $(this).attr('data-color'), $(this).attr('data-where'));
  1527.                             $('#form-quipeutdonnersonsang .next-no-matter').removeClass('uk-hidden');
  1528.                         }
  1529.                     } else {
  1530.                         var $question = $(this).closest('[data-question]');
  1531.                         var where = $(this).parents('[data-apk-where]').attr('data-apk-where');
  1532.                         //var message =  $(this).parents('[data-apk-message]').attr('data-apk-message');
  1533.                         var message = eval($(this).parents('[data-apk-message]').attr('data-apk-message'))
  1534.                         var countElementChecked = $(this).parents('[data-apk-message]').find('input:checked').length;
  1535.                         var $error = $form.find('.question-message-' + where);
  1536.                         var $errorContainer = $form.find('.question-message-container-complement');
  1537.                         if (countElementChecked >= 1) {
  1538.                             if ($errorContainer.hasClass('is-not-empty') == false) {
  1539.                                 $errorContainer.addClass('is-not-empty')
  1540.                             }
  1541.                             $error.html(message);
  1542.                             /*if( $question.attr('data-question') == "8" && ($form.find('[name="q8"]:checked').val() == 'Oui')) {
  1543.                                 $('#form-quipeutdonnersonsang .next-no-matter').removeClass('uk-hidden');
  1544.                             }*/
  1545.                         } else {
  1546.                             if ($errorContainer.hasClass('is-not-empty') == true) {
  1547.                                 $errorContainer.removeClass('is-not-empty')
  1548.                             }
  1549.                             $error.html('');
  1550.                         }
  1551.                         var currentWhere = $(this).attr('data-where');
  1552.                         var countWhere = $question.find('input[data-where=' + currentWhere + ']:checked').length;
  1553.                         //console.log(countWhere);
  1554.                         if (countWhere == 0) {
  1555.                             //alert('DELETE: .question-message-' + currentWhere);
  1556.                             if(currentWhere=='after'){
  1557.                                 alert('after checkbox');
  1558.                             } else {
  1559.                                 $form.find('.question-message-' + currentWhere).html('');
  1560.                             }
  1561.                         }
  1562.                         $('#form-quipeutdonnersonsang .next-no-matter').removeClass('uk-hidden');
  1563.                     }
  1564.                     if ($question.attr('data-question') == "9") {
  1565.                         if (
  1566.                             $("input[name='q9.1']").prop("checked") == false &&
  1567.                             $("input[name='q9.2']").prop("checked") == false &&
  1568.                             $("input[name='q9.3']").prop("checked") == false &&
  1569.                             $("input[name='q9.4']").prop("checked") == false &&
  1570.                             $("input[name='q9.5']").prop("checked") == false &&
  1571.                             $("input[name='q9.7']").prop("checked") == false &&
  1572.                             $("input[name='q9.6']").prop("checked") == true
  1573.                         ) {
  1574.                             //$form.find('.question-message-title-common').hide();
  1575.                             $form.find('.question-message-complement_common').html('');
  1576.                         } else {
  1577.                             //$form.find('.question-message-title-common').show();
  1578.                         }
  1579.                     }
  1580.                 });
  1581.                 /* $('[data-question="8"] .has-serialize-checkbox label').on('click', function () {
  1582.                      //if($("#toggle-q8-yes").css('display')=='block'){
  1583.                      serializeCheckbox($("#toggle-q8-yes :input[type='checkbox']"));
  1584.                      //}
  1585.                  });*/
  1586.                 $(document).on('change', '[data-question="8"] .has-serialize-checkbox input[type="checkbox"]', function () {
  1587.                     var element = '[data-question="8"] .has-serialize-checkbox label';
  1588.                     var q8_1 = [], q8_2 = [], q8_3 = [], q8_4 = [], q8_5 = [];
  1589.                     $(element + " input[name='q8.1']:checked").each(function () {
  1590.                         q8_1.push($(this).val());
  1591.                     });
  1592.                     $(element + " input[name='q8.2']:checked").each(function () {
  1593.                         q8_2.push($(this).val());
  1594.                     });
  1595.                     $(element + " input[name='q8.3']:checked").each(function () {
  1596.                         q8_3.push($(this).val());
  1597.                     });
  1598.                     $(element + " input[name='q8.4']:checked").each(function () {
  1599.                         q8_4.push($(this).val());
  1600.                     });
  1601.                     $(element + " input[name='q8.5']:checked").each(function () {
  1602.                         q8_5.push($(this).val());
  1603.                     });
  1604.                     var q8_6 = $(element + " input[name='q8.6']");
  1605.                     //console.log(JSON.stringify([q8_1, q8_2, q8_3]));
  1606.                     // console.log('1:'+q8_1.join(", "));
  1607.                     // console.log('2:'+q8_2.join(", "));
  1608.                     // console.log('3:'+q8_3.join(", "));
  1609.                    /* var containerMessage1 = $(this).closest('[data-question]').find('.question-message-complement_1');
  1610.                     var containerMessage2 = $(this).closest('[data-question]').find('.question-message-complement_2');
  1611.                     var containerMessage3 = $(this).closest('[data-question]').find('.question-message-complement_3');
  1612.                     var containerMessage4 = $(this).closest('[data-question]').find('.question-message-complement_4');
  1613.                     var containerMessage5 = $(this).closest('[data-question]').find('.question-message-complement_5');
  1614.                     var containerMessage6 = $(this).closest('[data-question]').find('.question-message-complement_6');
  1615.                     var containerMessageCommon = $(this).closest('[data-question]').find('.question-message-common');*/
  1616.                     var containerMessage1 = $form.find('.question-message-complement_1');
  1617.                     var containerMessage2 = $form.find('.question-message-complement_2');
  1618.                     var containerMessage3 = $form.find('.question-message-complement_3');
  1619.                     var containerMessage4 = $form.find('.question-message-complement_4');
  1620.                     var containerMessage5 = $form.find('.question-message-complement_5');
  1621.                     var containerMessage6 = $form.find('.question-message-complement_6');
  1622.                     var containerMessageCommon = $form.find('.question-message-common');
  1623.                     if (q8_1 != '') {
  1624.                         var containerMessage1Updated = i18ln_complement_14_1.replace("[[CHOICE]]", '<strong>' + q8_1.join(", ") + '</strong>');
  1625.                         containerMessage1.html(containerMessage1Updated);
  1626.                     } else {
  1627.                         containerMessage1.html('');
  1628.                     }
  1629.                     if (q8_2 != '') {
  1630.                         var containerMessage2Updated = i18ln_complement_14_2.replace("[[CHOICE]]", '<strong>' + q8_2.join(", ") + '</strong>');
  1631.                         containerMessage2.html(containerMessage2Updated);
  1632.                     } else {
  1633.                         containerMessage2.html('');
  1634.                     }
  1635.                     if (q8_3 != '') {
  1636.                         var containerMessage3Updated = i18ln_complement_14_3.replace("[[CHOICE]]", '<strong>' + q8_3.join(", ") + '</strong>');
  1637.                         containerMessage3.html(containerMessage3Updated);
  1638.                     } else {
  1639.                         containerMessage3.html('');
  1640.                     }
  1641.                     if (q8_4 != '') {
  1642.                         var containerMessage4Updated = i18ln_complement_14_4.replace("[[CHOICE]]", '<strong>' + q8_4.join(", ") + '</strong>');
  1643.                         containerMessage4.html(containerMessage4Updated);
  1644.                     } else {
  1645.                         containerMessage4.html('');
  1646.                     }
  1647.                     if (q8_5 != '') {
  1648.                         var containerMessage5Updated = i18ln_complement_14_5.replace("[[CHOICE]]", '<strong>' + q8_5.join(", ") + '</strong>');
  1649.                         containerMessage5.html(containerMessage5Updated);
  1650.                     } else {
  1651.                         containerMessage5.html('');
  1652.                     }
  1653.                     if (q8_6.prop('checked')) {
  1654.                         containerMessage6.html(i18ln_complement_14_6);
  1655.                     } else {
  1656.                         containerMessage6.html('');
  1657.                     }
  1658.                     if (q8_1 != '' || q8_2 != '' || q8_3 != '' || q8_4 != '' || q8_5 != '' || q8_6 != '') {
  1659.                         containerMessageCommon.html(i18ln_complement_14_common);
  1660.                     } else {
  1661.                         containerMessageCommon.html('');
  1662.                     }
  1663.                     $('#form-quipeutdonnersonsang .next-no-matter').removeClass('uk-hidden');
  1664.                 });
  1665.                 if ($('[data-apk-message]').length) {
  1666.                     $('[data-apk-message] label').on('click', function (e) {
  1667.                         //e.preventDefault();
  1668.                         var $question = $(this).closest('[data-question]');
  1669.                         var where = $(this).parents('[data-apk-where]').attr('data-apk-where');
  1670.                         //var message =  $(this).parents('[data-apk-message]').attr('data-apk-message');
  1671.                         var message = eval($(this).parents('[data-apk-message]').attr('data-apk-message'));
  1672.                         var countElementChecked = $(this).parents('[data-apk-message]').find('input:checked').length;
  1673.                         var $error = $form.find('.question-message-' + where);
  1674.                         var $errorContainer = $form.find('.question-message-container-complement');
  1675.                         if (countElementChecked >= 1) {
  1676.                             if ($errorContainer.hasClass('is-not-empty') == false) {
  1677.                                 $errorContainer.addClass('is-not-empty')
  1678.                             }
  1679.                             $error.html(message);
  1680.                         } else {
  1681.                             if ($errorContainer.hasClass('is-not-empty') == true) {
  1682.                                 $errorContainer.removeClass('is-not-empty')
  1683.                             }
  1684.                             $error.html('');
  1685.                         }
  1686.                         var currentWhere = $(this).find('input').attr('data-where');
  1687.                         var countWhere = $question.find('input[data-where=' + currentWhere + ']:checked').length;
  1688.                         //console.log(countWhere);
  1689.                         if (countWhere == 0) {
  1690.                             //alert('DELETE: .question-message-' + currentWhere);
  1691.                             $question.find('.question-message-' + currentWhere).html('');
  1692.                         }
  1693.                     });
  1694.                 }
  1695.                 /*$(document).on('change', '#form-quipeutdonnersonsang .has-apk-toggle [data-apk-toggle]', function () {
  1696.                     if($(this).attr('data-apk-toggle') && $(this).attr('data-apk-toggle')!='false') {
  1697.                     } else {
  1698.                     }
  1699.                 });*/
  1700.             })(jQuery);
  1701.         </script>
  1702.     {% endif %}
  1703.     {% endblock inlinescripts %}