You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

41 lines
1.6 KiB

{% extends 'base.html.twig' %}
{% block nav %}
{% endblock %}
{% block body %}
<div class="search-page">
<form method="get" action="{{ path('search') }}" class="mb-3">
<label class="search">
<input
type="search"
name="q"
placeholder="{{ 'text.search'|trans }}"
value="{{ query|default('') }}"
/>
<button type="submit"><twig:ux:icon name="iconoir:search" class="icon" /></button>
</label>
</form>
{% if results|default([]) is not empty %}
<twig:Organisms:CardList :list="results" class="article-list" />
{% elseif query|default('') is not empty %}
<p><small>{{ 'text.noResults'|trans }}</small></p>
{% endif %}
{% if pagination is defined and pagination.last_page > 1 %}
{% set _page = pagination.page|default(1) %}
{% set _last = pagination.last_page|default(1) %}
{% set _query = query|default('') %}
{% set _prev_url = _page > 1 ? path('search', _page > 2 ? { q: _query, page: _page - 1 } : { q: _query }) : null %}
{% set _next_url = _page < _last ? path('search', { q: _query, page: _page + 1 }) : null %}
{% include 'components/Molecules/Pagination.html.twig' with {
page: _page,
last_page: _last,
prev_url: _prev_url,
next_url: _next_url,
aria_label: 'Search pagination',
} only %}
{% endif %}
</div>
{% endblock %}