results.html.twig 1.9KB

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