videogame_detail.html 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  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 {float:left; width:412px; margin-right:10px; padding-bottom:15px;}
  9. .image-wrapper { contain: content; }
  10. .caption {
  11. position: fixed;
  12. top: 15px;
  13. left: 30px;
  14. padding: 5px;
  15. font-size: 110%;
  16. font-weight: bold;
  17. color:white;
  18. background:rgba(0,0,0,0.4);
  19. }
  20. .caption-footer {
  21. position: fixed;
  22. bottom: 30px;
  23. left: 30px;
  24. padding: 5px;
  25. font-size: 110%;
  26. font-weight: bold;
  27. color:white;
  28. background:rgba(0,0,0,0.4);
  29. }
  30. .summary {
  31. float: left;
  32. width: 600px;
  33. margin-left: 10px;
  34. }
  35. </style>
  36. {% endblock %}
  37. {% block lists %}
  38. <div class="row">
  39. {% if object.primary_image_url %}
  40. <div class="cover image-wrapper">
  41. {% if object.rating %}<div class="caption">{{object.rating}}</div>{% endif %}
  42. <img src="{{object.primary_image_url}}" />
  43. <div class="caption-footer">{{object.release_year}}</div>
  44. </div>
  45. {% endif %}
  46. <div class="summary">
  47. {% if object.summary %}
  48. <p>{{object.summary|safe|linebreaks|truncatewords:160}}</p>
  49. <hr />
  50. {% endif %}
  51. <p style="float:right;">
  52. <a href="{{object.igdb_link}}"><img src="{% static "images/igdb-logo.png" %}" width=35></a>
  53. <a href="{{object.hltb_link}}"><img style="background: black;" src="{% static "images/hltb.webp" %}" width=35></a>
  54. </p>
  55. </div>
  56. </div>
  57. <div class="row">
  58. <p>{{object.scrobble_set.count}} scrobbles</p>
  59. {% if object.scrobble_set.last.long_play_seconds %}
  60. <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>
  61. {% endif %}
  62. <p>
  63. {% if object.scrobble_set.last.long_play_complete == True %}
  64. <a href="">Play again</a>
  65. {% else %}
  66. <a href="{{object.start_url}}">Resume playing</a>
  67. {% endif %}
  68. </p>
  69. </div>
  70. <div class="row">
  71. <div class="col-md">
  72. <h3>Last scrobbles</h3>
  73. <div class="table-responsive">
  74. <table class="table table-striped table-sm">
  75. <thead>
  76. <tr>
  77. <th scope="col">Date</th>
  78. <th scope="col">Completed</th>
  79. <th scope="col">Duration</th>
  80. <th scope="col">Platforms</th>
  81. <th scope="col">State file</th>
  82. </tr>
  83. </thead>
  84. <tbody>
  85. {% for scrobble in object.scrobble_set.all|dictsortreversed:"timestamp" %}
  86. <tr>
  87. <td>{{scrobble.local-timestamp}}</td>
  88. <td>{% if scrobble.long_play_complete == True %}Yes{% else %}Not yet{% endif %}</td>
  89. <td>{% if scrobble.in_progress %}Now playing{% else %}{{scrobble.playback_position_seconds|natural_duration}}{% endif %}</td>
  90. <td>{% for platform in scrobble.video_game.platforms.all %}<a href="{{platform.get_absolute_url}}">{{platform}}</a>{% if not forloop.last %}, {% endif %}{% endfor %}</td>
  91. <td>{% if scrobble.videogame_save_data %}<a href="{{scrobble.videogame_save_data.url}}">Save data</a>{% else %}Not yet{% endif %}</td>
  92. <td>{% if scrobble.screenshot%}<img src="{{scrobble.screenshot.url}}" width=250 />{% endif %}</td>
  93. </tr>
  94. {% endfor %}
  95. </tbody>
  96. </table>
  97. </div>
  98. </div>
  99. </div>
  100. {% endblock %}