From f6413a70f5345ccd5ad903975db8e2171d39069d Mon Sep 17 00:00:00 2001 From: Aaron Helton Date: Mon, 6 May 2024 16:07:24 -0400 Subject: [PATCH] Include link to open the files directly from the search result (for usual search and speech review) Fixes #1329 --- dlx_rest/api/utils.py | 6 ++++++ dlx_rest/static/js/search/search.js | 1 + 2 files changed, 7 insertions(+) diff --git a/dlx_rest/api/utils.py b/dlx_rest/api/utils.py index 62f96928..0914239e 100644 --- a/dlx_rest/api/utils.py +++ b/dlx_rest/api/utils.py @@ -209,6 +209,11 @@ def brief_bib(record): agendas = [' '.join(field.get_values('a', 'b', 'c','d')) for field in record.get_fields('991')] f596 = [' '.join(field.get_values('a')) for field in record.get_fields('596')] + # Get the list of files + files = [] + if record.files: + files = record.files + return { '_id': record.id, 'url': URL('api_record', collection='bibs', record_id=record.id).to_str(), @@ -218,6 +223,7 @@ def brief_bib(record): 'types': '; '.join(ctypes), 'agendas': agendas, 'f596': f596, + 'files': list(files) } def brief_speech(record): diff --git a/dlx_rest/static/js/search/search.js b/dlx_rest/static/js/search/search.js index 99f4d854..c2e2c9f8 100644 --- a/dlx_rest/static/js/search/search.js +++ b/dlx_rest/static/js/search/search.js @@ -189,6 +189,7 @@ export let searchcomponent = {
{{val}}
+
{{f}}