summaryrefslogtreecommitdiff
path: root/templates/layouts/main.django
diff options
context:
space:
mode:
Diffstat (limited to 'templates/layouts/main.django')
-rw-r--r--templates/layouts/main.django55
1 files changed, 7 insertions, 48 deletions
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 %}