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

visualization of general properties of the project

parent bb01dd2c
No related branches found
No related tags found
2 merge requests!115Resolve "admin panel should use API",!114Resolve "admin panel should use API"
...@@ -487,7 +487,8 @@ h1 { ...@@ -487,7 +487,8 @@ h1 {
font-weight: 400; font-weight: 400;
} }
.projects-tab .menu-row button { .minerva-projects-tab .minerva-menu-row button,
.minerva-edit-project-dialog .minerva-menu-row button {
margin: 5px; margin: 5px;
} }
...@@ -497,4 +498,12 @@ h1 { ...@@ -497,4 +498,12 @@ h1 {
.ui-icon-refresh { .ui-icon-refresh {
background: url(images/icons/refresh.png.xhtml) 50% 50% no-repeat; background: url(images/icons/refresh.png.xhtml) 50% 50% no-repeat;
}
.nav>li>a {
text-decoration: none;
}
.minerva-edit-project-dialog div[style*="display: table-cell"] {
padding: 2px;
} }
\ No newline at end of file
...@@ -13,6 +13,7 @@ var guiUtils = new (require('../leftPanel/GuiUtils'))(); ...@@ -13,6 +13,7 @@ var guiUtils = new (require('../leftPanel/GuiUtils'))();
function EditProjectDialog(params) { function EditProjectDialog(params) {
AbstractGuiElement.call(this, params); AbstractGuiElement.call(this, params);
var self = this; var self = this;
$(self.getElement()).addClass("minerva-edit-project-dialog");
self.createGui(); self.createGui();
} }
...@@ -76,10 +77,162 @@ EditProjectDialog.prototype.addTab = function(params) { ...@@ -76,10 +77,162 @@ EditProjectDialog.prototype.addTab = function(params) {
navigationBar : params.tabMenuDiv navigationBar : params.tabMenuDiv
}); });
if (params.content !== undefined) {
contentDiv.appendChild(params.content);
}
params.tabContentDiv.appendChild(contentDiv); params.tabContentDiv.appendChild(contentDiv);
}; };
EditProjectDialog.prototype.createGeneralTabContent = function() { EditProjectDialog.prototype.createGeneralTabContent = function() {
var self = this;
var project = self.getProject();
var result = new Functions.createElement({
type : "div",
});
var table = new Functions.createElement({
type : "div",
style : "display:table"
});
result.appendChild(table);
var projectIdRow = new Functions.createElement({
type : "div",
style : "display:table-row"
});
table.appendChild(projectIdRow);
projectIdRow.appendChild(new Functions.createElement({
type : "div",
style : "display:table-cell",
content : "ProjectId",
}));
projectIdRow.appendChild(new Functions.createElement({
type : "div",
style : "display:table-cell",
content : project.getProjectId(),
}));
var nameRow = new Functions.createElement({
type : "div",
style : "display:table-row"
});
table.appendChild(nameRow);
nameRow.appendChild(new Functions.createElement({
type : "div",
style : "display:table-cell",
content : "Name",
}));
nameRow.appendChild(new Functions.createElement({
type : "div",
style : "display:table-cell",
content : "<input value='" + project.getName() + "'/>",
}));
var versionRow = new Functions.createElement({
type : "div",
style : "display:table-row"
});
table.appendChild(versionRow);
versionRow.appendChild(new Functions.createElement({
type : "div",
style : "display:table-cell",
content : "Version",
}));
versionRow.appendChild(new Functions.createElement({
type : "div",
style : "display:table-cell",
content : "<input value='" + project.getVersion() + "'/>",
}));
var diseaseRow = new Functions.createElement({
type : "div",
style : "display:table-row"
});
table.appendChild(diseaseRow);
diseaseRow.appendChild(new Functions.createElement({
type : "div",
style : "display:table-cell",
content : "Disease",
}));
var disease = "";
if (project.getDisease() !== undefined) {
disease = project.getDisease().getResource();
}
diseaseRow.appendChild(new Functions.createElement({
type : "div",
style : "display:table-cell",
content : "<input value='" + disease + "'/>",
}));
var organismRow = new Functions.createElement({
type : "div",
style : "display:table-row"
});
table.appendChild(organismRow);
organismRow.appendChild(new Functions.createElement({
type : "div",
style : "display:table-cell",
content : "Organism",
}));
var organism = "";
if (project.getOrganism() !== undefined) {
organism = project.getOrganism().getResource();
}
organismRow.appendChild(new Functions.createElement({
type : "div",
style : "display:table-cell",
content : "<input value='" + organism + "'/>",
}));
var emailRow = new Functions.createElement({
type : "div",
style : "display:table-row"
});
table.appendChild(emailRow);
emailRow.appendChild(new Functions.createElement({
type : "div",
style : "display:table-cell",
content : "Notify email",
}));
var email = "";
if (project.getNotifyEmail() !== undefined) {
email = project.getNotifyEmail();
}
emailRow.appendChild(new Functions.createElement({
type : "div",
style : "display:table-cell",
content : "<input value='" + email + "'/>",
}));
var menuRow = Functions.createElement({
type : "div",
className : "minerva-menu-row",
style : "display:table-row; margin:10px",
});
result.appendChild(menuRow);
var saveProjectButton = Functions.createElement({
type : "button",
name : "saveProject",
content : '<span class="ui-icon ui-icon-disk"></span>&nbsp;SAVE',
onclick : function() {
return self.onSaveClicked().then(null, GuiConnector.alert);
},
});
var cancelButton = Functions.createElement({
type : "button",
name : "cancelProject",
content : '<span class="ui-icon ui-icon-cancel"></span>&nbsp;CANCEL',
onclick : function() {
return self.close();
},
});
menuRow.appendChild(saveProjectButton);
menuRow.appendChild(cancelButton);
return result;
}; };
...@@ -95,7 +248,10 @@ EditProjectDialog.prototype.createOverlaysTab = function(tabMenuDiv, tabContentD ...@@ -95,7 +248,10 @@ EditProjectDialog.prototype.createOverlaysTab = function(tabMenuDiv, tabContentD
}; };
EditProjectDialog.prototype.createOverlaysTabContent = function() { EditProjectDialog.prototype.createOverlaysTabContent = function() {
return Functions.createElement({
type : "div",
content : "Helo"
});
}; };
EditProjectDialog.prototype.createUsersTab = function(tabMenuDiv, tabContentDiv) { EditProjectDialog.prototype.createUsersTab = function(tabMenuDiv, tabContentDiv) {
...@@ -110,7 +266,10 @@ EditProjectDialog.prototype.createUsersTab = function(tabMenuDiv, tabContentDiv) ...@@ -110,7 +266,10 @@ EditProjectDialog.prototype.createUsersTab = function(tabMenuDiv, tabContentDiv)
}; };
EditProjectDialog.prototype.createUsersTabContent = function() { EditProjectDialog.prototype.createUsersTabContent = function() {
return Functions.createElement({
type : "div",
content : "Bye",
});
}; };
EditProjectDialog.prototype.init = function() { EditProjectDialog.prototype.init = function() {
...@@ -132,4 +291,7 @@ EditProjectDialog.prototype.open = function() { ...@@ -132,4 +291,7 @@ EditProjectDialog.prototype.open = function() {
$(div).dialog("open"); $(div).dialog("open");
}; };
EditProjectDialog.prototype.close = function() {
$(this.getElement()).dialog("close");
}
module.exports = EditProjectDialog; module.exports = EditProjectDialog;
...@@ -16,7 +16,7 @@ function MapsAdminPanel(params) { ...@@ -16,7 +16,7 @@ function MapsAdminPanel(params) {
AbstractAdminPanel.call(self, params); AbstractAdminPanel.call(self, params);
self._createGui(); self._createGui();
$(self.getElement()).addClass("projects-tab"); $(self.getElement()).addClass("minerva-projects-tab");
} }
...@@ -46,7 +46,7 @@ MapsAdminPanel.prototype._createMenuRow = function() { ...@@ -46,7 +46,7 @@ MapsAdminPanel.prototype._createMenuRow = function() {
var self = this; var self = this;
var menuRow = Functions.createElement({ var menuRow = Functions.createElement({
type : "div", type : "div",
className : "menu-row", className : "minerva-menu-row",
style : "display:table-row; margin:10px", style : "display:table-row; margin:10px",
}); });
......
...@@ -41,6 +41,7 @@ Project.prototype.loadFromData = function(data) { ...@@ -41,6 +41,7 @@ Project.prototype.loadFromData = function(data) {
self.setDisease(data.disease); self.setDisease(data.disease);
self.setOrganism(data.organism); self.setOrganism(data.organism);
self.setStatus(data.status); self.setStatus(data.status);
self.setNotifyEmail(data.notifyEmail);
self.setProgress(data.progress); self.setProgress(data.progress);
self.callListeners("onreload"); self.callListeners("onreload");
...@@ -59,6 +60,7 @@ Project.prototype.update = function(data) { ...@@ -59,6 +60,7 @@ Project.prototype.update = function(data) {
self.setOrganism(data.getOrganism()); self.setOrganism(data.getOrganism());
self.setStatus(data.getStatus()); self.setStatus(data.getStatus());
self.setProgress(data.getProgress()); self.setProgress(data.getProgress());
self.setNotifyEmail(data.getNotifyEmail());
if (data.getModel() !== undefined) { if (data.getModel() !== undefined) {
self.setModel(new Model(data.getModel())); self.setModel(new Model(data.getModel()));
...@@ -154,4 +156,11 @@ Project.prototype.setProgress = function(progress) { ...@@ -154,4 +156,11 @@ Project.prototype.setProgress = function(progress) {
this._progress = progress; this._progress = progress;
}; };
Project.prototype.getNotifyEmail = function() {
return this._notifyEmail;
};
Project.prototype.setNotifyEmail = function(notifyEmail) {
this._notifyEmail = notifyEmail;
};
module.exports = Project; module.exports = Project;
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