In the below example a text is added to the preview, if the asset is assigned a defined rights template. The background is also made red, should the template have been manually modifed. The code can be expanded, by copying, inserting and adjusting the corresponding code.
var style = "<style> .ux-explorerview-custom-medium, .ux-explorerview-custom-small, .ux-explorerview-custom-large {width:100%!important;} </style>";
var divEnd = "</span></div>";
PP.common.Tpl.setCustomRenderer(function(values, thumbSize) {
var custBgColor = "";
if(values.IsAssetRightTemplateOverridden == "1") {
custBgColor = "background:rgba(204,0,0,0.6);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#6Fcc0000,endColorstr=#6Fcc0000);";
custBorderColor = "aa1919";
custFontColor = "ffffff";
}
else {
custBgColor = "background:rgba(227,227,227,0.6);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#6Fe3e3e3,endColorstr=#6Fe3e3e3);";
custBorderColor = "999999";
custFontColor = "000000";
}
var divStart = "<div style='position:absolute;width:100%;height:15px;border-bottom:1px solid #" + custBorderColor + ";text-align:right;padding-top:1px;font-weight:bold;" + custBgColor + "color:#" + custFontColor + ";'><span style='padding-right:10px'>";
if(values.AppliedAssetRightTemplateId == "Archived") {
return style + divStart + 'Archived' + divEnd;
}
else {
return '';
}
});
|