src/Aviatur/TwigBundle/Resources/views/aviatur/Custom/App/header/coin-list.html.twig line 1

Open in your IDE?
  1. <div class="coinList {{ app.request.pathinfo != '/' and app.request.pathinfo != " /buscar/vuelos/" ? 'pointer-events-none' : '' }}">
  2.     <div class="dropbtn rounded h-[1.9375rem] p-[0.5rem] !font-[Ubuntu] hover:!bg-[rgba(235,235,235,1)] flex items-center justify-between w-full">
  3.         <span>{{ app.session.get('CurrencyFrom') }}</span>
  4.     </div>
  5.     <div id="myCoinList" class="coinListContent text-center rounded h-auto" data-state="inactive">
  6.         {% set isActiveCurrency = app.session.get('isActiveCurrency') %}
  7.         {% if 'COP' not in isActiveCurrency %}
  8.             <div class="py-1 px-2 !text-[rgba(90, 90, 90, 1)]">
  9.                 <a class="coin !font-[Ubuntu] rounded !font-normal !p-1 !text-sm hover:!bg-[rgba(235,235,235,1)] hover:!font-bold" data-coin="COP" data-country="co">
  10.                     COP
  11.                 </a>
  12.             </div>
  13.         {% endif %}
  14.         {% for currency in isActiveCurrency %}
  15.             <div class="py-1 px-2 !text-[rgba(90, 90, 90, 1)]">
  16.                 <a class="coin !font-[Ubuntu] rounded !font-normal !p-1 !text-sm hover:!bg-[rgba(235,235,235,1)] hover:!font-bold" data-coin="{{ currency }}" data-country="{{ currency|lower|slice(0, 2) }}">{{ currency }}</a>
  17.             </div>
  18.         {% endfor %}
  19.     </div>
  20. </div>
  21. {% set typeCountry = app.session.get('typeCountry') is defined and app.session.get('typeCountry') != '' ? app.session.get('typeCountry') : 'co' %}
  22. {% set typeCoin = app.session.get('typeCoin') is defined and app.session.get('typeCoin') != '' ? app.session.get('typeCoin') : 'COP' %}
  23. <span id="worldpayInfo" class="js-flightHiddenInput" data-selectedcountry="{{ typeCountry }}" data-selectedcoin="{{ typeCoin }}">
  24.     {% if app.session.get('domainsecure') == app.request.host %}
  25.         {% set coinValue = app.session.get('CoinValue') is defined and app.session.get('typeCoin') != '' ? app.session.get('CoinValue') : 1 %}
  26.         {% set rateDiff = app.session.get('RateDiff') is defined ? app.session.get('RateDiff') : 1 %}
  27.         <input type="hidden" id="typeCoin" name="typeCoin" readonly data-country="{{ typeCountry }}" value="{{ typeCoin }}">
  28.         <input type="hidden" id="CoinValue" name="CoinValue" readonly value="{{ coinValue }}">
  29.         <input type="hidden" id="RateDiff" name="RateDiff" readonly value="{{ rateDiff }}">
  30.     {% endif %}
  31. </span>
  32.  <script>
  33.     document.addEventListener('DOMContentLoaded', function() {
  34.         let myCoinList = document.getElementById('myCoinList');
  35.         if (window.location.pathname !== '/') {
  36.             myCoinList.style.pointerEvents = 'none';
  37.         }
  38.     });
  39.     document.addEventListener('DOMContentLoaded', function() {
  40.         const coinLinks = document.querySelectorAll('.coin');
  41.         const worldpayInfo = document.getElementById('worldpayInfo');
  42.         coinLinks.forEach(link => {
  43.             link.addEventListener('click', function(event) {
  44.                 event.preventDefault();
  45.                 const selectedCoin = this.getAttribute('data-coin');
  46.                 worldpayInfo.setAttribute('data-selectedcoin', selectedCoin);
  47.             });
  48.         });
  49.     });
  50. </script>