task_detail.html 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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. }
  16. .summary {
  17. float: left;
  18. width: 600px;
  19. margin-left: 10px;
  20. }
  21. .pagination a { padding: 0 5px 0 5px; }
  22. </style>
  23. {% endblock %}
  24. {% block lists %}
  25. <div class="row">
  26. <div class="summary">
  27. {% if object.description%}
  28. <p>{{object.description|safe|linebreaks|truncatewords:160}}</p>
  29. <hr />
  30. {% endif %}
  31. <p style="float:right;">
  32. <a href="{{object.source_link}}"><img src="{% static "images/org-mode-logo.png" %}" width=35></a>
  33. </p>
  34. </div>
  35. </div>
  36. <div class="row">
  37. <p>{{scrobbles.count}} scrobbles</p>
  38. <p>
  39. <a href="{{object.start_url}}">Play again</a>
  40. </p>
  41. </div>
  42. <div class="row">
  43. <div class="col-md">
  44. <h3>Last scrobbles</h3>
  45. <div class="table-responsive">
  46. <table class="table table-striped table-sm">
  47. <thead>
  48. <tr>
  49. <th scope="col">Date</th>
  50. <th scope="col">Title</th>
  51. <th scope="col">Notes</th>
  52. <th scope="col">Source</th>
  53. </tr>
  54. </thead>
  55. <tbody>
  56. {% for scrobble in scrobbles.all|dictsortreversed:"timestamp" %}
  57. <tr>
  58. <td><a href="{{scrobble.get_absolute_url}}">{{scrobble.local_timestamp}}</a></td>
  59. <td><a href="{{scrobble.get_media_source_url}}">{{scrobble.logdata.title}}</a></td>
  60. <td>{{scrobble.logdata.notes_as_str|safe}}</td>
  61. <td>{{scrobble.source}}</td>
  62. </tr>
  63. {% endfor %}
  64. </tbody>
  65. </table>
  66. </div>
  67. </div>
  68. {% if is_paginated %}
  69. <div class="pagination">
  70. {% if page_obj.has_previous %}
  71. <a href="?page={{ page_obj.previous_page_number }}">&laquo; Previous</a>
  72. {% endif %}
  73. {% for num in page_obj.paginator.page_range %}
  74. {% if num == page_obj.number %}
  75. <strong>{{ num }}</strong>
  76. {% else %}
  77. <a href="?page={{ num }}">{{ num }}</a>
  78. {% endif %}
  79. {% endfor %}
  80. {% if page_obj.has_next %}
  81. <a href="?page={{ page_obj.next_page_number }}">Next &raquo;</a>
  82. {% endif %}
  83. </div>
  84. {% endif %}
  85. </div>
  86. {% endblock %}