templates/city/list.html.twig line 33

Open in your IDE?
  1. {% set body_classes = ['list-of-cities'] %}
  2. {% set suffix = currentPage == 1 ? '' : '_with_page' %}
  3. {% set title = ('city_list' ~ suffix ~ '.title')|trans({'%page%': currentPage}) %}
  4. {% set description = ('city_list' ~ suffix ~ '.description')|trans({'%page%': currentPage}) %}
  5. {% set keywords = ('city_list' ~ suffix ~ '.keywords')|trans({'%page%': currentPage}) %}
  6. {% extends 'base.html.twig' %}
  7. {% block stylesheets %}
  8.     {{ parent() }}
  9.     {{ encore_entry_link_tags('city_list') }}
  10.     {{ encore_entry_link_tags('search_autocomplete') }}
  11. {% endblock stylesheets %}
  12. {% block content %}
  13.     <main>
  14.         <div class="container">
  15.             <div class="list-of-cities-container">
  16.                 <div class="search-form-wrapper animate-on-scroll-bottom">
  17.                     <div class="title">
  18.                         <h3>{{ 'cities.list_title'|trans|raw }}</h3>
  19.                     </div>
  20.                     {{ form_start(form, {'attr': {
  21.                         'data-controller': 'search',
  22.                         'data-search-url-value': path('search_cities_with_profiles'),
  23.                         'data-action': 'submit->search#onSubmit',
  24.                     }}) }}
  25.                         <div class="field-wrapper">
  26.                             {{ form_widget(form.search, {'attr': {
  27.                                 'data-action': 'input->search#onAutocomplete click->search#onClick',
  28.                                 'data-search-target': 'input',
  29.                             }}) }}
  30.                             <div class="autocomplete-results" {{ stimulus_target('search', 'results') }}></div>
  31.                         </div>
  32.                         <div class="buttons-container">
  33.                             {{ form_widget(form.submit) }}
  34.                         </div>
  35.                     {{ form_end(form) }}
  36.                 </div>
  37.                 <div class="list-wrapper">
  38.                     {% for city in cities %}
  39.                         <a href="{{ path('city_companies_list', {'id': city.id, 'slug': city.slug}) }}" class="city">
  40.                             {{ city.name }}
  41.                         </a>
  42.                     {% endfor %}
  43.                 </div>
  44.                 {% if pagination|length > 1 %}
  45.                     <div class="toolbar-bottom-container">
  46.                         <nav class="pagination-container">
  47.                             {% if currentPage > 1 %}
  48.                                 <a href="{{ path('city_list', { page: currentPage - 1 }) }}" class="p-i-previous"></a>
  49.                             {% else %}
  50.                                 <span class="p-i-previous p-i-disabled"></span>
  51.                             {% endif %}
  52.                             <span class="pagination-pages">
  53.                                 {% for p in pagination %}
  54.                                     {% if p == currentPage %}
  55.                                         <span class="pagination-item p-i p-i-disabled">{{ p }}</span>
  56.                                     {% elseif p == '...' %}
  57.                                         <span class="pagination-item p-i">…</span>
  58.                                     {% else %}
  59.                                         <a href="{{ path('city_list', { page: p }) }}" class="pagination-item p-i">
  60.                                             {{ p }}
  61.                                         </a>
  62.                                     {% endif %}
  63.                                 {% endfor %}
  64.                             </span>
  65.                             {% if currentPage < pagination|last %}
  66.                                 <a href="{{ path('city_list', { page: currentPage + 1 }) }}" class="p-i-next"></a>
  67.                             {% else %}
  68.                                 <span class="p-i-next p-i-disabled"></span>
  69.                             {% endif %}
  70.                         </nav>
  71.                     </div>
  72.                 {% endif %}
  73.             </div>
  74.         </div>
  75.     </main>
  76. {% endblock content %}