Skip to content

Commit

Permalink
Include link to open the files directly from the search result (for u…
Browse files Browse the repository at this point in the history
…sual search and speech review)

Fixes #1329
  • Loading branch information
aaronhelton committed May 6, 2024
1 parent 27d60e6 commit f6413a7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions dlx_rest/api/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand All @@ -218,6 +223,7 @@ def brief_bib(record):
'types': '; '.join(ctypes),
'agendas': agendas,
'f596': f596,
'files': list(files)
}

def brief_speech(record):
Expand Down
1 change: 1 addition & 0 deletions dlx_rest/static/js/search/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ export let searchcomponent = {
<div class="row" v-for="val in result.f596">
<span class="ml-3">{{val}}</span>
</div>
<div class="row" v-for="f in result.files">{{f}}</div>
</div>
<div class="col-sm-1">
<!-- need to test if authenticated here -->
Expand Down

0 comments on commit f6413a7

Please sign in to comment.