Skip to content
Snippets Groups Projects
Commit adc6971a authored by Piotr Gawron's avatar Piotr Gawron
Browse files

admin and manual links moved to info tab

parent 61fcff27
No related branches found
No related tags found
1 merge request!27Resolve "Project tab"
...@@ -26,30 +26,6 @@ Footer.prototype._createFooterGui = function() { ...@@ -26,30 +26,6 @@ Footer.prototype._createFooterGui = function() {
var projectId = self.getMap().getProject().getProjectId(); var projectId = self.getMap().getProject().getProjectId();
self.getElement().className = "footerLinks"; self.getElement().className = "footerLinks";
var link = Functions.createElement({
type : "a",
name : "footerManualLink",
style : "padding-left:25px;",
content : '<i class="fa fa-lock" style="font-size:17px"></i> &nbsp;MANUAL',
});
link.href = "#";
link.onclick = function() {
return ServerConnector.getConfigurationParam(ConfigurationType.USER_MANUAL_FILE).then(function(manualFileUrl) {
var win = window.open(manualFileUrl, '_user_manual_');
win.focus();
});
};
self.getElement().appendChild(link);
link = Functions.createElement({
type : "a",
name : "footerAdminLink",
style : "padding-left:25px;",
content : 'EXPORT&nbsp; <i class="fa fa-mail-forward" style="font-size:17px"></i>',
});
link.href = ServerConnector.getServerBaseUrl() + "/export.xhtml?id=" + projectId;
self.getElement().appendChild(link);
var loadingDiv = Functions.createElement({ var loadingDiv = Functions.createElement({
type : "div", type : "div",
style : "display:none; ", style : "display:none; ",
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
/* exported logger */ /* exported logger */
var ConfigurationType = require('../../ConfigurationType');
var Panel = require('./Panel'); var Panel = require('./Panel');
var PanelControlElementType = require('../PanelControlElementType'); var PanelControlElementType = require('../PanelControlElementType');
var PublicationListDialog = require('./PublicationListDialog'); var PublicationListDialog = require('./PublicationListDialog');
...@@ -22,6 +23,8 @@ ProjectInfoPanel.prototype.constructor = ProjectInfoPanel; ...@@ -22,6 +23,8 @@ ProjectInfoPanel.prototype.constructor = ProjectInfoPanel;
ProjectInfoPanel.prototype._createInfoPanelGui = function() { ProjectInfoPanel.prototype._createInfoPanelGui = function() {
var self = this; var self = this;
var projectId = self.getMap().getProject().getProjectId();
var infoDiv = Functions.createElement({ var infoDiv = Functions.createElement({
type : "div", type : "div",
name : "infoDiv", name : "infoDiv",
...@@ -31,7 +34,7 @@ ProjectInfoPanel.prototype._createInfoPanelGui = function() { ...@@ -31,7 +34,7 @@ ProjectInfoPanel.prototype._createInfoPanelGui = function() {
this.setControlElement(PanelControlElementType.INFO_DIV, infoDiv); this.setControlElement(PanelControlElementType.INFO_DIV, infoDiv);
var infoTitle = Functions.createElement({ var infoTitle = Functions.createElement({
type : "h5", type : "h4",
content : "PROJECT INFO:" content : "PROJECT INFO:"
}); });
infoDiv.appendChild(infoTitle); infoDiv.appendChild(infoTitle);
...@@ -78,53 +81,102 @@ ProjectInfoPanel.prototype._createInfoPanelGui = function() { ...@@ -78,53 +81,102 @@ ProjectInfoPanel.prototype._createInfoPanelGui = function() {
this.setControlElement(PanelControlElementType.INFO_PROJECT_DESCRIOPTION_TEXT, projectDescriptionText); this.setControlElement(PanelControlElementType.INFO_PROJECT_DESCRIOPTION_TEXT, projectDescriptionText);
dataTab.appendChild(self.createTableRow([ projectDescriptionLabel, projectDescriptionText ])); dataTab.appendChild(self.createTableRow([ projectDescriptionLabel, projectDescriptionText ]));
var projectPublicationsLabel = Functions.createElement({ infoTitle = Functions.createElement({
type : "h4",
content : "Data:"
});
infoDiv.appendChild(infoTitle);
var dialogDiv = Functions.createElement({
type : "div", type : "div",
content : "Publications:"
}); });
var projectPublicationsDiv = Functions.createElement({ this.publicationListDialog = new PublicationListDialog({
type : "div" customMap : self.getMap(),
element : dialogDiv,
});
dataTab = Functions.createElement({
type : "ul",
}); });
infoDiv.appendChild(dataTab);
var projectPublicationsText = Functions.createElement({ var projectPublicationsText = Functions.createElement({
type : "label", type : "span",
name : "projectPublicationsText", name : "projectPublicationsText",
style : "font-family:FontAwesome; font-weight: normal;font-style: normal;cursor: pointer",
}); });
this.setControlElement(PanelControlElementType.INFO_PROJECT_PUBLICATIONS_TEXT, projectPublicationsText); this.setControlElement(PanelControlElementType.INFO_PROJECT_PUBLICATIONS_TEXT, projectPublicationsText);
var projectPublicationsButton = Functions.createElement({ var projectPublicationsButton = Functions.createElement({
type : "button", type : "a",
name : "projectPublicationsButton", name : "projectPublicationsButton",
content : "SHOW"
}); });
projectPublicationsButton.appendChild(Functions.createElement({
type : "span",
content : "<i class='fa fa-list'>&nbsp;",
}));
projectPublicationsButton.appendChild(projectPublicationsText);
projectPublicationsButton.appendChild(Functions.createElement({
type : "span",
style : "font-family:FontAwesome; font-weight: normal;font-style: normal;cursor: pointer",
content : "&nbsp;publication(s)",
}));
this.setControlElement(PanelControlElementType.INFO_PROJECT_SHOW_PUBLICATIONS_BUTTON, projectPublicationsButton); this.setControlElement(PanelControlElementType.INFO_PROJECT_SHOW_PUBLICATIONS_BUTTON, projectPublicationsButton);
projectPublicationsDiv.appendChild(projectPublicationsText);
projectPublicationsDiv.appendChild(projectPublicationsButton);
dataTab.appendChild(self.createTableRow([ projectPublicationsLabel, projectPublicationsDiv ])); var liElement = Functions.createElement({
type : "li",
var projectOriginalFileLabel = Functions.createElement({ style : "line-height: 30px;",
type : "div",
content : "Original file:"
}); });
liElement.appendChild(projectPublicationsButton);
dataTab.appendChild(liElement);
var projectOriginalFileButton = Functions.createElement({ var projectOriginalFileButton = Functions.createElement({
type : "button", type : "a",
name : "projectOriginalFileButton", name : "projectOriginalFileButton",
content : "Download", href : "#",
content : "<i class='fa fa-files-o'>&nbsp;source file",
}); });
this.setControlElement(PanelControlElementType.INFO_PROJECT_GET_ORIGINAL_FILE_BUTTON, projectOriginalFileButton); this.setControlElement(PanelControlElementType.INFO_PROJECT_GET_ORIGINAL_FILE_BUTTON, projectOriginalFileButton);
dataTab.appendChild(self.createTableRow([ projectOriginalFileLabel, projectOriginalFileButton ])); var liElement = Functions.createElement({
type : "li",
style : "line-height: 30px",
var dialogDiv = Functions.createElement({ });
type : "div", liElement.appendChild(projectOriginalFileButton);
}); dataTab.appendChild(liElement);
this.publicationListDialog = new PublicationListDialog({ var exportButton = Functions.createElement({
customMap: self.getMap(), type : "a",
element: dialogDiv, href : ServerConnector.getServerBaseUrl() + "/export.xhtml?id=" + projectId,
content : '<i class="fa fa-mail-forward">&nbsp;EXPORT',
});
var liElement = Functions.createElement({
type : "li",
style : "line-height: 30px",
});
liElement.appendChild(exportButton);
dataTab.appendChild(liElement);
var manualButton = Functions.createElement({
type : "a",
name : "manualLink",
content : '<i class="fa fa-file">&nbsp;MANUAL',
});
manualButton.href = "#";
manualButton.onclick = function() {
return ServerConnector.getConfigurationParam(ConfigurationType.USER_MANUAL_FILE).then(function(manualFileUrl) {
var win = window.open(manualFileUrl, '_user_manual_');
win.focus();
});
};
liElement = Functions.createElement({
type : "li",
style : "line-height: 30px",
}); });
liElement.appendChild(manualButton);
dataTab.appendChild(liElement);
}; };
ProjectInfoPanel.prototype._createInfoPanelLogic = function() { ProjectInfoPanel.prototype._createInfoPanelLogic = function() {
...@@ -145,7 +197,7 @@ ProjectInfoPanel.prototype.downloadSourceFile = function() { ...@@ -145,7 +197,7 @@ ProjectInfoPanel.prototype.downloadSourceFile = function() {
var self = this; var self = this;
return ServerConnector.getProjectSourceDownloadUrl().then(function(url) { return ServerConnector.getProjectSourceDownloadUrl().then(function(url) {
return self.downloadFile(url); return self.downloadFile(url);
}).catch(GuiConnector.alert); }).then(null, GuiConnector.alert);
}; };
ProjectInfoPanel.prototype.showPublicationListDialog = function() { ProjectInfoPanel.prototype.showPublicationListDialog = function() {
......
...@@ -49,6 +49,15 @@ describe('ProjectInfoPanel', function() { ...@@ -49,6 +49,15 @@ describe('ProjectInfoPanel', function() {
return panel.downloadSourceFile(); return panel.downloadSourceFile();
}); });
it('open manual', function() {
var div = testDiv;
var panel = new ProjectInfoPanel({
element : div,
customMap : helper.createCustomMap(),
});
return $("[name='manualLink']", $(div))[0].onclick();
});
it('show publication list', function() { it('show publication list', function() {
return ServerConnector.getProject().then(function(project) { return ServerConnector.getProject().then(function(project) {
var div = testDiv; var div = testDiv;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment