src/Elements/Bundle/DemiFrontendBundle/Resources/views/Includes/elements/filter/filter-block.desktop.html.twig line 1

Open in your IDE?
  1. {#
  2. /**
  3.  * @var \Pimcore\Templating\PhpEngine this
  4.  * @var \Pimcore\Templating\PhpEngine view
  5.  * @var \Pimcore\Templating\GlobalVariables app
  6.  * #
  7.  * @var string label
  8.  * @var array options
  9.  * @var string name
  10.  * @var bool showHr
  11.  * @var bool hideClasses
  12.  * @var string filterId
  13.  * @var string idPrefix
  14.  */
  15. #}
  16. <div class="filter-block js-filter-sidebar__item {{ hideClasses ?: '' }}" data-filter-id="{{ filterId is defined ? filterId : '' }}">
  17.     <div class="h3 mb-3">{{ label }}</div>
  18.     {% if options is defined  and name != 'price'%}
  19.         <ul class="list-unstyled">
  20.             {% for option in options %}
  21.                 <li class="mb-2">
  22.                     <div class="row">
  23.                         <div class="col">
  24.                             {% if (option['type'] is same as "input") %}
  25.                                 {{ include('@ElementsDemiFrontend/Includes/elements/form-elements/' ~ option['type'] ~ '.html.twig',{
  26.                                     'styleModifier' : option['styleModifier'],
  27.                                     'type' : option['type'],
  28.                                     'text' : option['text'],
  29.                                     'name' : option['name'],
  30.                                     'value' : option['value'],
  31.                                     'label' : option['label'],
  32.                                     'id' : idPrefix ? (idPrefix ~ '-' ~ option['name']): null,
  33.                                     'noBox' : false,
  34.                                     'classModifier' : false
  35.                                 }) }}
  36.                             {% else %}
  37.                                 {{ include('@ElementsDemiFrontend/Includes/elements/checkboxes/' ~ option['type'] ~ '.html.twig',{
  38.                                     'styleModifier' : option['styleModifier'],
  39.                                     'type' : option['type'],
  40.                                     'text' : option['text'],
  41.                                     'name' : option['name'],
  42.                                     'value' : option['value'],
  43.                                     'label' : option['label'],
  44.                                     'noBox' : false,
  45.                                     'isRequired': false,
  46.                                     'isChecked': false,
  47.                                     'additionalContent' : null
  48.                                 }) }}
  49.                             {% endif %}
  50.                         </div>
  51.                         <div class="col col-auto">
  52.                             {% if option['noBubbles'] is not defined %}
  53.                                 <span class="small js-filter-form__count" data-id="{{ option['bubblesId'] is defined ? option['bubblesId']:option['value'] }}" title="" aria-label=""></span>
  54.                             {% endif %}
  55.                         </div>
  56.                     </div>
  57.                 </li>
  58.             {% endfor %}
  59.         </ul>
  60.         {% elseif (price is defined) %}
  61.         <script>_config.priceFilterSlider = true;</script>
  62.         {% set currency = demi_paymentGetCurrency() %}
  63.         <div class="js-price-slider">
  64.             <div class="row row--gutter-width-10">
  65.                 <div class="col">
  66.                     <label for="filter-price-from" class="sr-only">{{ "demi.filter.price-from" | trans }}</label>
  67.                     <div class="input-group">
  68.                         <span class="input-group-addon p-2 text-muted">{{ currency }}</span>
  69.                         <input type="number" pattern="[0-9]*" id="filter-price-from" name="price-from" placeholder="von" class="form-control text-right pl-0 bg-white js-price-slider__input-min">
  70.                     </div>
  71.                 </div>
  72.                 <div class="col col-auto py-2 ">
  73.                     -
  74.                 </div>
  75.                 <div class="col">
  76.                     <label for="filter-price-to" class="sr-only">{{ "demi.filter.price-to" | trans }}</label>
  77.                     <div class="input-group">
  78.                         <span class="input-group-addon p-2 text-muted">{{ currency }}</span>
  79.                         <input type="number" pattern="[0-9]*" id="filter-price-to" name="price-to" placeholder="bis" class="form-control text-right pl-0 bg-white js-price-slider__input-max">
  80.                     </div>
  81.                 </div>
  82.             </div>
  83.             <div class="js-price-slider__slider mt-3 mb-2 price-slider-wrapper noUi-extended"></div>
  84.         </div>
  85.     {% endif %}
  86.     {#  //data-remove contains a comma separated list with the filter-names it should remove #}
  87.     <button type="button" class="btn-no-styling text-primary mt-3 js-filter-form__remove-filter" data-remove="{{ name }}">
  88.         <span class="btn__icon demi-icon demi-icon-arrow-left mr-2" aria-hidden="true"></span>{{ 'demi.filter.deselect' | trans }}
  89.     </button>
  90.     {% if ( showHr is defined and showHr ) %}
  91.         <hr class="my-4">
  92.     {% endif %}
  93. </div>