{% extends "MuzichCoreBundle::layout.html.twig" %}

{% block title %}Recherche{% endblock %}

{% block main_content %}

  {% include "MuzichCoreBundle:Menu:containerMenu.html.twig" with {'active': null} %}
  
  {% include "MuzichCoreBundle:GlobalSearch:form.html.twig" with {'form': form } %}
  
  {% if results.users|length or results.groups|length or results.elements|length %}
  
    {% if results.users %}

      <b>{{ 'search.users'|trans({}, 'network') }}</b>
      
      <ul id="search_users" class="inline">
      {% for user in results.users %} 
        <li>
          <a href="{{ path('show_user', { 'slug': user.slug }) }}">{{ user.username }}</a>
        </li>
      {% endfor %}
      </ul>

    {% endif %}
  
    {% if results.groups %}

      <b>{{ 'search.groups'|trans({}, 'network') }}</b>
      
      <ul id="search_groups" class="inline">
      {% for group in results.groups %} 
        <li>
          <a href="{{ path('show_group', { 'slug': group.slug }) }}">{{ group.name }}</a>
        </li>
      {% endfor %}
      </ul>

    {% endif %}
  
    {% if results.elements %}
      
      {% include "MuzichCoreBundle:SearchElement:default.html.twig" with {
        'noelements_filter' : true,
        'elements'          : results.elements
      }%}
      
    {% endif %}
      
  {% else %}
      
  {% endif %}

{% endblock %}