src/Aqarmap/Bundle/ListingBundle/Resources/views/CompoundSearch/sortSelect.html.twig line 1

  1. {% set _rout = app.request.attributes.get('_route') %}
  2. {% set all_query = app.request.query.all %}
  3. {% set sort = app.request.query.get('sort') %}
  4. {% set direction = app.request.query.get('direction') %}
  5. {% if location %}
  6. {% set all_query = all_query|merge({'location': location.slug}) %}
  7. {% endif %}
  8. <select class="custom-dropdown dropup hide-tick btn-label" onchange="javascript:location.href = sortList.getUrl(
  9. {
  10. sortBy: {
  11. key: 'sort',
  12. value: this.value
  13. },
  14. sortOrder: {
  15. key: 'direction',
  16. value: this.options[this.selectedIndex].getAttribute('order')
  17. }
  18. });">
  19. <option selected disabled>{{ 'layout.sort_results'|trans }}</option>
  20. <option value="price" order="asc"
  21. {% if sort == 'price' and direction == 'asc' %} selected {% endif %}
  22. >
  23. {{ 'layout.price_asc'|trans }}
  24. </option>
  25. <option value="price" order="desc"
  26. {% if sort == 'price' and direction == 'desc' %} selected {% endif %}
  27. >
  28. {{ 'layout.price_desc'|trans }}
  29. </option>
  30. <option value="pricePerMeter" order="asc"
  31. {% if sort == 'pricePerMeter' and direction == 'asc' %} selected {% endif %}
  32. >
  33. {{ 'layout.price_meter_asc'|trans }}
  34. </option>
  35. <option value="pricePerMeter" order="desc"
  36. {% if sort == 'pricePerMeter' and direction == 'desc' %} selected {% endif %}
  37. >
  38. {{ 'layout.price_meter_desc'|trans }}
  39. </option>
  40. </select>