index.html.twig 2.9KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. {% extends "MuzichHomeBundle::layout.html.twig" %}
  2. {% if login is not defined %}
  3. {% set login = false %}
  4. {% endif %}
  5. {% block title %}{% if page_title %}{{ page_title }}{% else %}{{ 'title.home'|trans({}, 'userui') }}{% endif %}{% endblock %}
  6. {% block mainbox_classes %}mainbox_margintop mainbox_nopadding{% endblock %}
  7. {% block content %}
  8. {% include 'MuzichCoreBundle:Component:element_add_buttons.html.twig' %}
  9. {% include 'MuzichHomeBundle:Component:filter_menu.html.twig' %}
  10. {% include 'MuzichCoreBundle:Component:element_add_box.html.twig' with {
  11. 'box_title': 'home.add_element_box.title'|trans({}, 'navigationui')
  12. } %}
  13. {% if app.user %}
  14. {% if app.user.wantSeeHelp('home') %}
  15. {% include 'MuzichCoreBundle:HelpTour:home.html.twig' with {'start' : true} %}
  16. {% endif %}
  17. {% else %}
  18. {% include 'MuzichCoreBundle:HelpTour:home.html.twig' with {'start' : false} %}
  19. {% endif %}
  20. {# TODO: Cette partie de javascript ne devra plus exister après la réecriture du code javascript #}
  21. {% if from_url is defined %}
  22. {% if from_url %}
  23. <script type="text/javascript">
  24. $(document).ready(function(){
  25. $('#element_add_box').slideDown("slow");
  26. $('#element_add_link').hide();
  27. $('form[name="search"]').slideUp();
  28. $('img#form_add_loader').show();
  29. $('input#element_add_url').val("{{ from_url }}");
  30. $('form[name="add"]').submit();
  31. });
  32. </script>
  33. {% endif %}
  34. {% endif %}
  35. {% if login %}
  36. <script type="text/javascript">
  37. $(document).ready(function(){
  38. {% if not email_token %}
  39. open_connection_or_subscription_window(true);
  40. {% else %}
  41. open_connection_or_subscription_window(true, {"email_confirmation_token":"{{ email_token }}"});
  42. {% endif %}
  43. });
  44. </script>
  45. {% endif %}
  46. <div class="top_tools">
  47. <div class="search_tools">
  48. <form name="{{ search_form_name }}" action="{{ path('search_elements', {'context':'home'}) }}" method="post" {{ form_enctype(search_form) }}>
  49. {% include "MuzichCoreBundle:SearchElement:form.html.twig" with {
  50. 'form_name' : search_form_name,
  51. 'search_tags' : search_tags_id,
  52. 'display_help_notags' : true
  53. } %}
  54. <input class="main button" type="submit" value="{{ 'filter.submit'|trans({}, 'userui') }}"/>
  55. </form>
  56. </div>
  57. </div>
  58. <div id="elements_list">
  59. {% include "MuzichCoreBundle:SearchElement:default.html.twig" with {
  60. 'noelements_filter' : true,
  61. 'display_new_elements' : true,
  62. 'display_autoplay' : true,
  63. 'autoplay_context' : 'home'
  64. }%}
  65. </div>
  66. {% if elements|length %}
  67. {% include "MuzichCoreBundle:SearchElement:more_button.html.twig" with {
  68. 'more_path' : path('search_elements', {'context':'home'})
  69. }%}
  70. {% endif %}
  71. {% endblock %}