diff options
Diffstat (limited to 'templates/layouts')
| -rw-r--r-- | templates/layouts/mailbox.django | 12 | ||||
| -rw-r--r-- | templates/layouts/main.django | 55 |
2 files changed, 18 insertions, 49 deletions
diff --git a/templates/layouts/mailbox.django b/templates/layouts/mailbox.django index 32a7c8f..0cfaf5c 100644 --- a/templates/layouts/mailbox.django +++ b/templates/layouts/mailbox.django @@ -1,4 +1,6 @@ -{% extends 'layouts/main.django' %} {% block content %} +{% extends 'layouts/main.django' %} + +{% block content %} <div class="mailbox"> <aside class="sidebar"> {% include 'partials/sidebar.django' %} @@ -12,4 +14,12 @@ {% include 'partials/preview.django' %} </section> </div> + {% block extra_content %} + + {% endblock %} +{% endblock %} + +{% block scripts %} + {{ block.super }} + <script src="{% static 'js/search.js' %}"></script> {% endblock %} diff --git a/templates/layouts/main.django b/templates/layouts/main.django index 2ca45fd..af46e27 100644 --- a/templates/layouts/main.django +++ b/templates/layouts/main.django @@ -1,55 +1,14 @@ -{% extends 'layouts/generic.django' %} {% block body %} +{% extends 'layouts/generic.django' %} + +{% block body %} {% include 'partials/navbar.django' %} <main> {% block content %} {% endblock %} </main> -{% endblock %} {% block scripts %} - <script> - document.addEventListener('DOMContentLoaded', function () { - // Handle dropdown clicks - document.querySelectorAll('.options-subitem > a').forEach(function (item) { - item.addEventListener('click', function (e) { - e.preventDefault() - const parent = this.parentElement - - if (parent.classList.contains('disabled')) { - return - } - - document.querySelectorAll('.options-subitem.open').forEach(function (other) { - if (other !== parent) { - other.classList.remove('open') - } - }) - - parent.classList.toggle('open') - }) - }) - - document.addEventListener('click', function (e) { - if (!e.target.closest('.options-subitem')) { - document.querySelectorAll('.options-subitem.open').forEach(function (item) { - item.classList.remove('open') - }) - } - }) - - // Toggle search filters - const toggleBtn = document.getElementById('toggle-filters') - const filters = document.getElementById('search-filters') - - if (toggleBtn && filters) { - toggleBtn.addEventListener('click', function (e) { - e.preventDefault() - if (filters.style.display === 'none') { - filters.style.display = 'block' - } else { - filters.style.display = 'none' - } - }) - } - }) - </script> +{% endblock %} + +{% block scripts %} + <script src="{% static 'js/dropdown.js' %}"></script> {% endblock %} |
