diff --git a/portal/assets/css/ynh-style.css b/portal/assets/css/ynh-style.css index a2a7f2e..a9c1711 100644 --- a/portal/assets/css/ynh-style.css +++ b/portal/assets/css/ynh-style.css @@ -126,6 +126,39 @@ img { .ynh-wrapper:after {content: " ";display: table;} .ynh-wrapper:after {clear: both;} +/* Logo */ +body.overlay .logo { + display: none; +} + +.logo { + text-align: center; + margin-bottom: 0; + opacity: 0.7; +} + +.logo img { + margin-top: 4%; + width: 4em; +} + +.logged .logo { + position: fixed; + bottom: 20px; + right: 20px; + z-index: 0; + opacity: 0.7; +} +.logged .logo img { + margin-top: 0; + width: 2.5em; + padding: 0.3em; + border-radius: 5px; +} + +.ynh-panel-active .logo { + display: none; +} /* messages */ .messages { @@ -365,6 +398,7 @@ textarea { transition: all 0.1s ease; -webkit-transition: all 0.1s ease; } + .user-container-edit:hover:after, .user-container-password:hover:after { left: -20px; diff --git a/portal/assets/js/global.js b/portal/assets/js/global.js index 8ca9deb..e238117 100644 --- a/portal/assets/js/global.js +++ b/portal/assets/js/global.js @@ -78,10 +78,22 @@ document.addEventListener('DOMContentLoaded', function() { // Response is JSON response = JSON.parse(r.responseText); - // load additional theme's script - loadScript("/yunohost/sso/assets/themes/"+ response.theme +"/js/ynhpanel.js"); - }; r.send(); + if(window.location != window.parent.location) { + // Set class to body to show we're in overlay + document.body.classList.add('overlay'); + let userContainer = document.querySelector('a.user-container'); + userContainer.classList.replace('user-container-info', 'user-container-edit'); + userContainer.setAttribute('href', userContainer + .getAttribute('href') + .replace('edit.html', '')); + userContainer.addEventListener('click', function(e) { + e.preventDefault(); + e.stopPropagation(); + window.parent.location.href = userContainer.getAttribute('href'); + }) + } + }); diff --git a/portal/assets/js/ynhpanel.js b/portal/assets/js/ynhpanel.js index 6fc4c66..22ee714 100644 --- a/portal/assets/js/ynhpanel.js +++ b/portal/assets/js/ynhpanel.js @@ -234,7 +234,6 @@ domReady(function(){ // Portal link is draggable, for user convenience dragg('ynh-overlay-switch'); - // Create overlay element var overlay = document.createElement('iframe'); overlay.src = "/yunohost/sso/info.html"; @@ -243,7 +242,6 @@ domReady(function(){ document.body.insertBefore(overlay, null); - // Get user's app var r = new XMLHttpRequest(); r.open("GET", "/ynhpanel.json", true); @@ -262,14 +260,6 @@ domReady(function(){ portalStyle.setAttribute("href", '/ynhpanel.css'); document.getElementsByTagName("head")[0].insertBefore(portalStyle, null); - // Custom style from theme id specified in config - var portalThemeStyle = document.createElement("link"); - portalThemeStyle.setAttribute("rel", "stylesheet"); - portalThemeStyle.setAttribute("type", "text/css"); - portalThemeStyle.setAttribute("href", '/yunohost/sso/assets/themes/'+ response.theme +'/css/ynhpanel.css'); - document.getElementsByTagName("head")[0].insertBefore(portalThemeStyle, null); - - // Bind YNH Button window.addEvent(portal, 'click', function(e){ // Prevent default click diff --git a/portal/header.ms b/portal/header.ms index 14e0e89..6024ae2 100644 --- a/portal/header.ms +++ b/portal/header.ms @@ -35,6 +35,10 @@ +

+ Yunohost +

+
{{#flash_win}}
{{.}}