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

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

SVN: 34255
parent fdda7ee3
No related branches found
No related tags found
No related merge requests found
...@@ -57,29 +57,27 @@ var PrintUtil = new function() { ...@@ -57,29 +57,27 @@ var PrintUtil = new function() {
} }
this.getTable = function(entity, isNotTransparent, optionalTitle, customClass, extraCustomId, extraContent) { this.getTable = function(entity, isNotTransparent, optionalTitle, customClass, extraCustomId, extraContent) {
var defaultColor = null; var $newInspector = $("<div>");
if(isNotTransparent) { if(isNotTransparent) {
defaultColor = "#FBFBFB"; $newInspector.css("background-color", "#FBFBFB");
} else { } else {
defaultColor = "transparent" $newInspector.css("background-color", "transparent");
} }
var inspector = "";
$newInspector.addClass("inspector");
var inspectorClass = 'inspector';
if(customClass) { if(customClass) {
inspectorClass += ' ' + customClass; $newInspector.addClass(customClass);
} }
inspector += "<div class='" + inspectorClass + "' style='background-color:" + defaultColor + ";' >";
if(optionalTitle) { if(optionalTitle) {
inspector += optionalTitle; $newInspector.append(optionalTitle);
} else { } else {
inspector += "<strong>" + entity.code + "</strong>"; $newInspector.append($("<strong>").append(entity.code));
} }
inspector += "<table id='" + entity.permId +"_TOOGLE' class='properties table table-condensed'>" var $newInspectorTable = $("<table>", { "class" : "properties table table-condensed" });
$newInspector.append($newInspectorTable);
//Show Properties following the order given on openBIS //Show Properties following the order given on openBIS
var sampleTypePropertiesCode = profile.getAllPropertiCodesForTypeCode(entity.sampleTypeCode); var sampleTypePropertiesCode = profile.getAllPropertiCodesForTypeCode(entity.sampleTypeCode);
...@@ -109,57 +107,59 @@ var PrintUtil = new function() { ...@@ -109,57 +107,59 @@ var PrintUtil = new function() {
if(propertyContent !== "") { if(propertyContent !== "") {
propertyContent = Util.replaceURLWithHTMLLinks(propertyContent); propertyContent = Util.replaceURLWithHTMLLinks(propertyContent);
inspector += "<tr>";
if(isSingleColumn) { if(isSingleColumn) {
inspector += "<td class='property' colspan='2'>"+propertyLabel+"<br />"+propertyContent+"</td>"; $newInspectorTable
.append($("<tr>")
.append($("<td>", { "class" : "property", "colspan" : "2" }).append($("<p>", { "class" : "inspectorLineBreak"}).append(propertyLabel).append("<br>").append(propertyContent)))
);
} else { } else {
inspector += "<td class='property'>"+propertyLabel+"</td>"; $newInspectorTable
inspector += "<td class='property'><p class='inspectorLineBreak'>"+propertyContent+"</p></td>"; .append($("<tr>")
.append($("<td>", { "class" : "property", "colspan" : "1" }).append($("<p>", { "class" : ""}).append(propertyLabel)))
.append($("<td>", { "class" : "property", "colspan" : "1" }).append($("<p>", { "class" : "inspectorLineBreak"}).append(propertyContent)))
);
} }
inspector += "</tr>";
} }
} }
//Show Parent Codes //Show Parent Codes
var allParentCodesAsText = this.getParentsChildrenText(entity.parents); var allParentCodesAsText = this.getParentsChildrenText(entity.parents);
if(allParentCodesAsText.length > 0) { if(allParentCodesAsText.length > 0) {
inspector += "<tr>"; $newInspectorTable
inspector += "<td class='property'>Parents</td>"; .append($("<tr>")
inspector += "<td class='property'>"+allParentCodesAsText+"</td>"; .append($("<td>", { "class" : "property", "colspan" : "1" }).append($("<p>", { "class" : ""}).append("Parents")))
inspector += "</tr>"; .append($("<td>", { "class" : "property", "colspan" : "1" }).append($("<p>", { "class" : "inspectorLineBreak"}).append(allParentCodesAsText)))
);
} }
//Show Children Codes //Show Children Codes
var allChildrenCodesAsText = this.getParentsChildrenText(entity.children); var allChildrenCodesAsText = this.getParentsChildrenText(entity.children);
if(allChildrenCodesAsText.length > 0) { if(allChildrenCodesAsText.length > 0) {
inspector += "<tr>"; $newInspectorTable
inspector += "<td class='property'>Children</td>"; .append($("<tr>")
inspector += "<td class='property'>"+allChildrenCodesAsText+"</td>"; .append($("<td>", { "class" : "property", "colspan" : "1" }).append($("<p>", { "class" : ""}).append("Children")))
inspector += "</tr>"; .append($("<td>", { "class" : "property", "colspan" : "1" }).append($("<p>", { "class" : "inspectorLineBreak"}).append(allChildrenCodesAsText)))
);
} }
//Show Modification Date //Show Modification Date
inspector += "<tr>"; $newInspectorTable
inspector += "<td class='property'>Modification Date</td>"; .append($("<tr>")
inspector += "<td class='property'>"+new Date(entity.registrationDetails["modificationDate"])+"</td>"; .append($("<td>", { "class" : "property", "colspan" : "1" }).append($("<p>", { "class" : ""}).append("Modification Date")))
inspector += "</tr>"; .append($("<td>", { "class" : "property", "colspan" : "1" }).append($("<p>", { "class" : "inspectorLineBreak"}).append(new Date(entity.registrationDetails["modificationDate"]))))
);
//Show Creation Date //Show Creation Date
inspector += "<tr>"; $newInspectorTable
inspector += "<td class='property'>Registration Date</td>"; .append($("<tr>")
inspector += "<td class='property'>"+new Date(entity.registrationDetails["registrationDate"])+"</td>"; .append($("<td>", { "class" : "property", "colspan" : "1" }).append($("<p>", { "class" : ""}).append("Registration Date")))
inspector += "</tr>"; .append($("<td>", { "class" : "property", "colspan" : "1" }).append($("<p>", { "class" : "inspectorLineBreak"}).append(new Date(entity.registrationDetails["registrationDate"]))))
);
inspector += "</table>"
if(extraCustomId && extraContent) { if(extraCustomId && extraContent) {
inspector += "<div class='inspectorExtra' id='"+ extraCustomId + "'>" + extraContent + "</div>"; $newInspector.append($("<div>", { "class" : "inspectorExtra", "id" : extraCustomId}).append(extraContent));
} }
inspector += "</div>" return $newInspector;
return inspector;
} }
} }
\ No newline at end of file
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