diff --git a/dejacode/static/css/dejacode_bootstrap.css b/dejacode/static/css/dejacode_bootstrap.css index fe4f7f88..f67badbb 100644 --- a/dejacode/static/css/dejacode_bootstrap.css +++ b/dejacode/static/css/dejacode_bootstrap.css @@ -546,6 +546,9 @@ table.purldb-table .column-license_expression { color: white; vertical-align: middle; } +.text-request { + color: var(--bs-djc-request-bg); +} /* -- Requests form -- */ #workflow-request-form fieldset.right-side label { diff --git a/dejacode/static/js/dejacode_main.js b/dejacode/static/js/dejacode_main.js index 428dd899..00cc51b2 100644 --- a/dejacode/static/js/dejacode_main.js +++ b/dejacode/static/js/dejacode_main.js @@ -135,13 +135,24 @@ function setupSearchModal() { if (!searchModal) return; + // Apply a scope button as the active one and sync the form action + const applyScope = (button) => { + document.querySelectorAll('.search-scope-btn').forEach(b => b.classList.remove('active')); + button.classList.add('active'); + searchForm.setAttribute('action', button.dataset.scopeAction); + }; + + // Sync form action with the currently active scope button on page load + const activeButton = document.querySelector('.search-scope-btn.active'); + if (searchForm && activeButton) { + searchForm.setAttribute('action', activeButton.dataset.scopeAction); + } + // Scope selector buttons if (searchForm) { document.querySelectorAll('.search-scope-btn').forEach(button => { button.addEventListener('click', () => { - document.querySelectorAll('.search-scope-btn').forEach(b => b.classList.remove('active')); - button.classList.add('active'); - searchForm.setAttribute('action', button.dataset.scopeAction); + applyScope(button); searchInput.focus(); }); }); @@ -195,6 +206,39 @@ function setupThemeSwitcher() { }); } +function setupPlatformHints() { + const isMac = navigator.userAgentData + ? navigator.userAgentData.platform === 'macOS' + : /Mac/.test(navigator.platform); + + if (!isMac) return; + + const searchSubmitKey = document.getElementById('search-submit-key'); + if (searchSubmitKey) { + searchSubmitKey.textContent = 'Return'; + } +} + +function setupDismissibleAlerts() { + // Hide announcements dismissed by the user via localStorage. + // The stored value is the announcement text itself, so when the + // admin updates the message, it automatically reappears for everyone. + + const alert = document.getElementById('announcement-alert'); + if (!alert) return; + + const text = alert.textContent.trim(); + if (localStorage.getItem('dismissed_announcement') === text) { + alert.remove(); + return; + } + + alert.classList.remove('d-none'); + alert.addEventListener('closed.bs.alert', () => { + localStorage.setItem('dismissed_announcement', text); + }); +} + document.addEventListener('DOMContentLoaded', () => { NEXB = {}; NEXB.client_data = JSON.parse(document.getElementById("client_data").textContent); @@ -231,4 +275,6 @@ document.addEventListener('DOMContentLoaded', () => { setupHTMX(); setupSearchModal(); setupThemeSwitcher(); + setupPlatformHints(); + setupDismissibleAlerts(); }); diff --git a/dje/templates/dataspace_home.html b/dje/templates/dataspace_home.html index 1a25d168..465195d6 100644 --- a/dje/templates/dataspace_home.html +++ b/dje/templates/dataspace_home.html @@ -6,26 +6,73 @@ {% block page_title %}DejaCode for {{ user.dataspace }}{% endblock %} {% block content %} -

- DejaCode for {{ user.dataspace }} -

-