templates/exposed_checkin/index.html.twig line 1

Open in your IDE?
  1. {% extends 'base.html.twig' %}
  2. {% set footerFixedBottom = true %}
  3. {% block title %}{{ appName }}{% endblock %}
  4. {% block stylesheets %}
  5.     <style>
  6.         .welcome-overlay {
  7.             position: absolute;
  8.             width: 100%;
  9.             height: 100%;
  10.             top: 0;
  11.             left: 0;
  12.             background: #EBEBEB;
  13.         }
  14.     </style>
  15. {% endblock %}
  16. {% block body %}
  17.     <div class="container py-3 bg-light register-container">
  18.         <div class="row mb-5">
  19.             <div class="col-12">
  20.                 <h2>{{ "participant.buttons.addTitle"|trans }} {{ appName }}</h2>
  21.             </div>
  22.         </div>
  23.         {% include "checkin/participantForm.html.twig" with {'form': form} %}
  24.         {% if termsAndConditions is defined and termsAndConditions is not empty %}
  25.             <div class="row text-right">
  26.                 <div class="col-12">
  27.                     <p>{{ "participant.label.downloadTermsAndConditions"|trans }}
  28.                         <a class="" href="{{ path('app_exposedcheckin_downloadFile', {'settingName': 'termsAndConditions'}) }}">{{ appName }}</a>
  29.                     </p>
  30.                 </div>
  31.             </div>
  32.         {% endif %}
  33.     </div>
  34. {% endblock %}
  35. {% block javascripts %}
  36.     {{ parent() }}
  37.     <script type="module" src="{{ asset('js/base.js') }}"></script>
  38.     <script type="application/javascript">
  39.         const formInputs = $('form :input, form a')
  40.         const startDate = new Date('{{ availability.startDate|date('Y-m-d')~'T'~availability.startDate|date('H:i:s') }}')
  41.         const endDate = new Date('{{ availability.endDate|date('Y-m-d')~'T'~availability.startDate|date('H:i:s') }}')
  42.         const dateNow = new Date()
  43.         if (dateNow.getTime() < startDate.getTime()) {
  44.             $(`<div class="d-flex flex-column justify-content-center align-items-center welcome-overlay px-5"><h4>
  45.             {{- 'general.appNotYetAvailable'|trans({
  46.                 '%appName%': appName,
  47.                 '%dateAvailable%': availability.startDate|format_date('full'),
  48.                 '%timeAvailable%': availability.startDate|date('H:i')
  49.             }) -}}</h4></div>`)
  50.                 .appendTo(($(".register-container").children('[class="row"]')).css("position", "relative"));
  51.             formInputs.each( (index, item) => {
  52.                 $(item).attr('tabindex', -1)
  53.             })
  54.             availableAtMessage = '{{ availability.availableAtMessage }}'
  55.             if (availableAtMessage.length > 0) {
  56.                 overlay = $('.welcome-overlay')
  57.                 overlay.append(`</br><h5>${availableAtMessage}</h5>`)
  58.             }
  59.         } else if (dateNow.getTime() > endDate.getTime()) {
  60.             $(`<div class="d-flex flex-column justify-content-center align-items-center welcome-overlay px-5"><h4>{{ 'general.appHasEnded'|trans({
  61.                 '%appName%': appName,
  62.                 '%dateEnded%': availability.endDate|format_date('full'),
  63.                 '%timeEnded%': availability.endDate|date('H:i')
  64.             }) }}</h4></div>`)
  65.                 .appendTo(($(".register-container").children('[class="row"]')).css("position", "relative"));
  66.             formInputs.each( (index, item) => {
  67.                 $(item).attr('tabindex', -1)
  68.             })
  69.             endedAtMessage = '{{ availability.endedAtMessage }}'
  70.             if (endedAtMessage.length > 0) {
  71.                 overlay = $('.welcome-overlay')
  72.                 overlay.append(`</br><h5>${endedAtMessage}</h5>`)
  73.             }
  74.         }
  75.     </script>
  76. {% endblock %}