base.html 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. {% load static tz admin_urls %}
  2. <!DOCTYPE html>
  3. <html lang="en">
  4. <head>
  5. <title>Archived Sites</title>
  6. <meta charset="utf-8" name="viewport" content="width=device-width, initial-scale=1">
  7. <link rel="stylesheet" href="{% static 'admin/css/base.css' %}">
  8. <link rel="stylesheet" href="{% static 'admin.css' %}">
  9. <link rel="stylesheet" href="{% static 'bootstrap.min.css' %}">
  10. <script src="{% static 'jquery.min.js' %}"></script>
  11. {% block extra_head %}
  12. {% endblock %}
  13. </head>
  14. <body>
  15. <div id="container">
  16. <div id="header">
  17. <div id="branding">
  18. <h1 id="site-name">
  19. <a href="{% url 'public-index' %}" class="header-archivebox">
  20. <img src="{% static 'archive.png' %}" alt="Logo" style="height: 30px"/>
  21. ArchiveBox
  22. </a>
  23. </h1>
  24. </div>
  25. {% include 'navigation.html' %}
  26. </div>
  27. <div id="content" class="flex">
  28. {% block body %}
  29. {% endblock %}
  30. </div>
  31. {% block footer %}
  32. <footer>
  33. <br />
  34. <center>
  35. <small>
  36. Archive created using <a href="https://github.com/ArchiveBox/ArchiveBox" title="Github">ArchiveBox</a>
  37. <a href="https://github.com/ArchiveBox/ArchiveBox/releases/tag/v{{VERSION}}" title="Releases">v{{VERSION}}</a>
  38. {% if COMMIT_HASH %}
  39. (<a href="https://github.com/ArchiveBox/ArchiveBox/commit/{{COMMIT_HASH}}"><code>{{COMMIT_HASH|truncatechars:9}}</code></a>)
  40. {% endif %}.
  41. <br/><br/>
  42. {{FOOTER_INFO}}
  43. </small>
  44. </center>
  45. <br />
  46. </footer>
  47. {% endblock %}
  48. </div>
  49. <script>
  50. // hide images that fail to load
  51. document.querySelector('body').addEventListener('error', function (e) {
  52. e.target.style.opacity = 0;
  53. }, true)
  54. // setup timezone
  55. {% get_current_timezone as TIME_ZONE %}
  56. window.TIME_ZONE = '{{TIME_ZONE}}'
  57. window.setCookie = function(name, value, days) {
  58. let expires = ""
  59. if (days) {
  60. const date = new Date()
  61. date.setTime(date.getTime() + (days*24*60*60*1000))
  62. expires = "; expires=" + date.toUTCString()
  63. }
  64. document.cookie = name + "=" + (value || "") + expires + "; path=/"
  65. }
  66. function setTimeOffset() {
  67. if (window.GMT_OFFSET) return
  68. window.GMT_OFFSET = -(new Date).getTimezoneOffset()
  69. window.setCookie('GMT_OFFSET', window.GMT_OFFSET, 365)
  70. }
  71. jQuery(document).ready(function () {
  72. setTimeOffset();
  73. });
  74. </script>
  75. </body>
  76. </html>