index.html.twig 2.9KB

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