book_detail.html 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. {% extends "base_list.html" %}
  2. {% load mathfilters %}
  3. {% load static %}
  4. {% load naturalduration %}
  5. {% block title %}{{object.title}}{% endblock %}
  6. {% block lists %}
  7. <div class="row">
  8. {% if object.cover%}
  9. <p style="float:left; width:402px; padding:0; border: 1px solid #ccc">
  10. <img src="{{object.cover.url}}" width=400 />
  11. </p>
  12. {% endif %}
  13. <div style="float:left; width:600px; margin-left:10px; ">
  14. {% if object.summary %}
  15. <p>{{object.summary|safe|linebreaks|truncatewords:160}}</p>
  16. <hr />
  17. {% endif %}
  18. <p style="float:right;">
  19. <a href="{{object.openlibrary_link}}"><img src="{% static " images/openlibrary-logo.png" %}" width=35></a>
  20. <a href="{{object.amazon_link}}"><img src="{% static " images/amazon-logo.png" %}" width=35></a>
  21. </p>
  22. </div>
  23. </div>
  24. <div class="row">
  25. {% if object.readcomics_url %}
  26. <p><a href="{{object.readcomics_url}}">Read again</a></p>
  27. {% endif %}
  28. {% if object.next_readcomics_url %}
  29. <p><a href="{{object.next_readcomics_url}}">Read next issue</a></p>
  30. {% endif %}
  31. <p>{{scrobbles.count}} scrobbles</p>
  32. {% for s in scrobbles %}
  33. {% if forloop.first %}
  34. <p><a href="{{s.logdata.resume_url}}">Resume reading</a></p>
  35. {% endif %}
  36. {% endfor %}
  37. </div>
  38. <div class="row">
  39. <div class="col-md">
  40. <h3>Last scrobbles</h3>
  41. <div class="table-responsive">
  42. <table class="table table-striped table-sm">
  43. <thead>
  44. <tr>
  45. <th scope="col">Date</th>
  46. <th scope="col">Completed</th>
  47. <th scope="col">Pages read</th>
  48. <th scope="col">Authors</th>
  49. </tr>
  50. </thead>
  51. <tbody>
  52. {% for scrobble in scrobbles.all|dictsortreversed:"timestamp" %}
  53. <tr>
  54. <td><a href="{{scrobble.get_absolute_url}}">{{scrobble.local_timestamp}}</a></td>
  55. <td>{% if scrobble.logdata.long_play_complete == True %}Yes{% endif %}</td>
  56. <td>{% if scrobble.in_progress %}Now reading{% else %}{{scrobble.session_pages_read}}{% endif %}</td>
  57. <td>{% for author in scrobble.book.authors.all %}<a href="{{author.get_absolute_url}}">{{author}}</a>{% if not forloop.last %}, {% endif %}{% endfor %}</td>
  58. </tr>
  59. {% endfor %}
  60. </tbody>
  61. </table>
  62. </div>
  63. </div>
  64. </div>
  65. {% endblock %}