From 5a4aa09f91b79718eb1c11cadc534c3bfff988ec Mon Sep 17 00:00:00 2001
From: juanf <juanf>
Date: Thu, 21 May 2015 09:41:13 +0000
Subject: [PATCH] SSDM-1935 : ELN: Warning on deleting samples - More
 pronounced

SVN: 34020
---
 .../1/as/webapps/eln-lims/html/js/util/FormUtil.js         | 7 ++++++-
 .../eln-lims/html/js/views/SampleForm/SampleFormView.js    | 6 +++---
 .../html/js/views/SampleForm/widgets/DeleteEntityView.js   | 4 +++-
 3 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/plasmid/source/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/util/FormUtil.js b/plasmid/source/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/util/FormUtil.js
index def7673948a..6d85747ac8c 100644
--- a/plasmid/source/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/util/FormUtil.js
+++ b/plasmid/source/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/util/FormUtil.js
@@ -319,7 +319,12 @@ var FormUtil = new function() {
 		var $fieldset = $('<div>');
 		
 		var $controlGroup = $('<div>', {class : 'form-group'});
-		var $controlLabel = $('<label>', {class : 'control-label ' + this.labelColumnClass}).text(label + ":");
+		
+		var $controlLabel = $('<label>', {class : 'control-label ' + this.labelColumnClass});
+		if(label) {
+			$controlLabel.text(label + ":");
+		}
+		
 		var $controls = $('<div>', {class : 'controls ' + this.controlColumnClass });
 		
 		$controlGroup.append($controlLabel);
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 bde8e78bdaf..963ae4dc116 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
@@ -69,9 +69,9 @@ function SampleFormView(sampleFormController, sampleFormModel) {
 			//Delete
 			var warningText = null;
 			if(this._sampleFormModel.sample.children.length > 0 || this._sampleFormModel.datasets.length > 0) {
-				warningText = ''
+				warningText = ""
 				if(this._sampleFormModel.sample.children.length > 0) {
-					warningText += "\n- The sample has " + this._sampleFormModel.sample.children.length + " children samples, these relationships will be broken but the children will remain:";
+					warningText += "The sample has " + this._sampleFormModel.sample.children.length + " children samples, these relationships will be broken but the children will remain:";
 					var numChildrenToShow = this._sampleFormModel.sample.children.length;
 					if(numChildrenToShow > 10) {
 						numChildrenToShow = 10;
@@ -84,7 +84,7 @@ function SampleFormView(sampleFormController, sampleFormModel) {
 					}
 				}
 				if(this._sampleFormModel.datasets.length > 0) {
-					warningText += "\n- The sample has " + this._sampleFormModel.datasets.length + " datasets, these will be deleted with the sample:";
+					warningText += "\nThe sample has " + this._sampleFormModel.datasets.length + " datasets, these will be deleted with the sample:";
 					var numDatasetsToShow = this._sampleFormModel.datasets.length;
 					if(numDatasetsToShow > 10) {
 						numDatasetsToShow = 10;
diff --git a/plasmid/source/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/SampleForm/widgets/DeleteEntityView.js b/plasmid/source/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/SampleForm/widgets/DeleteEntityView.js
index c5a25ab08fe..31a89066db6 100644
--- a/plasmid/source/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/SampleForm/widgets/DeleteEntityView.js
+++ b/plasmid/source/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/SampleForm/widgets/DeleteEntityView.js
@@ -28,7 +28,9 @@ function DeleteEntityView(deleteEntityController, deleteEntityModel) {
 		
 		$window.append($('<legend>').append('Confirm Delete'));
 		if(this._deleteEntityModel.warningText) {
-			$window.append(FormUtil.getFieldForLabelWithText("Warning", this._deleteEntityModel.warningText));
+			var $warning = FormUtil.getFieldForLabelWithText(null, this._deleteEntityModel.warningText);
+			$warning.css('color', '#e71616');
+			$window.append($warning);
 		}
 		
 		if(this._deleteEntityModel.includeReason) {
-- 
GitLab