showUser.html.twig 3.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. {% extends "MuzichHomeBundle::layout.html.twig" %}
  2. {% block title %}{{ viewed_user.name }}{% endblock %}
  3. {% block mainbox_classes %}mainbox_nopadding{% endblock %}
  4. {% block content %}
  5. <div class="top_tools">
  6. <div class="show_options">
  7. {% if app.user %}
  8. {% if app.user.id != viewed_user.id %}
  9. <a href="{{ path('follow', { 'type': 'user', 'id': viewed_user.id, 'token': user.personalHash(viewed_user.id) }) }}"
  10. class="follow_link button darkbutton {% if following %}following{% else %}notfollowing{% endif %}" >
  11. {% if following %}
  12. {{ 'user.following'|trans({}, 'users') }}
  13. {% else %}
  14. {{ 'user.follow'|trans({}, 'users') }}
  15. {% endif %}
  16. </a>
  17. {% endif %}
  18. {% endif %}
  19. <a class="button darkbutton" href="{{ path('favorite_user_list', {'slug' : viewed_user.slug}) }}" >
  20. {{ 'user.view_favorites'|trans({}, 'users') }}
  21. </a>
  22. <a class="button darkbutton" href="{{ path('playlists_user', {'user_slug' : viewed_user.slug}) }}" >
  23. {{ 'user.view_playlists'|trans({}, 'users') }}
  24. </a>
  25. </div>
  26. <h1>{{ 'user.show.title'|trans({'%name%' : viewed_user.name}, 'users') }}</h1>
  27. {% if app.user %}
  28. {% if app.user.id == viewed_user.id %}
  29. {% include 'MuzichCoreBundle:Component:element_add_box.html.twig' %}
  30. {% endif %}
  31. {% endif %}
  32. <div class="reputation">
  33. {% if viewed_user.avatar_path %}
  34. <img alt="avatar" src="{{ image(viewed_user.avatarWebPath).resize(48,50,'#000000') }}" />
  35. {% else %}
  36. <img alt="default_avatar" src="{{ asset('/img/1360770994_user_48_50.png') }}" />
  37. {% endif %}
  38. {{ 'user.reputation.name'|trans({}, 'users') }}:
  39. <span class="score">{{ viewed_user.reputation|format_score }}</span>
  40. {{ 'user.reputation.txt'|trans({}, 'users') }}
  41. </div>
  42. <p class="show_info">
  43. {% if count_owned != 0 %}
  44. {{ 'show.user.elements.count'|trans({
  45. '%count_owned%' : count_owned,
  46. '%count_favorited%': count_favorited,
  47. '%count_favorited_users%': count_favorited_users
  48. }, 'elements') }}
  49. {% else %}
  50. {{ 'show.user.elements.no_count'|trans({}, 'elements') }}
  51. {% endif %}
  52. <br />
  53. {% if count_followers > 1 %}
  54. {{ 'show.user.followers.x_count'|trans({'%count%':count_followers, '%name%':viewed_user.name }, 'elements') }}
  55. {% elseif count_followers == 0 %}
  56. {{ 'show.user.followers.zero_count'|trans({'%name%':viewed_user.name }, 'elements') }}
  57. {% else %}
  58. {{ 'show.user.followers.one_count'|trans({'%count%':count_followers, '%name%':viewed_user.name }, 'elements') }}
  59. {% endif %}
  60. </p>
  61. {% include "MuzichCoreBundle:Tag:tagsList.show.html.twig" with {
  62. 'object_id' : viewed_user.id,
  63. 'object_type' : 'user'
  64. } %}
  65. </div>
  66. {% include "MuzichCoreBundle:SearchElement:default.html.twig" with {
  67. 'display_autoplay' : true,
  68. 'autoplay_shuffle' : 'elements_get_filter_data_autoplay_show',
  69. 'autoplay_shuffle_show_type': 'user',
  70. 'autoplay_context' : 'show_user'
  71. } %}
  72. {% if more_count is defined %}
  73. {% if elements|length %}
  74. {% include "MuzichCoreBundle:SearchElement:more_button.html.twig" with {
  75. 'more_path' : path('show_elements_get', {
  76. 'type' : 'user',
  77. 'object_id' : viewed_user.id,
  78. 'tags_ids_json' : '[]'
  79. }),
  80. 'more_url_path' : path('show_elements_get', {
  81. 'type' : 'user',
  82. 'object_id' : viewed_user.id,
  83. 'tags_ids_json' : ''
  84. })
  85. }%}
  86. {% endif %}
  87. {% endif %}
  88. {% endblock %}