From 48483ea019e6fc231304f0370b40c816c9d717a8 Mon Sep 17 00:00:00 2001 From: David Kennedy <122780670+DavidCKen@users.noreply.github.com> Date: Thu, 17 Sep 2026 08:29:56 +0000 Subject: [PATCH 1/2] feat: add dismissible survey banner to docs site Adds a site-wide, dismissible banner linking to the docs feedback survey. It renders between the domain link bar and the main header, above all page content, via the existing Material `announce` block so it appears on every page across all build configs that share the custom theme. Dismissal is remembered per-browser via localStorage, keyed by a banner id so a future survey can be shown again just by bumping that id in theme/main.html. --- theme/main.html | 32 ++++++++++++++++++++ theme/resources/css/mkdocs_dhis2.css | 44 ++++++++++++++++++++++++++++ 2 files changed, 76 insertions(+) diff --git a/theme/main.html b/theme/main.html index 3aa9b63..9ba98a2 100644 --- a/theme/main.html +++ b/theme/main.html @@ -31,6 +31,38 @@ >Developers +
+ + 📋 Help us improve this DHIS2 documentation site by taking our short survey + + +
+ {% endblock %} {% block content %}
For the complete DHIS2 documentation index, see llms.txt. diff --git a/theme/resources/css/mkdocs_dhis2.css b/theme/resources/css/mkdocs_dhis2.css index 8bcd000..e7678f5 100644 --- a/theme/resources/css/mkdocs_dhis2.css +++ b/theme/resources/css/mkdocs_dhis2.css @@ -1370,3 +1370,47 @@ blockquote.nested { color: var(--grey900); border-radius: 8px !important; } + +/* */ +/* Survey announcement banner (dismissible) */ +/* */ + +.survey-banner { + display: flex; + align-items: center; + justify-content: center; + gap: 12px; + background: #1976d2; + padding: 10px 40px; + position: relative; + text-align: center; +} + +.survey-banner-text a { + color: #fff; + font-size: 18px; + text-decoration: underline; +} + +.survey-banner-text a:hover { + color: #fff; + opacity: 0.85; +} + +.survey-banner-close { + position: absolute; + right: 16px; + top: 50%; + transform: translateY(-50%); + background: none; + border: none; + color: #fff; + font-size: 20px; + line-height: 1; + cursor: pointer; + padding: 4px; +} + +.survey-banner-close:hover { + opacity: 0.75; +} From 658e28ffb04389433c4dbfef406866f615311e23 Mon Sep 17 00:00:00 2001 From: David Kennedy <122780670+DavidCKen@users.noreply.github.com> Date: Thu, 17 Sep 2026 11:00:11 +0200 Subject: [PATCH 2/2] fix: use .dataset instead of getAttribute for banner id Addresses SonarCloud finding on PR #289. --- theme/main.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/theme/main.html b/theme/main.html index 9ba98a2..a7b164e 100644 --- a/theme/main.html +++ b/theme/main.html @@ -46,7 +46,7 @@ (function () { var banner = document.getElementById('survey-banner'); if (!banner) return; - var key = 'dhis2-docs-banner-dismissed-' + banner.getAttribute('data-banner-id'); + var key = 'dhis2-docs-banner-dismissed-' + banner.dataset.bannerId; try { if (localStorage.getItem(key)) { banner.style.display = 'none';