Django Library Themes
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

base.html 3.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. {% load static %}
  2. {% load i18n %}
  3. <!DOCTYPE html>
  4. <html>
  5. <head>
  6. <title>{{ title }}</title>
  7. <meta charset="utf-8" />
  8. <meta name="viewport" content="width=device-width, initial-scale=1">
  9. <link rel="shortcut icon" href="{% static 'bars/'|add:settings.page_theme|add:'/favicon.ico' %}" />
  10. {% block head_extensions %}{% endblock %}
  11. <style>
  12. {% include 'themes/'|add:settings.page_theme|add:'/base.css' %}
  13. </style>
  14. </head>
  15. <body lang="en" dir="ltr">
  16. {% block modal %}{% endblock %}
  17. <form class="titlebar container" action="{% url "search" %}">
  18. <a class="page-logo" href="/"><img src="{{ settings.page_image.url }}" alt="Logo" title="{{ title }}"></a>
  19. <span class="title_hide">{{ title }}</span>
  20. <input type="text" placeholder="{% trans "Search..." %}" name="q">
  21. </form>
  22. {% with bar=menubar %}{% include 'themes/'|add:settings.page_theme|add:'/menubar.html' %}{% endwith %}
  23. {% include 'themes/'|add:settings.page_theme|add:'/navigationbar.html' %}
  24. {% with bar=actionbar abar=True %}{% include 'themes/'|add:settings.page_theme|add:'/menubar.html' %}{% endwith %}
  25. <div class="content">
  26. {% if messages %}
  27. <div id="flash">
  28. {% for message in messages %}
  29. {% if message.tags == "success" %}
  30. <p class="flash flash-hint">{{ message|safe }}</p>
  31. {% else %}
  32. {% if message.tags == "info" %}
  33. <p class="flash flash-info">{{ message|safe }}</p>
  34. {% else %}
  35. <p class="flash flash-error">{{ message|safe }}</p>
  36. {% endif %}
  37. {% endif %}
  38. {% endfor %}
  39. </div>
  40. {% endif %}
  41. <div class="app-content">
  42. {% block content %}{% endblock %}
  43. </div>
  44. <div class="bottomspace"></div>
  45. {% with bar=bottombar bottom=True %}{% include 'themes/'|add:settings.page_theme|add:'/menubar.html' %}{% endwith %}
  46. </div>
  47. {% if messages %}
  48. <div class="hidden fixed" id="fixed" onclick="myHideFunction()">
  49. <div id="flash container">
  50. {% for message in messages %}
  51. {% if message.tags == "success" %}
  52. <p class="flash flash-hint">{{ message|safe }}</p>
  53. {% else %}
  54. {% if message.tags == "info" %}
  55. <p class="flash flash-info">{{ message|safe }}</p>
  56. {% else %}
  57. <p class="flash flash-error">{{ message|safe }}</p>
  58. {% endif %}
  59. {% endif %}
  60. {% endfor %}
  61. </div>
  62. <div class="close-flash">X</div>
  63. </div>
  64. {% endif %}
  65. <script>
  66. /*
  67. * Sticky Elements
  68. */
  69. window.onscroll = function() {myScrollFunction()};
  70. // Sticky Actionbar
  71. var header = document.getElementById("actionbar");
  72. var sticky = header.offsetTop; // Get the offset position of the actionbar
  73. // Flash
  74. var flash = document.getElementById("flash");
  75. var fixed_ = document.getElementById("fixed");
  76. var flash_pos = flash.offsetTop;
  77. var enabled = true;
  78. function myScrollFunction() {
  79. // Sticky Actionbar
  80. if (window.pageYOffset > sticky) {
  81. header.classList.add("sticky");
  82. } else {
  83. header.classList.remove("sticky");
  84. }
  85. // Flash
  86. if (window.pageYOffset >= flash_pos && enabled){
  87. fixed_.classList.remove("hidden");
  88. } else {
  89. fixed_.classList.add("hidden");
  90. enabled = false;
  91. }
  92. }
  93. function myHideFunction() {
  94. fixed.classList.add("hidden");
  95. enabled = false;
  96. }
  97. </script>
  98. </body>
  99. </html>