From 0e3e4f4ed08e08d975b31d9885e10abbc54ea8bf Mon Sep 17 00:00:00 2001 From: Eben English Date: Fri, 16 Jul 2021 16:53:06 -0400 Subject: [PATCH] fix bugs in download display; show date subjects in metadata --- .../commonwealth_vlr_engine/downloads_helper_behavior.rb | 5 ++++- .../catalog/_show_partials/_show_default_metadata.html.erb | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/app/helpers/commonwealth_vlr_engine/downloads_helper_behavior.rb b/app/helpers/commonwealth_vlr_engine/downloads_helper_behavior.rb index a2c61cd3..56640158 100644 --- a/app/helpers/commonwealth_vlr_engine/downloads_helper_behavior.rb +++ b/app/helpers/commonwealth_vlr_engine/downloads_helper_behavior.rb @@ -170,14 +170,17 @@ def file_download_link(object_pid, link_title, attachments_json, filestream_id, end def file_type_string(filestream_id, attachments_json) + puts "FILE TYPZE called with #{filestream_id}, #{attachments_json}" if attachments_json && attachments_json[filestream_id] file_type_string = if filestream_id == 'access_full' || filestream_id == 'image_access_800' 'JPEG' elsif attachments_json[filestream_id]['content_type'] attachments_json[filestream_id]['content_type'].split('/')[1].upcase else - attachments_json[filestream_id]['filename'].split('.')[1].upcase + filename = attachments_json[filestream_id]['filename'] || attachments_json['filename'] + filename.split('.')[1].upcase end.gsub(/TIFF/, 'TIF') + file_type_string += ', multi-file ZIP' if attachments_json['zip'] else file_type_string = case filestream_id when 'image_primary' diff --git a/app/views/catalog/_show_partials/_show_default_metadata.html.erb b/app/views/catalog/_show_partials/_show_default_metadata.html.erb index 6c2e8951..e1a41335 100644 --- a/app/views/catalog/_show_partials/_show_default_metadata.html.erb +++ b/app/views/catalog/_show_partials/_show_default_metadata.html.erb @@ -144,10 +144,10 @@ <% end %> <%# topic field %> - <% if document[:subject_topic_tsim] || document[:subject_name_tsim] || document[:subject_title_tsim] || document[:subject_temporal_tsim] %> + <% if document[:subject_topic_tsim] || document[:subject_name_tsim] || document[:subject_title_tsim] || document[:subject_temporal_tsim] || document[:subject_date_tsim] %>
<%= t('blacklight.metadata_display.fields.subject_topic') %>:
- <% %i[subject_topic_tsim subject_name_tsim subject_title_tsim subject_temporal_tsim].each do |skey| %> + <% %i[subject_topic_tsim subject_name_tsim subject_title_tsim subject_temporal_tsim subject_date_tsim].each do |skey| %> <% if document[skey] %> <% document[skey].each do |s| %> <%= link_to_facet(s, 'subject_facet_ssim') %>