diff --git a/index_Projektseite_SmartPollen.html b/index_Projektseite_SmartPollen.html index c5742463cb26f058cbf6b7371372b5b298db07a5..063eff0d0cd3c55be3999491558c8b1d511a7e16 100755 --- a/index_Projektseite_SmartPollen.html +++ b/index_Projektseite_SmartPollen.html @@ -50,7 +50,7 @@ Die Datensätze beinhalten nur Bäume im öffentlichen Raum, was zu blinden Flec Winddaten werden von OpenWeatherMap über einen API verbunden und alle 5 Minuten aktualisiert. Die wichtigsten Winddaten-Parameter sind: <ul> <li>[wind.speed] Windgeschwindigkeit, Einheit: meter/sek</li> - <li>[wind.deg] Windrichtung, Einheit: Grad Celsius (meteoroligisch)</li> + <li>[wind.deg] Windrichtung, Einheit: Grad Celsius (meteorologisch)</li> </ul> Historische Winddaten basieren auf einer statistischen Analyse von stündlichen Wetterberichten und Modellrekonstruktionen vom 1. Januar 1980 bis 31. Dezember 2016 (Stand Mai 2017) der Open-Source-Seite Weatherspark.com. <br/> diff --git a/js/headfoot.js b/js/headfoot.js index 506744d09bd851134206643360cce2ca098a7f73..e0cc91135e2cac37a52e53a516c8d07d5886d33b 100755 --- a/js/headfoot.js +++ b/js/headfoot.js @@ -1,4 +1,4 @@ -var menu = [{'name':'Informationen', 'combos':[{'name':'Projekte', 'link':'/project'}, {'name':'Über das M4_LAB', 'link':'/index_Projektseite_M4_LAB.html'}], 'type':'dropdown', 'link':'#'},{'name':'Zusammenarbeit', 'combos':[{'name':'Mailinglisten', 'link':'#'},{'name':'Videokonferenzen', 'link':'/videoconference.html'}, {'name':'...', 'link':'#'}], 'type':'dropdown', 'link':'#'},{'name':'Events', 'combos':[{'name':'...', 'link':'#'}, {'name':'...', 'link':'#'}], 'type':'dropdown', 'link':'#'},{'name':'Bürgerbeteiligung', 'combos':[{'name':'...', 'link':'#'}, {'name':'...', 'link':'#'}], 'type':'dropdown', 'link':'#'},{'name':'Login', 'combos':[], 'type':'', 'link':'/user/login'}]; +var menu = [{'name':'Informationen', 'combos':[{'name':'Projekte', 'link':'/project'}, {'name':'Über das M4_LAB', 'link':'/index_Projektseite_M4_LAB.html'}], 'type':'dropdown', 'link':'#'},{'name':'Zusammenarbeit', 'combos':[{'name':'Mailinglisten', 'link':'#'},{'name':'Videokonferenzen', 'link':'/videoconference.html'}, {'name':'...', 'link':'#'}], 'type':'dropdown', 'link':'#'},{'name':'Events', 'combos':[{'name':'...', 'link':'#'}, {'name':'...', 'link':'#'}], 'type':'dropdown', 'link':'#'},{'name':'Bürgerbeteiligung', 'combos':[{'name':'...', 'link':'#'}, {'name':'...', 'link':'#'}], 'type':'dropdown', 'link':'#'},{'name':'Login', 'combos':[], 'type':'loginbutton', 'link':'/auth-server-DRAFT/login'}]; var hft_links = [{'url':'#', 'name':'Kontakt'},{'url':'#', 'name':'Impressum'},{'url':'#', 'name':'Datenschutz'}] @@ -10,6 +10,14 @@ function prependChild(parent,child){ parent.insertBefore(child, parent.childNodes[0]); } +function userAuthenticated(){ + let params = new URLSearchParams(window.location.search); + if(params.get('isAuthenticatedUser')){ + return true; + }else{ + return false; + } +} /* function head() * creates header and prepends it to the documents body */ @@ -70,11 +78,21 @@ function head(){ for(let k = 0; k< menu[j].combos.length; k++){ let combolink = document.createElement('a'); combolink.classList.add("dropdown-item"); - combolink.href = menu[j].combos[k].link; + if(menu[j].combos[k].name == "Projekte" && userAuthenticated()){ + combolink.href = menu[j].combos[k].link + "?isAuthenticatedUser=true; + }else{ + combolink.href = menu[j].combos[k].link; + } combolink.innerHTML = menu[j].combos[k].name; combodiv.appendChild(combolink); } headitem.appendChild(combodiv); + }else if(itemtype=='loginbutton'){ + if(userAuthenticated()){ + headlink.innerHTML="Account"; + headlink.href="/account/"; + } + } headitem.appendChild(headlink); navelements.appendChild(headitem);