results.html.twig 2.0KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. {% extends "MuzichCoreBundle::layout.html.twig" %}
  2. {% block title %}{{ 'title.search'|trans({}, 'userui') }}{% 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. 'display_autoplay' : true,
  36. 'autoplay_context' : 'home'
  37. }%}
  38. {% if display_more_button and results.elements|length %}
  39. {% include "MuzichCoreBundle:SearchElement:more_button.html.twig" with {
  40. 'more_path' : path('global_search_elements_empty')
  41. }%}
  42. {% endif %}
  43. {% endif %}
  44. {% elseif app.request.getMethod == 'POST' %}
  45. <p>
  46. {{ 'global_search.no_results'|trans({}, 'userui') }}
  47. </p>
  48. {% endif %}
  49. </div>
  50. {% endblock %}