long_plays_in_progress.html 4.2 KB

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