exact search for document and item keys on info page
This commit is contained in:
parent
541aa201bf
commit
776ef3c6c6
2 changed files with 6 additions and 2 deletions
|
|
@ -423,8 +423,10 @@ pandora.ui.documentInfoView = function(data, isMixed) {
|
||||||
|
|
||||||
function formatLink(value, key) {
|
function formatLink(value, key) {
|
||||||
return (Ox.isArray(value) ? value : [value]).map(function(value) {
|
return (Ox.isArray(value) ? value : [value]).map(function(value) {
|
||||||
|
var documentKey = Ox.getObjectById(pandora.site.documentKeys, key),
|
||||||
|
op = documentKey && documentKey.filter ? '==' : '=';
|
||||||
return key
|
return key
|
||||||
? '<a href="/documents/' + key + '=' + pandora.escapeQueryValue(value) + '">' + value + '</a>'
|
? '<a href="/documents/' + key + op + pandora.escapeQueryValue(Ox.decodeHTMLEntities(value)) + '">' + value + '</a>'
|
||||||
: value;
|
: value;
|
||||||
}).join(', ');
|
}).join(', ');
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -528,10 +528,12 @@ pandora.ui.infoView = function(data, isMixed) {
|
||||||
linkValue = linkValue || value
|
linkValue = linkValue || value
|
||||||
linkValue = Ox.isArray(linkValue) ? linkValue: [linkValue]
|
linkValue = Ox.isArray(linkValue) ? linkValue: [linkValue]
|
||||||
return (Ox.isArray(value) ? value : [value]).map(function(value, idx) {
|
return (Ox.isArray(value) ? value : [value]).map(function(value, idx) {
|
||||||
|
var itemKey = Ox.getObjectById(pandora.site.itemKeys, key),
|
||||||
|
op = itemKey && itemKey.filter ? '==' : '=';
|
||||||
return key
|
return key
|
||||||
? '<a href="/' + (
|
? '<a href="/' + (
|
||||||
key == 'alternativeTitles' ? 'title' : key
|
key == 'alternativeTitles' ? 'title' : key
|
||||||
) + '=' + pandora.escapeQueryValue(Ox.decodeHTMLEntities(linkValue[idx])) + '">' + value + '</a>'
|
) + op + pandora.escapeQueryValue(Ox.decodeHTMLEntities(linkValue[idx])) + '">' + value + '</a>'
|
||||||
: value;
|
: value;
|
||||||
}).join(Ox.contains(specialListKeys, key) ? '; ' : ', ');
|
}).join(Ox.contains(specialListKeys, key) ? '; ' : ', ');
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue