Commit a2f8abd1 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

login link in eader separted from access admin panel link

parent 01cf86f2
......@@ -35,6 +35,8 @@ h5 {
background-color: #333333;
color: #ffffff;
display: block;
padding-left: 8px;
padding-right: 8px;
}
.minerva-header a:link, .minerva-header a:visited {
......@@ -46,7 +48,8 @@ h5 {
transition: background-color 0.4s ease-in-out 0s;
font-size: 13px;
font-weight: 900;
padding-left: 15px;
padding-left: 8px;
padding-right: 8px;
}
.minerva-header-right-menu {
......@@ -77,12 +80,8 @@ h5 {
}
.minerva-header .minerva-menu-link {
padding-right: 5px;
float: right;
}
.minerva-header .minerva-admin-link {
padding-right: 15px;
padding-left: 8px;
padding-right: 8px;
float: right;
}
......
......@@ -21,6 +21,7 @@ var xss = require('xss');
* @param {boolean} [params.optionsMenu=false]
* @param {Configuration} params.configuration
* @param {Project} [params.project]
* @param {LeftPanel} params.parent
* @param {ServerConnector} [params.serverConnector]
*
* @constructor
......@@ -35,7 +36,7 @@ function Header(params) {
optionsMenu: params.optionsMenu
};
self._createHeaderGui(guiParams);
self._createHeaderGui(guiParams, params.parent);
}
Header.prototype = Object.create(AbstractGuiElement.prototype);
......@@ -45,9 +46,10 @@ Header.prototype.constructor = Header;
*
* @param {Object} guiParams
* @param {boolean} guiParams.optionsMenu
* @param {LeftPanel} parent
* @private
*/
Header.prototype._createHeaderGui = function (guiParams) {
Header.prototype._createHeaderGui = function (guiParams, parent) {
var self = this;
self.getElement().className = "minerva-header";
......@@ -66,14 +68,40 @@ Header.prototype._createHeaderGui = function (guiParams) {
loadingDiv.appendChild(loadingImg);
this.setControlElement(PanelControlElementType.FOOTER_LOADING_DIV, loadingDiv);
var link = Functions.createElement({
self.getElement().appendChild(Functions.createElement({
type: "a",
className: "minerva-admin-link",
content: '<i class="fa fa-lock" style="font-size:17px"></i>&nbsp;',
className: "minerva-menu-link",
content: '<i class="fa fa-user-cog" style="font-size:17px"></i>&nbsp;',
href: self.getServerConnector().getServerBaseUrl() + "admin.xhtml?id=" + projectId,
title: "Admin panel",
xss: false
});
self.getElement().appendChild(link);
}));
if (self.getServerConnector().getSessionData().getLogin() === "anonymous") {
self.getElement().appendChild(Functions.createElement({
type: "a",
className: "minerva-menu-link",
content: '<i class="fa fa-lock" style="font-size:17px"></i>&nbsp;',
href: "#",
onclick: function() {
return parent.getLoginDialog().open();
},
title: "Login",
xss: false
}));
} else {
self.getElement().appendChild(Functions.createElement({
type: "a",
className: "minerva-menu-link",
content: '<i class="fa fa-lock-open" style="font-size:17px"></i>&nbsp;',
href: "#",
onclick: function() {
return self.getServerConnector().logout().catch(GuiConnector.alert);
},
title: "Logout",
xss: false
}));
}
if (guiParams.optionsMenu) {
var optionsElement = Functions.createElement({type: "ul", className: "minerva-options-menu"});
......
......@@ -59,7 +59,8 @@ LeftPanel.prototype._createPanelGui = function () {
element: headerDiv,
customMap: self.getMap(),
optionsMenu: true,
configuration: self.getConfiguration()
configuration: self.getConfiguration(),
parent: this
});
self.getElement().appendChild(headerDiv);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment