Skip to content

Commit

Permalink
fix bugs in download display; show date subjects in metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
ebenenglish committed Jul 16, 2021
1 parent 798460a commit 0e3e4f4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,10 @@
</dd>
<% 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] %>
<dt class="col-md-3"><%= t('blacklight.metadata_display.fields.subject_topic') %>:</dt>
<dd class="col-md-9">
<% %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') %><br />
Expand Down

0 comments on commit 0e3e4f4

Please sign in to comment.