show.html.twig 4.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  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>{{ playlist.name }}</h1>
  28. {% include "MuzichCoreBundle:Tag:tag_cloud.html.twig" with {
  29. 'tags' : playlist.tags
  30. } %}
  31. {% if playlist.elements|length %}
  32. <form action="{{ path_token('playlist_update_order', { 'playlist_id' : playlist.id }) }}" method="post">
  33. <ul class="playlist_elements {% if app.user%}{% if playlist.owned(app.user) %}owned{% endif %}{% endif %}">
  34. {% for element in playlist.elements %}
  35. <li class="playlist_element">
  36. <input type="hidden" name="elements[]" value="{{ element.id }}" />
  37. <div class="actions">
  38. {% if app.user%}
  39. {% if playlist.owned(app.user) %}
  40. <a class="drag" href="#">
  41. <img src="{{ asset('/img/drag3.png') }}" alt="drag" />
  42. </a>
  43. {% endif %}
  44. {% endif %}
  45. {% if element.type|can_autoplay_type %}
  46. <a class="autoplay_playlist"
  47. href="{{ path('playlist_datas_for_autoplay', { 'playlist_id' : playlist.id, 'offset' : loop.index0 }) }}"
  48. title="{{ 'playlist.start_here'|trans({}, 'elements') }}"
  49. >
  50. <img src="{{ asset('/img/1361037350_control_play.png') }}" alt="playlist" />
  51. </a>
  52. {% else %}
  53. <img class="autoplay_off" src="{{ asset('/img/1361037350_control_play_off.png') }}" alt="playlist" />
  54. {% endif %}
  55. {% if app.user%}
  56. {% if playlist.owned(app.user) %}
  57. <a
  58. class="remove_element"
  59. href="{{ path_token('playlist_remove_element', { 'playlist_id' : playlist.id, 'index' : loop.index0 }) }}"
  60. title="{{ 'playlist.remove_element'|trans({}, 'elements') }}"
  61. >
  62. <img src="{{ asset('/img/icon_close_2.png') }}" alt="delete" />
  63. </a>
  64. {% endif %}
  65. {% endif %}
  66. </div>
  67. <div class="actions_right">
  68. <a
  69. class="open_element"
  70. href="{{ path('element_get_one', { 'element_id' : element.id }) }}" data-id="{{ element.id }}"
  71. title="{{ 'playlist.open'|trans({}, 'elements') }}"
  72. >
  73. <img src="{{ asset('/img/icon_more_2.png') }}" alt="open" />
  74. </a>
  75. </div>
  76. <div class="title">
  77. {{ element.name }}
  78. </div>
  79. <div class="content_opened"></div>
  80. </li>
  81. {% endfor %}
  82. </ul>
  83. </form>
  84. {% endif %}
  85. </div>
  86. {% endblock %}