Skip to content

Commit ca81bcb

Browse files
committed
added links to both surveys in the header
1 parent 71257c0 commit ca81bcb

1 file changed

Lines changed: 71 additions & 13 deletions

File tree

survey_dashboard/hmc_layout/en_template.html

Lines changed: 71 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -958,19 +958,41 @@
958958
</a>
959959
</div>
960960

961-
<div
962-
class="pr-6 mt-10 lg:pr-12 xl:block"
963-
>
964-
<ul class="flex">
965-
<li class="ml-2">
966-
<a
967-
class="text-blue-dark text-sm uppercase hmc_highlight_hover"
968-
href="https://2024.dashboard.survey.helmholtz-metadaten.de"
969-
>
970-
Data Professionals Survey 2024
971-
</a>
972-
</li>
973-
</ul>
961+
962+
<div class="flex" id="survey-nav">
963+
<div
964+
class="mt-10 mr-3"
965+
>
966+
<ul class="flex">
967+
<li class="ml-2">
968+
<a
969+
class="text-blue-dark text-sm uppercase survey-link"
970+
style="color: #002864;"
971+
href="https://2021.dashboard.survey.helmholtz-metadaten.de"
972+
data-survey="2021"
973+
>
974+
HMC Community Survey 2021
975+
</a>
976+
</li>
977+
</ul>
978+
</div>
979+
<div class="mt-10">|</div>
980+
<div
981+
class="pr-6 mt-10"
982+
>
983+
<ul class="flex">
984+
<li class="ml-2">
985+
<a
986+
class="text-blue-dark text-sm uppercase survey-link"
987+
style="color: #002864;"
988+
href="https://2024.dashboard.survey.helmholtz-metadaten.de"
989+
data-survey="2024"
990+
>
991+
HMC Data Professionals Survey 2024
992+
</a>
993+
</li>
994+
</ul>
995+
</div>
974996
</div>
975997
</div>
976998

@@ -2033,6 +2055,42 @@
20332055
}
20342056
</script>
20352057

2058+
<!-- Survey Navigation Handler -->
2059+
<script>
2060+
// Variable to track which survey is selected (default: 2021)
2061+
var selected = '2021';
2062+
2063+
document.addEventListener('DOMContentLoaded', function() {
2064+
// Determine which survey is currently active based on URL
2065+
var currentUrl = window.location.hostname;
2066+
if (currentUrl.includes('2024.dashboard')) {
2067+
selected = '2024';
2068+
} else {
2069+
selected = '2021';
2070+
}
2071+
2072+
// Apply active styling to the selected survey link
2073+
var links = document.querySelectorAll('.survey-link');
2074+
links.forEach(function(link) {
2075+
var survey = link.getAttribute('data-survey');
2076+
if (survey === selected) {
2077+
link.style.color = '#14c8ff';
2078+
2079+
} else {
2080+
link.style.color = '#002864';
2081+
2082+
}
2083+
});
2084+
2085+
// Add click handlers to update selected variable
2086+
links.forEach(function(link) {
2087+
link.addEventListener('click', function() {
2088+
selected = link.getAttribute('data-survey');
2089+
});
2090+
});
2091+
});
2092+
</script>
2093+
20362094
<!-- Matomo -->
20372095
<script>
20382096
var _paq = (window._paq = window._paq || []);

0 commit comments

Comments
 (0)