templates/Tour/overview.html.twig line 1

Open in your IDE?
  1. {% extends "Layout/default.html.twig" %}
  2. {% block content %}
  3.     {{ include('Navigation/breadcrumb.html.twig') }}
  4.     {{ include('Includes/main-title-block-splitted-editable.html.twig') }}
  5.     {{ include('Includes/areablock.html.twig') }}
  6.     {% if pimcore_numeric('qs').empty %}
  7.         {% do pimcore_numeric('qs').setDataFromResource(70) %}
  8.     {% endif %}
  9.     {% if editmode %}
  10.         <div class="editmode-box editmode-box--info">
  11.             <div class="editmode-box__header">
  12.                 Prefilters
  13.             </div>
  14.             <strong>Regions</strong> <small>AlpsteinRegion Objects or Region Objects</small> <br>
  15.             {{ pimcore_relations('regions', {'types': ['object'], 'subtypes': ['object'], 'classes': ['AlpsteinRegion', 'Region']}) }}
  16.             <br>
  17.             <strong>TourType</strong> <small>AlpsteinCategory Objects</small>
  18.             {{ pimcore_relations('categories', {'types': ['object'], 'subtypes': ['object'], 'classes': ['AlpsteinCategory']}) }}
  19.             <br>
  20.             <div class="row">
  21.                 <div class="col-md-2">
  22.                     <strong>Minimum Quality Score</strong>
  23.                     {{ pimcore_numeric('qs', {
  24.                         "minValue" : 0,
  25.                         "maxValue" : 100,
  26.                         "decimalPrecision" : 0
  27.                     }) }}
  28.                 </div>
  29.                 <div class="col-md-2">
  30.                     <strong>Sorting:</strong><br>
  31.                     {{ pimcore_select("tour_sorting", {
  32.                         "store": [
  33.                             ["", "no sorting"],
  34.                             ["opened DESC", "Opened First"],
  35.                             ["opened ASC", "Closed First"]
  36.                         ],
  37.                         "defaultValue" : ""
  38.                     }) }}
  39.                 </div>
  40.             </div>
  41.             <br>
  42.             <div class="editmode-box__header">
  43.                 PropertyFilter
  44.             </div>
  45.             <strong>TourProperty</strong> <small>AlpsteinProperty Objects</small>
  46.             {{ pimcore_relations('properties', {'types': ['object'], 'subtypes': ['object'], 'classes': ['AlpsteinProperty']}) }}
  47.         </div>
  48.     {% endif %}
  49.     <div class="pimcore_area_content">
  50.         <div class="container content-block">
  51.             <div class="js-ajax-form" data-ajax-form-add-url-params="true">
  52.                 <div aria-live="polite">
  53.                     <div class="content-block">
  54.                         <div class="filter-overlay js-overlay" id="filterOverlay">
  55.                             <div class="filter-overlay__head font-default-bold text-uppercase d-flex align-items-center d-md-none">
  56.                                 {{ 'tour-overview.Filter'|trans }}
  57.                                 <button type="button" data-target="filterOverlay" class="btn btn-no-styling text-white js-overlay-toggle d-md-none ml-auto filter-overlay__head__close">
  58.                                     <span class="icon icon-close" aria-label="{{ 'sr.close'|trans }}" title="{{ 'sr.close'|trans }}"></span>
  59.                                 </button>
  60.                             </div>
  61.                             <div class="filter-overlay__content">
  62.                                 <form action="/404"
  63.                                       data-action="{{ app.request.pathInfo }}"
  64.                                       class="js-ajax-form__form">
  65.                                     <div class="row justify-content-center">
  66.                                         {% if community|default(false) is instanceof('\\Pimcore\\Model\\DataObject\\Community') %}
  67.                                             <div class="col-md">
  68.                                                 {% set default = [
  69.                                                     {
  70.                                                         "label": '',
  71.                                                         "value": ''
  72.                                                     }, {
  73.                                                         "label": community.name,
  74.                                                         "value": community.id,
  75.                                                         "selected": true
  76.                                                     }] %}
  77.                                                 {{ include('Form/Includes/select.html.twig', {
  78.                                                     inputModifier: "js-floating-label",
  79.                                                     labelModifier: "floating-label",
  80.                                                     inputWrapperModifier: "select__input-wrapper position-relative",
  81.                                                     id: "community",
  82.                                                     name: "community",
  83.                                                     label: 'tour-overview.Community'|trans,
  84.                                                     styleModifier: 'form-group--lg',
  85.                                                     options: default
  86.                                                 }) }}
  87.                                             </div>
  88.                                         {% elseif pimcore_relations('regions').empty %}
  89.                                             <div class="col-md">
  90.                                                 {% set default = [{
  91.                                                     "label": "",
  92.                                                     "value": ""
  93.                                                 }] %}
  94.                                                 {{ include('Form/Includes/select.html.twig', {
  95.                                                     inputModifier: "js-floating-label",
  96.                                                     labelModifier: "floating-label",
  97.                                                     inputWrapperModifier: "select__input-wrapper position-relative",
  98.                                                     id: "tourRegion",
  99.                                                     name: "tourRegion",
  100.                                                     label: 'tour-overview.Regionen'|trans,
  101.                                                     styleModifier: 'form-group--lg',
  102.                                                     options: default|merge(filterData['regions'] | map( x => {
  103.                                                         "label": x['name'],
  104.                                                         "value": x['id'],
  105.                                                         "selected": app.request.get('tourRegion') == x['id'],
  106.                                                         "class": ""
  107.                                                     }))
  108.                                                 }) }}
  109.                                             </div>
  110.                                         {% endif %}
  111.                                         {% if pimcore_relations('categories').empty or filterData.childCategories|default([]) is not empty %}
  112.                                             <div class="col-md">
  113.                                                 {% set default = [{
  114.                                                     "label": "",
  115.                                                     "value": ""
  116.                                                 }] %}
  117.                                                 {{ include('Form/Includes/select.html.twig', {
  118.                                                     inputModifier: "js-floating-label",
  119.                                                     labelModifier: "floating-label",
  120.                                                     inputWrapperModifier: "select__input-wrapper position-relative",
  121.                                                     id: "tourCategory",
  122.                                                     name: "tourCategory",
  123.                                                     label: 'tour-overview.Art der Tour'|trans,
  124.                                                     styleModifier: 'form-group--lg',
  125.                                                     options: default|merge((filterData.childCategories|default([]) is not empty ? filterData.childCategories : filterData['categories']) | map( x => {
  126.                                                         "label": x.name,
  127.                                                         "value": x.id,
  128.                                                         "selected": app.request.get('tourCategory') == x.id,
  129.                                                         "class": ""
  130.                                                     }))
  131.                                                 }) }}
  132.                                             </div>
  133.                                         {% endif %}
  134.                                         {% if not pimcore_relations('properties').empty %}
  135.                                             <div class="col-md">
  136.                                                 {% set default = [{
  137.                                                     "label": "",
  138.                                                     "value": ""
  139.                                                 }] %}
  140.                                                 {{ include('Form/Includes/select.html.twig', {
  141.                                                     inputModifier: "js-floating-label",
  142.                                                     labelModifier: "floating-label",
  143.                                                     inputWrapperModifier: "select__input-wrapper position-relative",
  144.                                                     id: "tourProperty",
  145.                                                     name: "tourProperty",
  146.                                                     label: 'tour-overview.Tour Property'|trans,
  147.                                                     styleModifier: 'form-group--lg',
  148.                                                     options: default|merge(pimcore_relations('properties').data|filter(x => x.name is not empty) | map( x => {
  149.                                                         "label": x.name,
  150.                                                         "value": x.id,
  151.                                                         "selected": app.request.get('tourProperty') == x.id,
  152.                                                         "class": ""
  153.                                                     }))
  154.                                                 }) }}
  155.                                             </div>
  156.                                         {% endif %}
  157.                                         <div class="col-md">
  158.                                             {{ include('Form/Includes/select.html.twig', {
  159.                                                 inputModifier: "js-floating-label",
  160.                                                 labelModifier: "floating-label",
  161.                                                 inputWrapperModifier: "select__input-wrapper position-relative",
  162.                                                 id: "tourDifficulty",
  163.                                                 name: "tourDifficulty",
  164.                                                 label: 'tour-overview.Schwierigkeit'|trans,
  165.                                                 styleModifier: 'form-group--lg',
  166.                                                 options: [
  167.                                                     {
  168.                                                         "label": "",
  169.                                                         "value": ""
  170.                                                     }, {
  171.                                                         "label": 'tour-overview.leicht'|trans,
  172.                                                         "value": "1",
  173.                                                         "selected": app.request.get('tourDifficulty') == "1",
  174.                                                         "class": ""
  175.                                                     }, {
  176.                                                         "label": 'tour-overview.mittel'|trans,
  177.                                                         "value": "2",
  178.                                                         "selected": app.request.get('tourDifficulty') == "2",
  179.                                                         "class": ""
  180.                                                     }, {
  181.                                                         "label": 'tour-overview.schwer'|trans,
  182.                                                         "value": "3",
  183.                                                         "selected": app.request.get('tourDifficulty') == "3",
  184.                                                         "class": ""
  185.                                                     }
  186.                                                 ]
  187.                                             }) }}
  188.                                         </div>
  189.                                         <div class="col-md">
  190.                                             {{ include('Form/Includes/form-control.html.twig', {
  191.                                                 inputModifier: 'js-floating-label',
  192.                                                 inputWrapperModifier: 'position-relative',
  193.                                                 labelModifier: 'floating-label',
  194.                                                 label: 'tour-overview.Stichwortsuche'|trans,
  195.                                                 styleModifier: 'form-group--lg',
  196.                                                 id: 'tourKeyword',
  197.                                                 name: 'tourKeyword',
  198.                                                 value: app.request.get('tourKeyword')
  199.                                             }) }}
  200.                                         </div>
  201.                                     </div>
  202.                                     <div class="row justify-content-center">
  203.                                         <div class="col-md-4">
  204.                                             {{ include('Form/Includes/range-slider.html.twig', {
  205.                                                 label: 'tour-overview.Länge in km'|trans,
  206.                                                 max: filterData['length']['max']|default(0.0),
  207.                                                 name: 'rangeLength',
  208.                                                 prefix: 'km',
  209.                                                 styleModifier: 'form-group--lg',
  210.                                                 minVal: app.request.get('rangeLengthMin', 0.0),
  211.                                                 maxVal: app.request.get('rangeLengthMax', filterData['length']['max']|default(0.0))
  212.                                             }) }}
  213.                                         </div>
  214.                                         <div class="col-md-4">
  215.                                             {{ include('Form/Includes/range-slider.html.twig', {
  216.                                                 label: 'tour-overview.Dauer in h'|trans,
  217.                                                 max: filterData['duration']['max']|default(0.0),
  218.                                                 name: 'duration',
  219.                                                 prefix: 'h',
  220.                                                 styleModifier: 'form-group--lg',
  221.                                                 minVal: app.request.get('durationMin', 0.0),
  222.                                                 maxVal: app.request.get('durationMax', filterData['duration']['max']|default(0.0))
  223.                                             }) }}
  224.                                         </div>
  225.                                         <div class="col-md-4">
  226.                                             {{ include('Form/Includes/range-slider.html.twig', {
  227.                                                 label: 'tour-overview.Höhenmeter'|trans,
  228.                                                 max: filterData['altitude']['max']|default(0.0),
  229.                                                 name: 'altitude',
  230.                                                 prefix: 'm',
  231.                                                 styleModifier: 'form-group--lg',
  232.                                                 minVal: app.request.get('altitudeMin', 0.0),
  233.                                                 maxVal: app.request.get('altitudeMax', filterData['altitude']['max']|default(0.0))
  234.                                             }) }}
  235.                                         </div>
  236.                                     </div>
  237.                                     <div class="d-flex justify-content-center">
  238.                                         {{ include('Form/Includes/checkbox.html.twig', {
  239.                                             id: 'publicTransportFriendly',
  240.                                             name: 'publicTransportFriendly',
  241.                                             label: '<span class="icon icon-traffic mr-2" aria-label="mit Bus erreichbar" data-toggle="tooltip" data-original-title="' ~ 'tour.mit Bus erreichbar'|trans  ~ '"></span>' ~ ('tour-overview.Public Transport Friendly'|trans),
  242.                                         }) }}
  243.                                     </div>
  244.                                     <div class="text-center">
  245.                                         <button type="submit" class="btn btn-primary-light">{{ 'tour-ovierview.Ergebnisse anzeigen'|trans }}</button>
  246.                                         <div class="mt-3">
  247.                                             <a href="#" class="text-primary-light text-underline js-ajax-form__reset">{{ 'tour-ovierview.Filter zurücksetzen'|trans }}</a>
  248.                                         </div>
  249.                                     </div>
  250.                                 </form>
  251.                             </div>
  252.                         </div>
  253.                     </div>
  254.                     <div class="content-block">
  255.                         <div class="js-ajax-form__notifications mb-3" hidden></div>
  256.                         <div class="js-ajax-form__error-area mb-3" hidden>
  257.                             <button class="js-ajax-form__retry btn btn-info ml-2">{{ 'tour-ovierview.Retry'|trans }}</button>
  258.                         </div>
  259.                         {{ include('Includes/loading-overlay.html.twig', {styleModifier: 'js-ajax-form__loading'}) }}
  260.                         <div class="js-ajax-form__result">
  261.                             {{ include('Tour/container.html.twig', {'tourListing': tourListing}) }}
  262.                         </div>
  263.                     </div>
  264.                 </div>
  265.             </div>
  266.         </div>
  267.     </div>
  268.     {{ include('Includes/areablock.html.twig', {'areaName': 'bottomContent'}) }}
  269. {% endblock %}
  270. {% block javascripts %}
  271.     {% if not app.request.get('onlyInlineCss') %}
  272.         {{ include('Layout/includes/encore.html.twig', {
  273.             'staticDebugMode': staticDebugMode,
  274.             'file': 'js/tour'
  275.         }) }}
  276.     {% endif %}
  277. {% endblock %}