user.html.twig 4.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. {% extends "MuzichHomeBundle::layout.html.twig" %}
  2. {% block title %}{{ 'playlist.user_title'|trans({'%user_username%' : viewed_user.username }, 'elements') }}{% endblock %}
  3. {% block mainbox_classes %}{% endblock %}
  4. {% block content %}
  5. <div class="top_tools">
  6. <div class="show_options">
  7. <a class="button darkbutton" href="{{ path('show_user', {'slug' : viewed_user.slug}) }}" >
  8. {{ 'user.view_profile'|trans({}, 'users') }}
  9. </a>
  10. </div>
  11. <h1>{{ 'playlist.user_title'|trans({'%user_username%' : viewed_user.username }, 'elements') }}</h1>
  12. {% if app.user %}
  13. {% if viewed_user.id == app.user.id %}
  14. <p>{{ 'playlist.how_add_element'|trans({}, 'elements') }}</p>
  15. {% endif %}
  16. {% endif %}
  17. {% if playlists|length %}
  18. <ul class="playlists">
  19. {% for playlist in playlists %}
  20. <li class="playlist">
  21. <div class="actions">
  22. <a
  23. class="autoplay_playlist"
  24. href="{{ path('playlist_datas_for_autoplay', { 'playlist_id' : playlist.id }) }}"
  25. title="{{ 'playlist.play'|trans({}, 'elements') }}"
  26. >
  27. <img src="{{ asset('/img/1361037350_control_play.png') }}" alt="playlist" />
  28. </a>
  29. {% if app.user %}
  30. {% if not playlist.owned(app.user) and viewed_user.id != app.user.id %}
  31. {% if not app.user.havePlaylistPicked(playlist) %}
  32. <a
  33. class="playlist_pick_noajax"
  34. href="{{ path_token('playlist_pick', {
  35. 'playlist_id' : playlist.id,
  36. 'redirect_owner' : true
  37. }) }}"
  38. title="{{ 'playlist.pick'|trans({}, 'elements') }}"
  39. >
  40. <img src="{{ asset('/img/tick_untick.png') }}" alt="playlist" />
  41. </a>
  42. {% else %}
  43. <a
  44. class="playlist_unpick_noajax"
  45. href="{{ path_token('playlist_unpick', {
  46. 'playlist_id' : playlist.id,
  47. 'redirect_owner' : true
  48. }) }}"
  49. title="{{ 'playlist.unpick'|trans({}, 'elements') }}"
  50. >
  51. <img src="{{ asset('/img/tick_ticked.png') }}" alt="playlist" />
  52. </a>
  53. {% endif %}
  54. {% endif %}
  55. {% endif %}
  56. {% if app.user %}
  57. {% if viewed_user.id == app.user.id %}
  58. {% if playlist.owned(app.user) %}
  59. <a
  60. class="playlist_delete"
  61. href="{{ path_token('playlist_delete', { 'playlist_id' : playlist.id }) }}"
  62. title="{{ 'playlist.delete'|trans({}, 'elements') }}"
  63. >
  64. <img src="{{ asset('/img/icon_close_2.png') }}" alt="delete" />
  65. </a>
  66. {% else %}
  67. <a
  68. class="playlist_unpick"
  69. href="{{ path_token('playlist_unpick', { 'playlist_id' : playlist.id }) }}"
  70. title="{{ 'playlist.unpick'|trans({}, 'elements') }}"
  71. >
  72. <img src="{{ asset('/img/icon_close_2.png') }}" alt="delete" />
  73. </a>
  74. {% endif %}
  75. {% endif %}
  76. {% endif %}
  77. </div>
  78. <div class="title">
  79. <a
  80. class="title"
  81. href="{{ path('playlist', { 'user_slug' : playlist.owner.slug, 'playlist_id' : playlist.id }) }}"
  82. title="{{ 'playlist.openplaylist'|trans({}, 'elements') }}"
  83. >
  84. {{ playlist.name }}
  85. </a>
  86. {% if app.user|userId == playlist.owner.id %}
  87. {{ 'playlist.public_word'|trans({}, 'elements') }}
  88. {% endif %}
  89. </div>
  90. {% include "MuzichCoreBundle:Tag:tag_cloud.html.twig" with {
  91. 'tags' : playlist.tags
  92. } %}
  93. </li>
  94. {% endfor %}
  95. </ul>
  96. {% endif %}
  97. </div>
  98. {% endblock %}