{% extends 'layout.html.twig' %} {% import "macros.html.twig" as macros %} {% set breadcrumb = buildBreadcrumb([{'route': 'app_search_index', 'trans': 'menu.search'}], null, form.vars.value.term is not null ? form.vars.value.term : null) %} {% block title %} {{ renderTitle(breadcrumb) }} {% endblock %} {% block breadcrumb %} {{ renderBreadcrumb(breadcrumb) }} {% endblock %} {% block content %}

{{ 'menu.search'|trans }}

{{ form_start(form, {'method': 'GET'}) }}
{{ form_row(form.term, {'label' : 'label.search'}) }}
{{ form_row(form.createdAt, {'label' : 'label.added_at', 'attr': {'class' : 'datepicker' } }) }}
{{ form_row(form.searchInCollections, {'label': 'label.collections'}) }}
{{ form_row(form.searchInItems, {'label': 'label.items'}) }}
{% if isFeatureEnabled('tags') %}
{{ form_row(form.searchInTags, {'label': 'label.tags'}) }}
{% endif %} {% if isFeatureEnabled('albums') %}
{{ form_row(form.searchInAlbums, {'label': 'label.albums'}) }}
{% endif %} {% if isFeatureEnabled('wishlists') %}
{{ form_row(form.searchInWishlists, {'label': 'label.wishlists'}) }}
{% endif %}
{{ form_end(form) }}
{% if results|length > 0 %} {% if results.items is defined and results.items|length > 0 %}

{{ 'title.items'|trans }}

{% endif %} {% if results.collections is defined and results.collections|length > 0 %}

{{ 'title.collections'|trans }}

{{ include('App/Collection/_list.html.twig', {'collections': results.collections|naturalSorting}) }}
{% endif %} {% if results.wishlists is defined and results.wishlists|length > 0 %}

{{ 'title.wishlists'|trans }}

{{ include('App/Wishlist/_list.html.twig', {'wishlists': results.wishlists|naturalSorting}) }}
{% endif %} {% if results.albums is defined and results.albums|length > 0 %}

{{ 'title.albums'|trans }}

{{ include('App/Album/_list.html.twig', {'albums': results.albums|naturalSorting}) }}
{% endif %} {% if results.tags is defined and results.tags|length > 0 %}

{{ 'title.tags'|trans }}

{% for result in results.tags %} {% endfor %}
{{ 'label.name'|trans }} {{ 'label.description'|trans }} {{ 'label.number_of_items'|trans }} {{ 'label.percent_of_items'|trans }}
{{ result.tag.label|u.truncate(50) }} {{ result.tag.description|u.truncate(50) }} {{ result.itemCount }} {{ result.percent|round(2, 'common') }} %
{% endif %} {% else %} {{ 'message.search_empty'|trans }} {% endif %}
{% endblock %}