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() {
var projectId = self.getMap().getProject().getProjectId();
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({
type : "div",
style : "display:none; ",
......
......@@ -2,6 +2,7 @@
/* exported logger */
var ConfigurationType = require('../../ConfigurationType');
var Panel = require('./Panel');
var PanelControlElementType = require('../PanelControlElementType');
var PublicationListDialog = require('./PublicationListDialog');
......@@ -22,6 +23,8 @@ ProjectInfoPanel.prototype.constructor = ProjectInfoPanel;
ProjectInfoPanel.prototype._createInfoPanelGui = function() {
var self = this;
var projectId = self.getMap().getProject().getProjectId();
var infoDiv = Functions.createElement({
type : "div",
name : "infoDiv",
......@@ -31,7 +34,7 @@ ProjectInfoPanel.prototype._createInfoPanelGui = function() {
this.setControlElement(PanelControlElementType.INFO_DIV, infoDiv);
var infoTitle = Functions.createElement({
type : "h5",
type : "h4",
content : "PROJECT INFO:"
});
infoDiv.appendChild(infoTitle);
......@@ -78,53 +81,102 @@ ProjectInfoPanel.prototype._createInfoPanelGui = function() {
this.setControlElement(PanelControlElementType.INFO_PROJECT_DESCRIOPTION_TEXT, 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",
content : "Publications:"
});
var projectPublicationsDiv = Functions.createElement({
type : "div"
this.publicationListDialog = new PublicationListDialog({
customMap : self.getMap(),
element : dialogDiv,
});
dataTab = Functions.createElement({
type : "ul",
});
infoDiv.appendChild(dataTab);
var projectPublicationsText = Functions.createElement({
type : "label",
type : "span",
name : "projectPublicationsText",
style : "font-family:FontAwesome; font-weight: normal;font-style: normal;cursor: pointer",
});
this.setControlElement(PanelControlElementType.INFO_PROJECT_PUBLICATIONS_TEXT, projectPublicationsText);
var projectPublicationsButton = Functions.createElement({
type : "button",
type : "a",
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);
projectPublicationsDiv.appendChild(projectPublicationsText);
projectPublicationsDiv.appendChild(projectPublicationsButton);
dataTab.appendChild(self.createTableRow([ projectPublicationsLabel, projectPublicationsDiv ]));
var projectOriginalFileLabel = Functions.createElement({
type : "div",
content : "Original file:"
var liElement = Functions.createElement({
type : "li",
style : "line-height: 30px;",
});
liElement.appendChild(projectPublicationsButton);
dataTab.appendChild(liElement);
var projectOriginalFileButton = Functions.createElement({
type : "button",
type : "a",
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);
dataTab.appendChild(self.createTableRow([ projectOriginalFileLabel, projectOriginalFileButton ]));
var dialogDiv = Functions.createElement({
type : "div",
});
this.publicationListDialog = new PublicationListDialog({
customMap: self.getMap(),
element: dialogDiv,
var liElement = Functions.createElement({
type : "li",
style : "line-height: 30px",
});
liElement.appendChild(projectOriginalFileButton);
dataTab.appendChild(liElement);
var exportButton = Functions.createElement({
type : "a",
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() {
......@@ -145,7 +197,7 @@ ProjectInfoPanel.prototype.downloadSourceFile = function() {
var self = this;
return ServerConnector.getProjectSourceDownloadUrl().then(function(url) {
return self.downloadFile(url);
}).catch(GuiConnector.alert);
}).then(null, GuiConnector.alert);
};
ProjectInfoPanel.prototype.showPublicationListDialog = function() {
......
......@@ -49,6 +49,15 @@ describe('ProjectInfoPanel', function() {
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() {
return ServerConnector.getProject().then(function(project) {
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