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

SSDM-1959 : Show gene name instead of gene number in ELN plate hierarchy view

SVN: 34248
parent 73251738
No related branches found
No related tags found
No related merge requests found
...@@ -289,10 +289,6 @@ h1, h2, legend { ...@@ -289,10 +289,6 @@ h1, h2, legend {
float:left; float:left;
} }
.inspector {
margin: 10px 10px 10px 10px;
}
.inspectorLineBreak { .inspectorLineBreak {
word-wrap: break-word; word-wrap: break-word;
width:300px; width:300px;
...@@ -302,7 +298,7 @@ div.inspectorWhiteFont { ...@@ -302,7 +298,7 @@ div.inspectorWhiteFont {
color: white !important; color: white !important;
} }
div.inspectorCondensed { div.inspector {
text-decoration: none; text-decoration: none;
color: #000; color: #000;
display: block; display: block;
...@@ -311,54 +307,12 @@ div.inspectorCondensed { ...@@ -311,54 +307,12 @@ div.inspectorCondensed {
border-radius: 10px; border-radius: 10px;
} }
div.inspectorCondensed > .table th, div.inspector > .table th,
div.inspectorCondensed > .table td { div.inspector > .table td {
border-top: none; border-top: none;
line-height: 12px; line-height: 12px;
} }
div.inspector > table {
width: 400px;
}
div.inspector {
text-decoration: none;
color: #000;
display: block;
width: 400px;
overflow: hidden;
padding: 0.5em;
-moz-box-shadow: 5px 5px 7px rgba(33,33,33,1);
-webkit-box-shadow: 5px 5px 7px rgba(33,33,33,.7);
box-shadow: 5px 5px 7px rgba(33,33,33,.7);
/*
-o-transform: rotate(1deg);
-webkit-transform: rotate(1deg);
-moz-transform: rotate(1deg);
*/
position: relative;
/*
-moz-transition:-moz-transform .15s linear;
-o-transition:-o-transform .15s linear;
-webkit-transition:-webkit-transform .15s linear;
*/
}
div.inspector:hover,div.inspector:focus{
/*
box-shadow:10px 10px 7px rgba(0,0,0,.7);
-moz-box-shadow:10px 10px 7px rgba(0,0,0,.7);
-webkit-box-shadow: 10px 10px 7px rgba(0,0,0,.7);
-webkit-transform: scale(1.25);
-moz-transform: scale(1.25);
-o-transform: scale(1.25);
*/
position:relative;
z-index:5;
}
.inspectorExtra { .inspectorExtra {
margin-left: 0px !important; margin-left: 0px !important;
} }
......
...@@ -19,20 +19,13 @@ var PrintUtil = new function() { ...@@ -19,20 +19,13 @@ var PrintUtil = new function() {
this.printSample = function(sample) { this.printSample = function(sample) {
var newWindow = window.open(undefined,"print " + sample.permId); var newWindow = window.open(undefined,"print " + sample.permId);
var pageToPrint = $("<html>")
var pageToPrint = ""; .append($("<head>"))
pageToPrint += "<html>"; .append($("<body>").append(this.getTable(sample)));
pageToPrint += "<head>";
pageToPrint += "</head>";
pageToPrint += "<body stlye='font-family: '\"'Helvetica Neue\",Helvetica,Arial,sans-serif;'>";
pageToPrint += this.getTable(sample, false, false, false);
pageToPrint += "</body>";
pageToPrint += "</html>";
$(newWindow.document.body).html(pageToPrint); $(newWindow.document.body).html(pageToPrint);
} }
this.getParentsChildrenText = function(parentsChildrenList, withLinks) { this.getParentsChildrenText = function(parentsChildrenList) {
var allParentCodesByType = {}; var allParentCodesByType = {};
if(parentsChildrenList) { if(parentsChildrenList) {
...@@ -59,11 +52,7 @@ var PrintUtil = new function() { ...@@ -59,11 +52,7 @@ var PrintUtil = new function() {
var parents = allParentCodesByType[sampleType]; var parents = allParentCodesByType[sampleType];
for(var i = 0; i < parents.length; i++) { for(var i = 0; i < parents.length; i++) {
var parent = parents[i]; var parent = parents[i];
if(withLinks) { allParentCodesAsText += parent.code + " ";
allParentCodesAsText += "<a href=\"javascript:mainController.inspector.showSampleOnInspector('" + parent.permId + "');\">" + parent.code + "</a> ";
} else {
allParentCodesAsText += parent.code + " ";
}
} }
allParentCodesAsText += "</br>"; allParentCodesAsText += "</br>";
} }
...@@ -71,56 +60,30 @@ var PrintUtil = new function() { ...@@ -71,56 +60,30 @@ var PrintUtil = new function() {
return allParentCodesAsText; return allParentCodesAsText;
} }
this.getTable = function(entity, showClose, withColors, withLinks, optionalTitle, isCondensed, customClass, extraCustomId, extraContent) { this.getTable = function(entity, isNotTransparent, optionalTitle, customClass, extraCustomId, extraContent) {
var defaultColor = null; var defaultColor = null;
if(!withColors) { if(isNotTransparent) {
defaultColor = "transparent"
} else {
defaultColor = "#FBFBFB"; defaultColor = "#FBFBFB";
} else {
defaultColor = "transparent"
} }
var inspector = ""; var inspector = "";
var divID = entity.sampleTypeCode + "_" + entity.code + "_INSPECTOR"; var divID = entity.sampleTypeCode + "_" + entity.code + "_INSPECTOR";
var inspectorClass = null; var inspectorClass = 'inspector';
if(isCondensed) {
inspectorClass = 'inspectorCondensed';
} else {
inspectorClass = 'inspector';
}
if(customClass) { if(customClass) {
inspectorClass += ' ' + customClass; inspectorClass += ' ' + customClass;
} }
inspector += "<div id='"+divID+"' class='" + inspectorClass + "' style='background-color:" + defaultColor + ";' >"; inspector += "<div id='"+divID+"' class='" + inspectorClass + "' style='background-color:" + defaultColor + ";' >";
if(showClose) {
var removeButton = "<span class='btn inspectorToolbar btn-default' style='float:left; margin: 2px' onclick='mainController.inspector.closeNewInspector(\""+entity.id+"\")'><i class='glyphicon glyphicon-remove'></i></span>";
inspector += removeButton;
}
if(withLinks) {
var toogleButton = "<span class='btn inspectorToolbar btn-default' style='float:left; margin: 2px' onclick='mainController.inspector.toogleInspector(\""+entity.permId+"_TOOGLE\")'><i id='"+entity.permId+"_TOOGLE_ICON' class='glyphicon glyphicon-chevron-up'></i></span>";
inspector += toogleButton;
}
if(optionalTitle) { if(optionalTitle) {
inspector += optionalTitle; inspector += optionalTitle;
} else { } else {
inspector += "<strong>" + entity.code + "</strong>"; inspector += "<strong>" + entity.code + "</strong>";
} }
if(withLinks) {
var printButton = "<span class='btn btn-default inspectorToolbar' style='float:right; margin: 2px;' onclick='javascript:mainController.inspector.printInspector(\""+entity.permId+"\")'><i class='glyphicon glyphicon-print'></i></span>";
inspector += printButton;
var viewButton = "<span class='btn btn-default inspectorToolbar' style='float:right; margin: 2px' onclick='javascript:mainController.changeView(\"showViewSamplePageFromPermId\",\""+entity.permId+"\")'><i class='glyphicon glyphicon-edit'></i></span>";
inspector += viewButton;
var hierarchyButton = "<span class='btn btn-default inspectorToolbar' style='float:right; margin: 2px' onclick=\"javascript:mainController.changeView('showSampleHierarchyPage','"+entity.permId+"');\"><img src='./img/hierarchy-icon.png' style='width:16px; height:17px;' /></span>";
inspector += hierarchyButton;
}
inspector += "<table id='" + entity.permId +"_TOOGLE' class='properties table table-condensed'>" inspector += "<table id='" + entity.permId +"_TOOGLE' class='properties table table-condensed'>"
//Show Properties following the order given on openBIS //Show Properties following the order given on openBIS
...@@ -207,7 +170,7 @@ var PrintUtil = new function() { ...@@ -207,7 +170,7 @@ var PrintUtil = new function() {
} }
//Show Parent Codes //Show Parent Codes
var allParentCodesAsText = this.getParentsChildrenText(entity.parents, withLinks); var allParentCodesAsText = this.getParentsChildrenText(entity.parents);
if(allParentCodesAsText.length > 0) { if(allParentCodesAsText.length > 0) {
inspector += "<tr>"; inspector += "<tr>";
inspector += "<td class='property'>Parents</td>"; inspector += "<td class='property'>Parents</td>";
...@@ -216,7 +179,7 @@ var PrintUtil = new function() { ...@@ -216,7 +179,7 @@ var PrintUtil = new function() {
} }
//Show Children Codes //Show Children Codes
var allChildrenCodesAsText = this.getParentsChildrenText(entity.children, withLinks); var allChildrenCodesAsText = this.getParentsChildrenText(entity.children);
if(allChildrenCodesAsText.length > 0) { if(allChildrenCodesAsText.length > 0) {
inspector += "<tr>"; inspector += "<tr>";
inspector += "<td class='property'>Children</td>"; inspector += "<td class='property'>Children</td>";
......
...@@ -63,7 +63,7 @@ function PlateView(plateController, plateModel) { ...@@ -63,7 +63,7 @@ function PlateView(plateController, plateModel) {
$cell = $("<td>").append("&nbsp;"); $cell = $("<td>").append("&nbsp;");
if(well) { if(well) {
$cell.addClass('well'); $cell.addClass('well');
var tooltip = PrintUtil.getTable(well, false, false, false, well.code, true, 'inspectorWhiteFont'); var tooltip = PrintUtil.getTable(well, false, well.code, 'inspectorWhiteFont');
$cell.tooltipster({ $cell.tooltipster({
content: $(tooltip), content: $(tooltip),
interactive: true interactive: true
......
...@@ -338,7 +338,7 @@ function SampleHierarchy(serverFacade, containerId, profile, sample) { ...@@ -338,7 +338,7 @@ function SampleHierarchy(serverFacade, containerId, profile, sample) {
extraCustomId = plateController.getPlaceHolderId(); extraCustomId = plateController.getPlaceHolderId();
plateController.initWithPlaceHolder(); plateController.initWithPlaceHolder();
} }
var $graphTable = PrintUtil.getTable(sample, false, true, false, title, true, null, extraCustomId, extraContent); var $graphTable = PrintUtil.getTable(sample, true, title, null, extraCustomId, extraContent);
$nodeContent.empty(); $nodeContent.empty();
$nodeContent.css({ $nodeContent.css({
......
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