Skip to content
Snippets Groups Projects
Commit dd161827 authored by juanf's avatar juanf
Browse files

SSDM-616: Add ability to create Projects in the ELN (Basic Space form)

SVN: 32112
parent 8da9afba
No related branches found
No related tags found
No related merge requests found
...@@ -104,6 +104,11 @@ ...@@ -104,6 +104,11 @@
<script type="text/javascript" src="./js/views/Examine/ExamineModel.js"></script> <script type="text/javascript" src="./js/views/Examine/ExamineModel.js"></script>
<script type="text/javascript" src="./js/views/Examine/ExamineView.js"></script> <script type="text/javascript" src="./js/views/Examine/ExamineView.js"></script>
--> -->
<script type="text/javascript" src="./js/views/SpaceForm/SpaceFormController.js"></script>
<script type="text/javascript" src="./js/views/SpaceForm/SpaceFormModel.js"></script>
<script type="text/javascript" src="./js/views/SpaceForm/SpaceFormView.js"></script>
<script type="text/javascript" src="./js/views/ProjectForm/ProjectFormController.js"></script> <script type="text/javascript" src="./js/views/ProjectForm/ProjectFormController.js"></script>
<script type="text/javascript" src="./js/views/ProjectForm/ProjectFormModel.js"></script> <script type="text/javascript" src="./js/views/ProjectForm/ProjectFormModel.js"></script>
<script type="text/javascript" src="./js/views/ProjectForm/ProjectFormView.js"></script> <script type="text/javascript" src="./js/views/ProjectForm/ProjectFormView.js"></script>
......
...@@ -186,6 +186,14 @@ function MainController(profile) { ...@@ -186,6 +186,14 @@ function MainController(profile) {
this._showSearchPage(arg); this._showSearchPage(arg);
window.scrollTo(0,0); window.scrollTo(0,0);
break; break;
case "showSpacePage":
var _this = this;
this.serverFacade.getSpaceFromCode(arg, function(space) {
document.title = "Space " + space.code;
_this._showSpacePage(space);
window.scrollTo(0,0);
});
break;
case "showProjectPageFromIdentifier": case "showProjectPageFromIdentifier":
var _this = this; var _this = this;
this.serverFacade.getProjectFromIdentifier(arg, function(project) { this.serverFacade.getProjectFromIdentifier(arg, function(project) {
...@@ -406,6 +414,13 @@ function MainController(profile) { ...@@ -406,6 +414,13 @@ function MainController(profile) {
}); });
} }
this._showSpacePage = function(space) {
//Show Form
var spaceFormController = new SpaceFormController(this, space);
spaceFormController.init($("#mainContainer"));
this.currentView = spaceFormController;
}
this._showCreateProjectPage = function(spaceCode) { this._showCreateProjectPage = function(spaceCode) {
//Show Form //Show Form
var projectFormController = new ProjectFormController(this, FormMode.CREATE, {spaceCode : spaceCode}); var projectFormController = new ProjectFormController(this, FormMode.CREATE, {spaceCode : spaceCode});
......
...@@ -65,6 +65,16 @@ function ServerFacade(openbisServer) { ...@@ -65,6 +65,16 @@ function ServerFacade(openbisServer) {
this.openbisServer.listSpacesWithProjectsAndRoleAssignments(somethingOrNull, callbackFunction); this.openbisServer.listSpacesWithProjectsAndRoleAssignments(somethingOrNull, callbackFunction);
} }
this.getSpaceFromCode = function(spaceCode, callbackFunction) {
this.openbisServer.listSpacesWithProjectsAndRoleAssignments(null, function(data) {
data.result.forEach(function(space){
if(space.code === spaceCode) {
callbackFunction(space);
}
});
});
}
this.listExperiments = function(projects, callbackFunction) { this.listExperiments = function(projects, callbackFunction) {
this.openbisServer.listExperiments(projects, null, callbackFunction); this.openbisServer.listExperiments(projects, null, callbackFunction);
} }
......
/*
* Copyright 2014 ETH Zuerich, Scientific IT Services
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
function SpaceFormController(mainController, space) {
this._mainController = mainController;
this._spaceFormModel = new SpaceFormModel(space);
this._spaceFormView = new SpaceFormView(this, this._spaceFormModel);
this.init = function($container) {
this._spaceFormView.repaint($container);
}
}
\ No newline at end of file
/*
* Copyright 2014 ETH Zuerich, Scientific IT Services
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
function SpaceFormModel(space) {
this.space = space;
}
\ No newline at end of file
/*
* Copyright 2014 ETH Zuerich, Scientific IT Services
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
function SpaceFormView(spaceFormController, spaceFormModel) {
this._spaceFormController = spaceFormController;
this._spaceFormModel = spaceFormModel;
this.repaint = function($container) {
var _this = this;
$container.empty();
var $form = $("<div>", { "class" : "form-horizontal row"});
var $formColumn = $("<div>", { "class" : FormUtil.formColumClass });
$form.append($formColumn);
var $formTitle = $("<h2>").append("Space " + this._spaceFormModel.space.code);
$formColumn.append($formTitle);
$container.append($form);
}
}
\ No newline at end of file
...@@ -158,7 +158,7 @@ function SideMenuWidget(mainController, containerId, serverFacade) { ...@@ -158,7 +158,7 @@ function SideMenuWidget(mainController, containerId, serverFacade) {
var newMenuIfSelectedSpace = { var newMenuIfSelectedSpace = {
children : [] children : []
} }
var menuItemSpace = new SideMenuWidgetComponent(true, false, space.code, _this._menuStructure, newMenuIfSelectedSpace, 'showBlancPage', null, "(Space)"); var menuItemSpace = new SideMenuWidgetComponent(true, false, space.code, _this._menuStructure, newMenuIfSelectedSpace, 'showSpacePage', space.code, "(Space)");
_this._menuStructure.newMenuIfSelected.children.push(menuItemSpace); _this._menuStructure.newMenuIfSelected.children.push(menuItemSpace);
//Fill Projects //Fill Projects
......
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