diff --git a/app/config.yaml b/app/config.yaml index 951ccdf..4bb2a95 100644 --- a/app/config.yaml +++ b/app/config.yaml @@ -193,7 +193,7 @@ navigation: identifier: "+491781798023" warning: Signal is not hosted by me! alternatives: - link: navigation.header.contact.matrix + - link: navigation.header.contact.matrix - name: Telegram description: Message me on Telegram icon: @@ -203,7 +203,7 @@ navigation: identifier: kevinveenbirkenbach warning: Telegram is not hosted by me! alternatives: - link: navigation.header.contact.matrix + - link: navigation.header.contact.matrix - name: WhatsApp description: Chat with me on WhatsApp icon: @@ -212,7 +212,7 @@ navigation: identifier: "+491781798023" warning: Whatsapp is not hosted by me! alternatives: - link: navigation.header.contact.matrix + - link: navigation.header.contact.matrix footer: - name: External Accounts description: Me on other plattforms diff --git a/app/static/js/modal.js b/app/static/js/modal.js index ce88898..f06702f 100644 --- a/app/static/js/modal.js +++ b/app/static/js/modal.js @@ -3,10 +3,13 @@ function openDynamicPopup(subitem) { document.getElementById('dynamicModalLabel').innerText = subitem.description; // Setze den Identifier, falls vorhanden + const identifierBox = document.getElementById('dynamicIdentifierBox'); const modalContent = document.getElementById('dynamicModalContent'); if (subitem.identifier) { + identifierBox.classList.remove('d-none'); modalContent.value = subitem.identifier; } else { + identifierBox.classList.add('d-none'); modalContent.value = ''; } @@ -39,10 +42,34 @@ function openDynamicPopup(subitem) { linkHref.href = '#'; } + // Konfiguriere die Alternativen + const alternativesList = document.getElementById('dynamicAlternativesList'); + alternativesList.innerHTML = ''; // Clear existing alternatives + if (subitem.alternatives && subitem.alternatives.length > 0) { + subitem.alternatives.forEach(alt => { + const listItem = document.createElement('li'); + listItem.classList.add('list-group-item', 'd-flex', 'justify-content-between', 'align-items-center'); + listItem.innerHTML = ` + + ${alt.name} + + + `; + alternativesList.appendChild(listItem); + }); + } else { + const noAltItem = document.createElement('li'); + noAltItem.classList.add('list-group-item'); + noAltItem.innerText = 'No alternatives available.'; + alternativesList.appendChild(noAltItem); + } + // Kopierfunktion für den Identifier document.getElementById('dynamicCopyButton').addEventListener('click', function () { modalContent.select(); - navigator.clipboard.writeText(modalContent.value) + navigator.clipboard.writeText(modalContent.value).then(() => { + alert('Identifier copied to clipboard!'); + }); }); // Modal anzeigen diff --git a/app/templates/moduls/modal.html.j2 b/app/templates/moduls/modal.html.j2 index 37f966c..fa41f8e 100644 --- a/app/templates/moduls/modal.html.j2 +++ b/app/templates/moduls/modal.html.j2 @@ -15,7 +15,7 @@ -