diff --git a/app/config.yaml b/app/config.yaml index 4bb2a95..f3c98dc 100644 --- a/app/config.yaml +++ b/app/config.yaml @@ -181,6 +181,7 @@ navigation: class: fa-solid fa-phone url: "tel:+491781798023" identifier: "+491781798023" + target: _top - name: Encrypted Email (PGP) description: Access my PGP key icon: diff --git a/app/static/js/modal.js b/app/static/js/modal.js index 196db37..624c90f 100644 --- a/app/static/js/modal.js +++ b/app/static/js/modal.js @@ -2,8 +2,13 @@ function openDynamicPopup(subitem) { // Schließe alle offenen Modals closeAllModals(); - // Setze den Titel - document.getElementById('dynamicModalLabel').innerText = subitem.name; + // Setze den Titel mit Icon, falls vorhanden + const modalTitle = document.getElementById('dynamicModalLabel'); + if (subitem.icon && subitem.icon.class) { + modalTitle.innerHTML = ` ${subitem.name}`; + } else { + modalTitle.innerText = subitem.name; + } // Setze den Identifier, falls vorhanden const identifierBox = document.getElementById('dynamicIdentifierBox'); @@ -16,6 +21,16 @@ function openDynamicPopup(subitem) { modalContent.value = ''; } + // Zeige die Beschreibung, falls keine URL vorhanden ist + const descriptionText = document.getElementById('dynamicDescriptionText'); + if (!subitem.url && subitem.description) { + descriptionText.classList.remove('d-none'); + descriptionText.innerText = subitem.description; + } else { + descriptionText.classList.add('d-none'); + descriptionText.innerText = ''; + } + // Konfiguriere die Warnbox const warningBox = document.getElementById('dynamicModalWarning'); if (subitem.warning) { @@ -47,9 +62,11 @@ function openDynamicPopup(subitem) { } // Konfiguriere die Alternativen + const alternativesSection = document.getElementById('dynamicAlternativesSection'); const alternativesList = document.getElementById('dynamicAlternativesList'); alternativesList.innerHTML = ''; // Clear existing alternatives if (subitem.alternatives && subitem.alternatives.length > 0) { + alternativesSection.classList.remove('d-none'); subitem.alternatives.forEach(alt => { const listItem = document.createElement('li'); listItem.classList.add('list-group-item', 'd-flex', 'justify-content-between', 'align-items-center'); @@ -62,10 +79,7 @@ function openDynamicPopup(subitem) { alternativesList.appendChild(listItem); }); } else { - const noAltItem = document.createElement('li'); - noAltItem.classList.add('list-group-item'); - noAltItem.innerText = 'No alternatives available.'; - alternativesList.appendChild(noAltItem); + alternativesSection.classList.add('d-none'); } // Kopierfunktion für den Identifier diff --git a/app/templates/moduls/modal.html.j2 b/app/templates/moduls/modal.html.j2 index adecdfe..27b0979 100644 --- a/app/templates/moduls/modal.html.j2 +++ b/app/templates/moduls/modal.html.j2 @@ -14,6 +14,8 @@