show.html.twig 4.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. {% extends "MuzichFavoriteBundle::layout.html.twig" %}
  2. {% block title %}{{ playlist.name }}{% endblock %}
  3. {% block mainbox_classes %}{% endblock %}
  4. {% block content %}
  5. <div class="top_tools">
  6. <div class="show_options">
  7. <a class="autoplay_playlist button darkbutton" href="{{ path('playlist_datas_for_autoplay', { 'playlist_id' : playlist.id }) }}" >
  8. {{ 'playlist.read'|trans({}, 'elements') }}
  9. </a>
  10. {% if app.user %}
  11. {% if not playlist.owned(app.user) and viewed_user.id != app.user.id %}
  12. {% if not app.user.havePlaylistPicked(playlist) %}
  13. <a class="playlist_pick button darkbutton" href="{{ path_token('playlist_pick', { 'playlist_id' : playlist.id }) }}" >
  14. {{ 'playlist.pick'|trans({}, 'elements') }}
  15. </a>
  16. {% else %}
  17. <a class="playlist_unpick button darkbutton" href="{{ path_token('playlist_unpick', { 'playlist_id' : playlist.id }) }}" >
  18. {{ 'playlist.unpick'|trans({}, 'elements') }}
  19. </a>
  20. {% endif %}
  21. {% endif %}
  22. {% endif %}
  23. <a class="button darkbutton" href="{{ path('playlists_user', {'user_slug' : viewed_user.slug}) }}" >
  24. {{ 'user.view_playlists'|trans({}, 'users') }}
  25. </a>
  26. </div>
  27. <h1>
  28. {{ playlist.name }}
  29. {% if playlist.public %}
  30. {{ 'playlist.public_word'|trans({}, 'elements') }}
  31. {% endif %}
  32. </h1>
  33. {% if playlist.owned(app.user) %}
  34. <p>{{ 'playlist.how_add_element'|trans({}, 'elements') }}</p>
  35. {% endif %}
  36. {% include "MuzichCoreBundle:Tag:tag_cloud.html.twig" with {
  37. 'tags' : playlist.tags
  38. } %}
  39. {% if playlist.elements|length %}
  40. <form action="{{ path_token('playlist_update_order', { 'playlist_id' : playlist.id }) }}" method="post">
  41. <ul class="playlist_elements {% if app.user%}{% if playlist.owned(app.user) %}owned{% endif %}{% endif %}">
  42. {% for element in playlist.elements %}
  43. <li class="playlist_element">
  44. <input type="hidden" name="elements[]" value="{{ element.id }}" />
  45. <div class="actions">
  46. {% if app.user%}
  47. {% if playlist.owned(app.user) %}
  48. <a class="drag" href="#">
  49. <img src="{{ asset('/img/drag3.png') }}" alt="drag" />
  50. </a>
  51. {% endif %}
  52. {% endif %}
  53. {% if element.type|can_autoplay_type %}
  54. <a class="autoplay_playlist"
  55. href="{{ path('playlist_datas_for_autoplay', { 'playlist_id' : playlist.id, 'offset' : loop.index0 }) }}"
  56. title="{{ 'playlist.start_here'|trans({}, 'elements') }}"
  57. >
  58. <img src="{{ asset('/img/1361037350_control_play.png') }}" alt="playlist" />
  59. </a>
  60. {% else %}
  61. <img class="autoplay_off" src="{{ asset('/img/1361037350_control_play_off.png') }}" alt="playlist" />
  62. {% endif %}
  63. {% if app.user%}
  64. {% if playlist.owned(app.user) %}
  65. <a
  66. class="remove_element"
  67. href="{{ path_token('playlist_remove_element', { 'playlist_id' : playlist.id, 'index' : loop.index0 }) }}"
  68. title="{{ 'playlist.remove_element'|trans({}, 'elements') }}"
  69. >
  70. <img src="{{ asset('/img/icon_close_2.png') }}" alt="delete" />
  71. </a>
  72. {% endif %}
  73. {% endif %}
  74. </div>
  75. <div class="actions_right">
  76. <a
  77. class="open_element"
  78. href="{{ path('element_get_one', { 'element_id' : element.id }) }}" data-id="{{ element.id }}"
  79. title="{{ 'playlist.open'|trans({}, 'elements') }}"
  80. >
  81. <img src="{{ asset('/img/icon_more_2.png') }}" alt="open" />
  82. </a>
  83. </div>
  84. <div class="title">
  85. {{ element.name }}
  86. </div>
  87. <div class="content_opened"></div>
  88. </li>
  89. {% endfor %}
  90. </ul>
  91. </form>
  92. {% endif %}
  93. </div>
  94. {% endblock %}