videogame_detail.html 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. {% extends "base_list.html" %}
  2. {% load mathfilters %}
  3. {% load static %}
  4. {% load naturalduration %}
  5. {% block title %}{{object.title}}{% endblock %}
  6. {% block head_extra %}
  7. <style>
  8. .cover img {
  9. width: 250px;
  10. }
  11. .cover {
  12. float: left;
  13. width: 252px;
  14. padding: 0;
  15. border: 1px solid #ccc;
  16. }
  17. .summary {
  18. float: left;
  19. width: 600px;
  20. margin-left: 10px;
  21. }
  22. </style>
  23. {% endblock %}
  24. {% block lists %}
  25. <div class="row">
  26. {% if object.hltb_cover%}
  27. <div class="cover"><img src="{{object.hltb_cover.url}}" /></div>
  28. {% endif %}
  29. <div class="summary">
  30. {% if object.summary %}
  31. <p>{{object.summary|safe|linebreaks|truncatewords:160}}</p>
  32. <hr />
  33. {% endif %}
  34. <p style="float:right;">
  35. <a href="{{object.igdb_link}}"><img src="{% static "images/igdb-logo.png" %}" width=35></a>
  36. <a href="{{object.hltb_link}}"><img style="background: black;" src="{% static "images/hltb.webp" %}" width=35></a>
  37. </p>
  38. </div>
  39. </div>
  40. <div class="row">
  41. <p>{{object.scrobble_set.count}} scrobbles</p>
  42. {% if object.scrobble_set.last.long_play_seconds %}
  43. <p>{{object.scrobble_set.last.long_play_seconds|natural_duration}}{% if object.scrobble_set.last.long_play_complete %} and completed{% else %} spent playing{% endif %}</p>
  44. {% endif %}
  45. <p>
  46. {% if object.scrobble_set.last.long_play_complete == True %}
  47. <a href="">Play again</a>
  48. {% else %}
  49. <a href="{{object.get_start_url}}">Resume playing</a>
  50. {% endif %}
  51. </p>
  52. </div>
  53. <div class="row">
  54. <div class="col-md">
  55. <h3>Last scrobbles</h3>
  56. <div class="table-responsive">
  57. <table class="table table-striped table-sm">
  58. <thead>
  59. <tr>
  60. <th scope="col">Date</th>
  61. <th scope="col">Completed</th>
  62. <th scope="col">Duration</th>
  63. <th scope="col">Platforms</th>
  64. </tr>
  65. </thead>
  66. <tbody>
  67. {% for scrobble in object.scrobble_set.all|dictsortreversed:"timestamp" %}
  68. <tr>
  69. <td>{{scrobble.timestamp}}</td>
  70. <td>{% if scrobble.long_play_complete == True %}Yes{% endif %}</td>
  71. <td>{% if scrobble.in_progress %}Now playing{% else %}{{scrobble.playback_position_seconds|natural_duration}}{% endif %}</td>
  72. <td>{% for platform in scrobble.video_game.platforms.all %}<a href="{{platform.get_absolute_url}}">{{platform}}</a>{% if not forloop.last %}, {% endif %}{% endfor %}</td>
  73. </tr>
  74. {% endfor %}
  75. </tbody>
  76. </table>
  77. </div>
  78. </div>
  79. </div>
  80. {% endblock %}