user.html.twig 3.9KB

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