album_detail.html 3.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. {% extends "base_list.html" %}
  2. {% load mathfilters %}
  3. {% load static %}
  4. {% block title %}{{object.name}}{% endblock %}
  5. {% block lists %}
  6. <div class="row">
  7. {% if object.cover_image %}
  8. <p style="float:left; width:302px; padding:0;">
  9. <img src="{{object.cover_image.url}}" width=300 height=300 />
  10. </p>
  11. {% endif %}
  12. <div style="float:left; width:600px; margin-left:10px; ">
  13. {% if object.theaudiodb_description %}
  14. <p>{{object.theaudiodb_description|safe|linebreaks|truncatewords:160}}</p>
  15. {% endif %}
  16. {% if object.allmusic_review%}
  17. <p>{{object.allmusic_review|safe|linebreaks|truncatewords:160}}</p>
  18. {% endif %}
  19. <hr/>
  20. <p style="float:right;">
  21. <a href="{{album.mb_link}}"><img src="{% static "images/musicbrainz-logo.png" %}" width=35></a>
  22. <a href="{{album.rym_link}}"><img src="{% static "images/rateyourmusic-logo.jpg" %}" width=35></a>
  23. {% if album.bandcamp_link %}<a href="{{album.bandcamp_link}}"><img src="{% static "images/bandcamp-logo.png" %}" width=35></a>{% endif %}
  24. {% if album.tadb_link %}<a href="{{album.tadb_link}}"><img src="{% static "images/theaudiodb-logo.png" %}" width=35></a>{% endif %}
  25. {% if album.allmusic_link %}<a href="{{album.allmusic_link}}"><img src="{% static "images/allmusic-logo.png" %}" width=35></a>{% endif %}
  26. </p>
  27. </div>
  28. </div>
  29. <div class="row">
  30. <p>{{object.scrobbles.count}} scrobbles</p>
  31. {% if charts %}
  32. <p>{% for chart in charts %}<em><a href="{{chart.link}}">{{chart}}</a></em>{% if forloop.last %}{% else %} | {% endif %}{% endfor %}</p>
  33. {% endif %}
  34. <div class="col-md">
  35. <h3>Top tracks</h3>
  36. <div class="table-responsive">
  37. <table class="table table-striped table-sm">
  38. <thead>
  39. <tr>
  40. <th scope="col">Rank</th>
  41. <th scope="col">Track</th>
  42. <th scope="col">Artist</th>
  43. <th scope="col">Count</th>
  44. <th scope="col"></th>
  45. </tr>
  46. </thead>
  47. <tbody>
  48. {% for track in object.tracks %}
  49. <tr>
  50. <td>{{rank}}#1</td>
  51. <td><a href="{{track.get_absolute_url}}">{{track.title}}</a></td>
  52. <td><a href="{{track.artist.get_absolute_url}}">{{track.artist}}</a></td>
  53. <td>{{track.scrobble_count}}</td>
  54. <td>
  55. <div class="progress-bar" style="margin-right:5px;">
  56. <span class="progress-bar-fill" style="width: {{track.scrobble_count|mul:10}}%;"></span>
  57. </div>
  58. </td>
  59. </tr>
  60. {% endfor %}
  61. </tbody>
  62. </table>
  63. </div>
  64. </div>
  65. </div>
  66. <div class="row">
  67. <div class="col-md">
  68. <h3>Last scrobbles</h3>
  69. <div class="table-responsive">
  70. <table class="table table-striped table-sm">
  71. <thead>
  72. <tr>
  73. <th scope="col">Date</th>
  74. <th scope="col">Track</th>
  75. <th scope="col">Artist</th>
  76. </tr>
  77. </thead>
  78. <tbody>
  79. {% for scrobble in object.scrobbles %}
  80. <tr>
  81. <td>{{scrobble.timestamp}}</td>
  82. <td><a href="{{scrobble.track.get_absolute_url}}">{{scrobble.track.title}}</a></td>
  83. <td><a href="{{scrobble.track.artist.get_absolute_url}}">{{scrobble.track.artist.name}}</a></td>
  84. </tr>
  85. {% endfor %}
  86. </tbody>
  87. </table>
  88. </div>
  89. </div>
  90. </div>
  91. {% endblock %}