results.html.twig 1.7KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. {% extends "MuzichCoreBundle::layout.html.twig" %}
  2. {% block title %}Recherche{% endblock %}
  3. {% block main_content %}
  4. {% include "MuzichCoreBundle:Menu:containerMenu.html.twig" with {'active': null} %}
  5. <div id="results_search_form">
  6. {% include "MuzichCoreBundle:GlobalSearch:form.html.twig" with {'form': form } %}
  7. </div>
  8. {% if results.users|length or results.groups|length or results.elements|length %}
  9. {% if results.users %}
  10. <b>{{ 'search.users'|trans({}, 'network') }}</b>
  11. <ul id="search_users" class="inline">
  12. {% for user in results.users %}
  13. <li>
  14. <a href="{{ path('show_user', { 'slug': user.slug }) }}">{{ user.username }}</a>
  15. </li>
  16. {% endfor %}
  17. </ul>
  18. {% endif %}
  19. {% if results.groups %}
  20. <b>{{ 'search.groups'|trans({}, 'network') }}</b>
  21. <ul id="search_groups" class="inline">
  22. {% for group in results.groups %}
  23. <li>
  24. <a href="{{ path('show_group', { 'slug': group.slug }) }}">{{ group.name }}</a>
  25. </li>
  26. {% endfor %}
  27. </ul>
  28. {% endif %}
  29. {% if results.elements %}
  30. {% include "MuzichCoreBundle:SearchElement:default.html.twig" with {
  31. 'noelements_filter' : true,
  32. 'elements' : results.elements
  33. }%}
  34. {% include "MuzichCoreBundle:SearchElement:more_button.html.twig" with {
  35. 'display_more_button' : display_more_button,
  36. 'elements_length' : results.elements|length,
  37. 'more_path' : 'global_search_elements_empty'
  38. }%}
  39. {% endif %}
  40. {% elseif app.request.getMethod == 'POST' %}
  41. <p>
  42. {{ 'global_search.no_results'|trans({}, 'userui') }}
  43. </p>
  44. {% endif %}
  45. {% endblock %}