templates/search_properties/_header.html.twig line 1

Open in your IDE?
  1. {% import 'search_properties/_macros.twig' as macros %}
  2. <header class='z-3 no-scrollbar-flicker bg-white border-bottom header-offers'>
  3.   <div class='grid-container fluid'>
  4.     <div class='grid-x grid-margin-x align-middle header-height-offers'>
  5.       <div class='shrink large-2 cell' :class='{"show-for-xlarge": showDetail}'>
  6.         <div class='header-height-offers flex-container align-middle'>
  7.           <a href='/' class='header-logo c-dark-blue'>
  8.             {% include 'search_properties/elements/logo.svg.twig' with { attrs: 'width="180" height="45"' } %}
  9.           </a>
  10.         </div>
  11.       </div>
  12.       <div class="auto cell pr-hamburger-width">
  13.         <button @click='closeDetail' v-show="showDetail" style='display: none'
  14.               class='button-reset t-label-regular icon-left icon-left--text-visible border hover-bc-dark-blue c-black'
  15.         >
  16.           <svg width="17" height="9">
  17.             <g class='scale-x--1'>
  18.               <use xlink:href='#arrow-small' />
  19.             </g>
  20.           </svg>
  21.           {{'Retour aux résultats'|trans|capitalize}}
  22.         </button>
  23.         <form v-show="!showDetail" class='offers-search show-for-xlarge'>
  24.           <div class='grid-x'>
  25.             <div class='shrink cell'>
  26.               <div class='dropdown dropdown--hoverable mr-32'>
  27.                 <div class='bg-dark-blue c-white bg-arrow px-24 py-24'>
  28.                     <p class='t-label-regular mr-12'
  29.                     v-text='rent ? "{{'Louer'|trans|capitalize}}" : "{{'Acheter'|trans|capitalize}}"'
  30.                   ></p>
  31.                 </div>
  32.                 <div class='dropdown__body bg-white z-2'>
  33.                       <ul>
  34.                           <li class='list-style-none'>
  35.                       <a href='#' class='checkbox border-bottom checkbox-dropdown-item checkbox-dropdown-item--py-24 px-24 t-label-regular ws-nowrap'
  36.                         @click.prevent='rent = !rent'
  37.                         v-text='rent ? "{{'Acheter'|trans|capitalize}}" : "{{'Louer'|trans|capitalize}}"'
  38.                       ></a>
  39.                           </li>
  40.                       </ul>
  41.                 </div>
  42.                 </div>
  43.             </div>
  44.             <label class='small-2 cell border hover-bc-dark-blue custom-multiselect custom-multiselect--topbar'>
  45.                 <locations-picker
  46.                 v-model="filters.location"
  47.                 url="{{path('offers_locations_autocomplete')}}"
  48.                 placeholder="{{'Localité(s) (Canton, ville, NPA)'|trans}}"
  49.                 :limit="topbarOptionsLimit"
  50.                 open-direction="bottom"
  51.               />
  52.             </label>
  53.             
  54.             <label class='small-1 cell border hover-bc-dark-blue custom-multiselect custom-multiselect--topbar' v-show="isRadiusEnabled">
  55.                 <multiselect
  56.                 v-model="filters.radius"
  57.                 :options="{{radiusOptions | json_encode}}"
  58.                 placeholder="{{'Radius'|capitalize}}"
  59.                 open-direction="bottom"
  60.                 :show-labels="false"
  61.                 :option-height="49"
  62.                 :searchable="false"
  63.                 :max-height="320"
  64.                       open-direction="bottom"
  65.               >
  66.                 <div slot='singleLabel' slot-scope='{ option }'>
  67.                               <span v-text='"+" + option + "km"'></span>
  68.                 </div>
  69.                 <span class="checkbox checkbox--radio" slot='option' slot-scope='{ option }'>
  70.                       <span class='checkbox__fake' :class='{"checkbox__fake--active": filters.radius && filters.radius == option }'>
  71.                           <svg width='10' height='10' viewBox='0 0 10 10'>
  72.                       <polyline points='2,5 4,7 8,3'></polyline>
  73.                     </svg>
  74.                       </span>
  75.                       <span class='checkbox__label t-label-regular' v-text='option + "km"'></span>
  76.                 </span>
  77.               </multiselect>
  78.             </label>
  79.             <div class='small-3 cell border hover-bc-dark-blue custom-multiselect custom-multiselect--topbar'>
  80.               <multiselect
  81.                 v-model="filters.type"
  82.                 :multiple="true"
  83.                 :options="{{categories | json_encode}}"
  84.                 placeholder="{{'type(s) de bien'|capitalize}}"
  85.                 open-direction="bottom"
  86.                 :show-labels="false"
  87.                 :option-height="49"
  88.                 :searchable="false"
  89.                 :limit="topbarOptionsLimit"
  90.                 :limit-text="count => `+${count}`"
  91.                 :max-height="320"
  92.               >
  93.                 <span class="checkbox" slot='option' slot-scope='props'>
  94.                       <span class='checkbox__fake' :class='{"checkbox__fake--active": filters.type && filters.type.includes(props.option) }'>
  95.                           <svg width='10' height='10' viewBox='0 0 10 10'>
  96.                       <polyline points='2,5 4,7 8,3'></polyline>
  97.                     </svg>
  98.                       </span>
  99.                       <span class='checkbox__label t-label-regular' v-text='props.option'></span>
  100.                 </span>
  101.               </multiselect>
  102.             </div>
  103.             <div class='auto cell grid-x'>
  104.               <div class='auto cell dropdown border hover-bc-dark-blue' tabindex='0'>
  105.                 <div class='input-block skip' :class='{"input-block_collapsed": !!surfaceSelectionDisplay}'>
  106.                     <span class='input-label t-label-regular'>{{'surface'|trans|title}}</span>
  107.                       <input class='input-field t-label-regular c-dark-blue' disabled tabindex='-1' :value='surfaceSelectionDisplay'>
  108.                   </div>
  109.                 <div class='dropdown__body dropdown__body--auto dropdown__body--auto-height bg-white z-2'>
  110.                   <div class='flex-container py-16'>
  111.                     <div class='px-16'>
  112.                       <number-input-with-suggestions input-class='simple-input number-input-reset w-176'
  113.                         v-model='filters.surfaceMin' :suggestions='minSurfaceSuggestions' :format-option='formatSurfaceOption'
  114.                         placeholder='Min' @change='handleFiltersChange'>
  115.                     </div>
  116.                     <div class='border-right o-02'></div>
  117.                     <div class='px-16 text-right'>
  118.                       <number-input-with-suggestions input-class='simple-input number-input-reset w-176'
  119.                         v-model='filters.surfaceMax' :suggestions='maxSurfaceSuggestions' :format-option='formatSurfaceOption'
  120.                         placeholder='Max' @change='handleFiltersChange'>
  121.                     </div>
  122.                   </div>
  123.                 </div>
  124.               </div>
  125.             </div>
  126.             <div class='auto cell dropdown border hover-bc-dark-blue' tabindex='0'>
  127.                 <div class='input-block skip' :class='{"input-block_collapsed": priceSelectionDisplay}'>
  128.                   <span class='input-label t-label-regular' v-text='rent ? "{{'loyer'|trans|title}}" : "{{'budget'|trans|title}}"'></span>
  129.                   <input class='input-field t-label-regular c-dark-blue' disabled tabindex='-1' :value='priceSelectionDisplay'>
  130.                 </div>
  131.                 <div class='dropdown__body dropdown__body--auto dropdown__body--right dropdown__body--auto-height bg-white z-2 py-16'>
  132.                   <div class='grid-x px-16 mb-16' v-if='rent'>
  133.                     <button type='button' class='button-reset t-label-regular small-tab-button small-6 cell text-center bg-white'
  134.                       :class='{"active": !filters.priceSqm}'
  135.                       @click='togglePricePerSqm(false)'
  136.                     >
  137.                       <span v-if="rent">{{'par mois'|trans|capitalize}}</span>
  138.                       <span v-else>{{'totale'|trans|capitalize}}</span>
  139.                     </button>
  140.                     <button type='button' class='button-reset t-label-regular small-tab-button small-6 cell text-center bg-white'
  141.                       :class='{"active": filters.priceSqm}'
  142.                       @click='togglePricePerSqm(true)'
  143.                     >
  144.                       {{'par m²'|trans|capitalize}} <span v-if="rent">{% if app.request.locale == "en" %}/year{% else %}/an{% endif %}</span>
  145.                     </button>
  146.                   </div>
  147.                   <div class='flex-container'>
  148.                     <div class='px-16'>
  149.                       <number-input-with-suggestions v-if="filters.priceSqm" input-class='simple-input number-input-reset w-176'
  150.                         v-model='filters.priceSqmMin' :suggestions='minPriceSuggestions' :format-option='formatPriceOption'
  151.                         placeholder='Min' @change='handleFiltersChange'></number-input-with-suggestions>
  152.                       <number-input-with-suggestions v-else input-class='simple-input number-input-reset w-176'
  153.                         v-model='filters.priceMin' :suggestions='minPriceSuggestions' :format-option='formatPriceOption'
  154.                         placeholder='Min' @change='handleFiltersChange'></number-input-with-suggestions>
  155.                     </div>
  156.                     <div class='border-right o-02'></div>
  157.                     <div class='px-16 text-right'>
  158.                       <number-input-with-suggestions v-if="filters.priceSqm" input-class='simple-input number-input-reset w-176'
  159.                         v-model='filters.priceSqmMax' :suggestions='maxPriceSuggestions' :format-option='formatPriceOption'
  160.                         placeholder='Max' @change='handleFiltersChange'></number-input-with-suggestions>
  161.                       <number-input-with-suggestions v-else input-class='simple-input number-input-reset w-176'
  162.                         v-model='filters.priceMax' :suggestions='maxPriceSuggestions' :format-option='formatPriceOption'
  163.                         placeholder='Max' @change='handleFiltersChange'></number-input-with-suggestions>
  164.                     </div>
  165.                   </div>
  166.                 </div>
  167.               </div>
  168.               <div class='shrink cell flex-container align-middle'>
  169.                 {{macros.checkbox({name: 'onlyNew', value: 'Projets neufs'|trans, class: 'px-16 ws-nowrap', attrs: {
  170.                   'v-model': 'filters.isNewProject'
  171.                 }})}}
  172.                 {# {{macros.checkbox({name: 'link360', value: 'Vue 360°', class: 'checkbox-dropdown-item checkbox-dropdown-item--py-24 px-16 ws-nowrap', attrs: {
  173.                   'v-model': 'filters.has360'
  174.                 }})}} #}
  175.               </div>
  176.           </div>
  177.         </form>
  178.       </div>
  179.     </div>
  180.   </div>
  181.   <div class='border-top hide-for-xlarge px-16 py-16' v-if='!showDetail && !showMobileFilters'>
  182.     <button class='button-reset w-100 icon-left icon-left--text-visible icon-left--center pr-32 border bc-dark-blue c-dark-blue grid-x'
  183.       @click='showMobileFilters = true'>
  184.       <svg width='16' height='16'><use xlink:href='#search-16' /></svg>
  185.       <span class='t-button-medium auto cell'>{{'Rechercher'|trans|title}}</span>
  186.     </button>
  187.   </div>
  188. </header>