From cc04bbf0f5233b547b56b712c274377a45306bf0 Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Wed, 8 Jan 2025 18:06:08 +0100 Subject: [PATCH] Implemented header and footer menu --- app/static/css/default.css | 6 ++ app/static/js/dynamic-modal.js | 18 ++++++ app/templates/base.html | 23 ++++--- app/templates/modal.html.j2 | 20 ++++++ app/templates/navigation.html.j2 | 101 +++++++++--------------------- app/templates/pages/index.html.j2 | 14 ----- 6 files changed, 87 insertions(+), 95 deletions(-) create mode 100644 app/static/js/dynamic-modal.js create mode 100644 app/templates/modal.html.j2 diff --git a/app/static/css/default.css b/app/static/css/default.css index f67da11..6930d98 100644 --- a/app/static/css/default.css +++ b/app/static/css/default.css @@ -68,10 +68,16 @@ h3.footer-title{ .dropdown-submenu { position: relative; + list-style: none; } .dropdown-submenu > .dropdown-menu { top: 0; left: 100%; margin-top: -0.5rem; +} + +.navbar-nav { + padding: 0; + margin: 0; } \ No newline at end of file diff --git a/app/static/js/dynamic-modal.js b/app/static/js/dynamic-modal.js new file mode 100644 index 0000000..0294f71 --- /dev/null +++ b/app/static/js/dynamic-modal.js @@ -0,0 +1,18 @@ +function openDynamicPopup(subitem) { + // Set modal title and content + document.getElementById('dynamicModalLabel').innerText = subitem.description; + const modalContent = document.getElementById('dynamicModalContent'); + modalContent.value = subitem.address; + + // Add copy functionality + document.getElementById('dynamicCopyButton').addEventListener('click', function () { + modalContent.select(); + navigator.clipboard.writeText(modalContent.value) + .then(() => alert('Content copied to clipboard!')) + .catch(() => alert('Failed to copy content.')); + }); + + // Show the modal + const modal = new bootstrap.Modal(document.getElementById('dynamicModal')); + modal.show(); + } \ No newline at end of file diff --git a/app/templates/base.html b/app/templates/base.html index 389994b..cb94675 100644 --- a/app/templates/base.html +++ b/app/templates/base.html @@ -20,18 +20,23 @@ logo

{{company.titel}}

{{company.subtitel}}

- {% include "navigation.html.j2" %} - - + {% set menu = "top" %} + {% include "navigation.html.j2"%} {% block content %}{% endblock %} - -