diff --git a/plasmid/source/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/SampleForm/SampleFormController.js b/plasmid/source/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/SampleForm/SampleFormController.js index 01003c24771be78eeef96db63142973035db87b8..e2431f2689788428238f55a2604942ca56afc666 100644 --- a/plasmid/source/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/SampleForm/SampleFormController.js +++ b/plasmid/source/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/SampleForm/SampleFormController.js @@ -33,10 +33,12 @@ function SampleFormController(mainController, mode, sample) { //Load view _this._sampleFormView.repaint($container); + Util.unblockUI(); }); } else { //Load view _this._sampleFormView.repaint($container); + Util.unblockUI(); } } diff --git a/plasmid/source/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/SampleForm/SampleFormView.js b/plasmid/source/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/SampleForm/SampleFormView.js index 5ae5fb5eb1405cb73620f53a64e1d3552dd5fb3c..5b34aeeb0b41b637f0f4e43d096118adca237f59 100644 --- a/plasmid/source/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/SampleForm/SampleFormView.js +++ b/plasmid/source/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/SampleForm/SampleFormView.js @@ -72,12 +72,34 @@ function SampleFormView(sampleFormController, sampleFormModel) { // var $formTitle = $("<div>"); var nameLabel = this._sampleFormModel.sample.properties[profile.propertyReplacingCode]; - var entityPath = null; + var entityPath = $("<span>"); + + + var codeWithContainer = this._sampleFormModel.sample.code; + if(this._sampleFormModel.mode !== FormMode.CREATE) { + var containerIdentifierEnd = this._sampleFormModel.sample.identifier.lastIndexOf(":"); + if(containerIdentifierEnd !== -1) { + var containerCodeStart = this._sampleFormModel.sample.identifier.lastIndexOf("/") + 1; + var codeWithContainerParts = this._sampleFormModel.sample.identifier.substring(containerCodeStart).split(":"); + var containerCode = codeWithContainerParts[0]; + var containerCodeLink = $("<a>", { "class" : "browser-compatible-javascript-link" }).append(containerCode); + containerCodeLink.click(function() { + Util.blockUI(); + var containerIdentifier = _this._sampleFormModel.sample.identifier.substring(0, containerIdentifierEnd); + mainController.serverFacade.searchWithIdentifiers([containerIdentifier], function(containerSample) { + mainController.changeView("showViewSamplePageFromPermId", containerSample[0].permId); + }); + }); + codeWithContainer = $("<span>").append(containerCodeLink).append(":").append(codeWithContainerParts[1]); + } + } + if(this._sampleFormModel.sample.experimentIdentifierOrNull) { - entityPath = this._sampleFormModel.sample.experimentIdentifierOrNull + "/" + this._sampleFormModel.sample.code; + entityPath.append(this._sampleFormModel.sample.experimentIdentifierOrNull).append("/").append(codeWithContainer); } else { - entityPath = this._sampleFormModel.sample.identifier; + entityPath.append("/").append(this._sampleFormModel.sample.spaceCode).append("/").append(codeWithContainer); } + var isName = (nameLabel)?true:false; var title = null; @@ -100,11 +122,10 @@ function SampleFormView(sampleFormController, sampleFormModel) { .append($("<h4>", { "style" : "font-weight:normal;" } ).append(entityPath)); } else { if(this._sampleFormModel.mode !== FormMode.CREATE) { - title += entityPath; + $formTitle.append($("<h2>").append(title).append(entityPath)); + } else { + $formTitle.append($("<h2>").append(title)); } - - $formTitle - .append($("<h2>").append(title)); } //