long_plays_in_progress.html 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. {% extends "base_list.html" %}
  2. {% load thumbnail %}
  3. {% block title %}Long Plays{% endblock %}
  4. {% block head_extra %}
  5. <style>
  6. dl { width: 210px; float:left; margin-right: 10px; }
  7. dt a { color:white; text-decoration: none; font-size:smaller; }
  8. img { height:200px; width: 200px; object-fit: cover; }
  9. dd .right { float:right; }
  10. </style>
  11. {% endblock %}
  12. {% block lists %}
  13. <div class="row">
  14. {% if view == 'grid' %}
  15. {% for period, medias in in_progress.items %}
  16. {% if medias %}
  17. <h2>{% if period == "active" %}Recently played{% else %}More than a week ago{% endif %}</h2>
  18. <div class="col-md">
  19. {% for media in medias %}
  20. <dl>
  21. <dt><a href="{{media.get_absolute_url}}">{{media.title}}</a></dt>
  22. {% if media.hltb_cover %}
  23. {% thumbnail media.hltb_cover "200" as im %}
  24. <dd><a href="{{media.get_absolute_url}}"><img src="{{im.url}}" width={{im.width}} height={{im.height}} /></a></dd>
  25. {% endthumbnail %}
  26. {% else %}
  27. {% thumbnail media.cover "200" as im %}
  28. <dd><a href="{{media.get_absolute_url}}"><img src="{{im.url}}" width={{im.width}} height={{im.height}} /></a></dd>
  29. {% endthumbnail %}
  30. {% endif %}
  31. <dd>
  32. {% if media.is_long_play_in_progress %}Playing{% else %}<a type="button" class="btn btn-sm btn-primary" href="{{media.get_start_url}}">Resume</a>{% endif %}
  33. <a type="button" class="right btn btn-sm " href="{{media.get_longplay_finish_url}}">Finish</a>
  34. </dd>
  35. </dl>
  36. {% endfor %}
  37. </div>
  38. {% endif %}
  39. {% endfor %}
  40. {% else %}
  41. <div class="col-md">
  42. <div class="table-responsive">
  43. <table class="table table-striped table-sm">
  44. <thead>
  45. <tr>
  46. <th scope="col">Scrobbles</th>
  47. <th scope="col">Title</th>
  48. <th scope="col"></th>
  49. <th scope="col">Resume</th>
  50. <th scope="col">Finish</th>
  51. </tr>
  52. </thead>
  53. <tbody>
  54. {% for media in in_progress %}
  55. <tr>
  56. <td>{{media.scrobble_set.count}}</td>
  57. <td><a href="{{media.get_absolute_url}}">{{media}}</a></td>
  58. <td>{% if media.author %}{{media.author}}{% else %}{{media.platforms.first}}{% endif %}</td>
  59. <td><a type="button" class="btn btn-sm btn-primary" href="{{media.get_start_url}}">Resume</a></td>
  60. <td><a type="button" class="right btn btn-sm " href="{{media.get_longplay_finish_url}}">Finish</a></td>
  61. </tr>
  62. {% endfor %}
  63. </tbody>
  64. </table>
  65. </div>
  66. </div>
  67. {% endif %}
  68. <hr/>
  69. <h2>Completed</h2>
  70. {% if view == 'grid' %}
  71. <div>
  72. {% for media in completed %}
  73. {% if media.hltb_cover %}
  74. <dl>
  75. {% thumbnail media.hltb_cover "200" as im %}
  76. <dd><a href="{{media.get_absolute_url}}"><img src="{{im.url}}" width={{im.width}} height={{im.height}} /></a></dd>
  77. {% endthumbnail %}
  78. <dt><a href="{{media.get_absolute_url}}">{{media.title}}</a></dt>
  79. </dl>
  80. {% elif media.cover %}
  81. <dl>
  82. {% thumbnail media.cover "200" as im %}
  83. <dd><a href="{{media.get_absolute_url}}"><img src="{{url}}" width={{im.width}} height={{im.height}} /></a></dd>
  84. {% endthumbnail %}
  85. <dt><a href="{{media.get_absolute_url}}">{{media.title}}</a></dt>
  86. </dl>
  87. {% endif %}
  88. {% endfor %}
  89. </div>
  90. {% else %}
  91. <div class="col-md">
  92. <div class="table-responsive">
  93. <table class="table table-striped table-sm">
  94. <thead>
  95. <tr>
  96. <th scope="col">Scrobbles</th>
  97. <th scope="col">Title</th>
  98. <th scope="col"></th>
  99. </tr>
  100. </thead>
  101. <tbody>
  102. {% for media in completed %}
  103. <tr>
  104. <td>{{media.scrobble_set.count}}</td>
  105. <td><a href="{{media.get_absolute_url}}">{{media}}</a></td>
  106. <td>{% if media.author %}{{media.author}}{% else %}{{media.platforms.first}}{% endif %}</td>
  107. </tr>
  108. {% endfor %}
  109. </tbody>
  110. </table>
  111. </div>
  112. </div>
  113. {% endif %}
  114. </div>
  115. {% endblock %}