webpage_detail.html 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. {% extends "base_list.html" %}
  2. {% load static %}
  3. {% block title %}{{object.title}}{% endblock %}
  4. {% block head_extra %}
  5. <style>
  6. .webpage-metadata {border: 1px solid #aaa; border-top:none; border-right:none; line-height:0.65em;padding-top:10px;}
  7. .webpage-body {width:40em; text-align:justify; padding-top:20px; font-family:serif; font-size:1.25em; line-height:1.6em; border-right: 1px #ccc solid; padding-right: 2em;}
  8. .webpage-body br { margin-bottom: 1em; }
  9. </style>
  10. <link href="{% static 'css/recogito.min.css' %}" rel="stylesheet">
  11. {% endblock %}
  12. {% block extra_js %}
  13. <script src="{% static 'js/recogito.min.js' %}"></script>
  14. <script type="text/javascript">
  15. (function() {
  16. var r = Recogito.init({
  17. content: document.getElementById('article') // ID or DOM element
  18. });
  19. // Add an event handler
  20. r.on('createAnnotation', function(annotation) { /** **/ });
  21. })();
  22. </script>
  23. {% endblock %}
  24. {% block lists %}
  25. <div class="row webpage">
  26. <div class="webpage-metadata">
  27. <p>Source: <a href="{{object.url}}">{{object.domain}}</a></p>
  28. {% if object.date %}<p>Published: <em>{{object.date}}</em></p>{% endif %}
  29. <p>Time to read: {{object.estimated_time_to_read_in_minutes}} minutes</p>
  30. </div>
  31. {% if object.extract %}
  32. <div class="webpage-body" id="article">
  33. {{object.extract|linebreaks}}
  34. </div>
  35. {% endif %}
  36. <hr/>
  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. </tr>
  47. </thead>
  48. <tbody>
  49. {% for scrobble in scrobbles.all %}
  50. <tr>
  51. <td>{{scrobble.local_timestamp}}</td>
  52. </tr>
  53. {% endfor %}
  54. </tbody>
  55. </table>
  56. </div>
  57. </div>
  58. </div>
  59. {% endblock %}