exact search for document and item keys on info page

This commit is contained in:
j 2025-10-16 13:07:48 +01:00
commit 776ef3c6c6
2 changed files with 6 additions and 2 deletions

View file

@ -423,8 +423,10 @@ pandora.ui.documentInfoView = function(data, isMixed) {
function formatLink(value, key) {
return (Ox.isArray(value) ? value : [value]).map(function(value) {
var documentKey = Ox.getObjectById(pandora.site.documentKeys, key),
op = documentKey && documentKey.filter ? '==' : '=';
return key
? '<a href="/documents/' + key + '=' + pandora.escapeQueryValue(value) + '">' + value + '</a>'
? '<a href="/documents/' + key + op + pandora.escapeQueryValue(Ox.decodeHTMLEntities(value)) + '">' + value + '</a>'
: value;
}).join(', ');
}

View file

@ -528,10 +528,12 @@ pandora.ui.infoView = function(data, isMixed) {
linkValue = linkValue || value
linkValue = Ox.isArray(linkValue) ? linkValue: [linkValue]
return (Ox.isArray(value) ? value : [value]).map(function(value, idx) {
var itemKey = Ox.getObjectById(pandora.site.itemKeys, key),
op = itemKey && itemKey.filter ? '==' : '=';
return key
? '<a href="/' + (
key == 'alternativeTitles' ? 'title' : key
) + '=' + pandora.escapeQueryValue(Ox.decodeHTMLEntities(linkValue[idx])) + '">' + value + '</a>'
) + op + pandora.escapeQueryValue(Ox.decodeHTMLEntities(linkValue[idx])) + '">' + value + '</a>'
: value;
}).join(Ox.contains(specialListKeys, key) ? '; ' : ', ');
}