Commit efab5dbc authored by Gradl, Tobias's avatar Gradl, Tobias
Browse files

437: Show result highlight in item view (OPENED)

Task-Url: search#437
parent 4b14145e
......@@ -158,6 +158,7 @@ ResponseHandler.prototype.processResources = function(isShowMore, resultElements
this.elements.resourcesContainer.empty();
return;
}
let query = search.queryHandler.buildQuery(false);
this.elements.resourcesHeading.text(String.format(__translator.translate("~eu.dariah.de.minfba.search.view.result.n_of_m_results"), resultElements.length, totalHits));
......@@ -166,7 +167,7 @@ ResponseHandler.prototype.processResources = function(isShowMore, resultElements
var resultItem = $("<div class='search-results-item d-md-flex flex-row' style='display: none;'>");
this.elements.resourcesContainer.append(resultItem);
this.processResource(i+indexOffset, resultItem, resultElements[i]);
this.processResource(i+indexOffset, resultItem, resultElements[i], query);
resultItem.fadeIn("slow");
}
......@@ -184,7 +185,7 @@ ResponseHandler.prototype.processResources = function(isShowMore, resultElements
ResponseHandler.prototype.processResource = function(index, resultItem, resultElement) {
ResponseHandler.prototype.processResource = function(index, resultItem, resultElement, query) {
// Image container
resultItem.append( "<div class='search-result-image-container' id='search-result-image-container-" + index + "'>" +
"<div class='image-loading-overlay'>" +
......@@ -227,11 +228,20 @@ ResponseHandler.prototype.processResource = function(index, resultItem, resultEl
if (title==undefined || title.length==0) {
title = "<em>" + __translator.translate("~eu.dariah.de.minfba.search.view.result.no_title") + "</em>";
}
itemContainer.append( "<h2 class='search-result-title'>" +
"<a target='_self' href='" + __util.composeUrl("item/" + datamodelId + "/" + resultId + "/") + "'>" +
/*itemContainer.append( "<h2 class='search-result-title'>" +
"<a onclick=\"return false;\" target='_self' href='" + __util.composeUrl("item/" + datamodelId + "/" + resultId + "/") + "'>" +
title +
"<br /><small><i class='fas fa-external-link-square-alt'></i> Detailseite</small></a>" +
"</h2>");
"</h2>");*/
itemContainer.append( "<form method=\"post\" action='" + __util.composeUrl("item/" + datamodelId + "/" + resultId + "/") + "'> <h2 class='search-result-title'>" +
"<a onclick=\"this.closest('form').submit();return false;\" target='_self' href='" + __util.composeUrl("item/" + datamodelId + "/" + resultId + "/") + "'>" +
title +
"<br /><small><i class='fas fa-external-link-square-alt'></i> Detailseite</small></a>" +
"<input type='hidden' name='query' value='" + JSON.stringify(query) + "'>" +
"</h2></form>");
if (objects!=undefined && objects.length>0) {
var innerContainer = $("<div class='search-result-objects'>");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment