videogame_detail.html 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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>{{scrobbles.count}} scrobbles</p>
  59. <p>
  60. <a href="">Play again</a>
  61. </p>
  62. </div>
  63. <div class="row">
  64. <div class="col-md">
  65. <h3>Last scrobbles</h3>
  66. <div class="table-responsive">
  67. <table class="table table-striped table-sm">
  68. <thead>
  69. <tr>
  70. <th scope="col">Date</th>
  71. <th scope="col">Completed</th>
  72. <th scope="col">Duration</th>
  73. <th scope="col">Platforms</th>
  74. <th scope="col">State file</th>
  75. </tr>
  76. </thead>
  77. <tbody>
  78. {% for scrobble in scrobbles.all|dictsortreversed:"timestamp" %}
  79. <tr>
  80. <td>{{scrobble.local_timestamp}}</td>
  81. <td>{% if scrobble.long_play_complete == True %}Yes{% else %}Not yet{% endif %}</td>
  82. <td>{% if scrobble.in_progress %}Now playing{% else %}{{scrobble.playback_position_seconds|natural_duration}}{% endif %}</td>
  83. <td>{% for platform in scrobble.video_game.platforms.all %}<a href="{{platform.get_absolute_url}}">{{platform}}</a>{% if not forloop.last %}, {% endif %}{% endfor %}</td>
  84. <td>{% if scrobble.videogame_save_data %}<a href="{{scrobble.videogame_save_data.url}}">Save data</a>{% else %}Not yet{% endif %}</td>
  85. <td>{% if scrobble.screenshot%}<img src="{{scrobble.screenshot.url}}" width=250 />{% endif %}</td>
  86. </tr>
  87. {% endfor %}
  88. </tbody>
  89. </table>
  90. </div>
  91. </div>
  92. </div>
  93. {% endblock %}