diff --git a/app/assets/stylesheets/blacklight.scss b/app/assets/stylesheets/blacklight.scss index 0615b155f4..3729d2fee0 100644 --- a/app/assets/stylesheets/blacklight.scss +++ b/app/assets/stylesheets/blacklight.scss @@ -65,4 +65,4 @@ img.no-icon { .page-item span.page-link { color: $dark !important; -} +} \ No newline at end of file diff --git a/app/controllers/catalog_controller.rb b/app/controllers/catalog_controller.rb index 034dce9938..19eb71c8e9 100644 --- a/app/controllers/catalog_controller.rb +++ b/app/controllers/catalog_controller.rb @@ -115,7 +115,8 @@ class CatalogController < ApplicationController # solr fields to be displayed in the index (search results) view # The ordering of the field names is the order of the display config.add_index_field 'title_tesi', label: 'Title', if: Proc.new {|context, _field_config, _document| context.request.format == :json } - config.add_index_field 'date_issued_ssi', label: 'Date', helper_method: :combined_display_date + config.add_index_field 'date_issued_ssi', label: 'Date', if: Proc.new {|_context, _field_config, document| document[:date_issued_ssi].present? } + config.add_index_field 'date_created_ssi', label: 'Date', if: Proc.new {|_context, _field_config, document| document[:date_created_ssi].present? && document[:date_issued_ssi].blank? } config.add_index_field 'creator_ssim', label: 'Main contributors', helper_method: :contributor_index_display config.add_index_field 'abstract_ssi', label: 'Summary', helper_method: :description_index_display config.add_index_field 'duration_ssi', label: 'Duration', if: Proc.new {|context, _field_config, _document| context.request.format == :json } diff --git a/app/helpers/media_objects_helper.rb b/app/helpers/media_objects_helper.rb index 04b0d60968..9ca5edd012 100644 --- a/app/helpers/media_objects_helper.rb +++ b/app/helpers/media_objects_helper.rb @@ -51,18 +51,6 @@ def dropbox_url collection ic.iconv(url) end - def combined_display_date media_object - (issued,created) = case media_object - when MediaObject, SpeedyAF::Proxy::MediaObject - [media_object.date_issued, media_object.date_created] - when Hash - [media_object[:document]['date_issued_ssi'], media_object[:document]['date_created_ssi']] - end - result = issued - result += " (Creation date: #{created})" if created.present? - result - end - def display_other_identifiers media_object # bibliographic_id has form [:type,"value"], other_identifier has form [[:type,"value],[:type,"value"],...] ids = media_object.bibliographic_id.present? ? [media_object.bibliographic_id] : [] diff --git a/app/models/iiif_manifest_presenter.rb b/app/models/iiif_manifest_presenter.rb index 3f03adce6b..4dc0f1819d 100644 --- a/app/models/iiif_manifest_presenter.rb +++ b/app/models/iiif_manifest_presenter.rb @@ -189,7 +189,8 @@ def display_lending_period(media_object) def iiif_metadata_fields fields = [ metadata_field('Title', media_object.title, media_object.id), - metadata_field('Date', combined_display_date(media_object), 'Not provided'), + metadata_field('Publication date', media_object.date_issued), + metadata_field('Creation date', media_object.date_created), metadata_field('Main contributor', media_object.creator), metadata_field('Summary', display_summary(media_object)), metadata_field('Contributor', media_object.contributor), diff --git a/app/views/playlist_items/_current_item.html.erb b/app/views/playlist_items/_current_item.html.erb index 8317720d78..dea93086f5 100644 --- a/app/views/playlist_items/_current_item.html.erb +++ b/app/views/playlist_items/_current_item.html.erb @@ -39,7 +39,8 @@ Unless required by applicable law or agreed to in writing, software distributed
- <%= display_metadata('Date', combined_display_date(@current_mediaobject), 'Not provided') %> + <%= display_metadata('Publication date', @current_mediaobject.date_issued) %> + <%= display_metadata('Creation date', @current_mediaobject.date_created) %> <%= display_metadata('Main contributor', @current_mediaobject.creator) %> <% unless @current_mediaobject.abstract.blank? %>
Summary
diff --git a/spec/models/iiif_manifest_presenter_spec.rb b/spec/models/iiif_manifest_presenter_spec.rb index 1e379fb773..8d712e4b37 100644 --- a/spec/models/iiif_manifest_presenter_spec.rb +++ b/spec/models/iiif_manifest_presenter_spec.rb @@ -62,8 +62,8 @@ it 'provides metadata' do allow_any_instance_of(IiifManifestPresenter).to receive(:lending_enabled).and_return(false) - ['Title', 'Date', 'Main contributor', 'Summary', 'Contributor', 'Publisher', 'Genre', 'Subject', 'Time period', - 'Location', 'Collection', 'Unit', 'Language', 'Rights Statement', 'Terms of Use', 'Physical Description', 'Series', + ['Title', 'Publication date', 'Creation date', 'Main contributor', 'Summary', 'Contributor', 'Publisher', 'Genre', 'Subject', + 'Time period', 'Location', 'Collection', 'Unit', 'Language', 'Rights Statement', 'Terms of Use', 'Physical Description', 'Series', 'Related Item', 'Notes', 'Table of Contents', 'Local Note', 'Other Identifier', 'Access Restrictions', 'Bibliographic ID' ].each do |field| expect(subject).to include(field) @@ -93,8 +93,8 @@ it 'provides metadata' do allow_any_instance_of(IiifManifestPresenter).to receive(:lending_enabled).and_return(true) - ['Title', 'Date', 'Main contributor', 'Summary', 'Contributor', 'Publisher', 'Genre', 'Subject', 'Time period', - 'Location', 'Collection', 'Unit', 'Language', 'Rights Statement', 'Terms of Use', 'Physical Description', 'Series', + ['Title', 'Publication date', 'Creation date', 'Main contributor', 'Summary', 'Contributor', 'Publisher', 'Genre', 'Subject', + 'Time period', 'Location', 'Collection', 'Unit', 'Language', 'Rights Statement', 'Terms of Use', 'Physical Description', 'Series', 'Related Item', 'Notes', 'Table of Contents', 'Local Note', 'Other Identifier', 'Access Restrictions', 'Bibliographic ID', 'Lending Period' ].each do |field| expect(subject).to include(field)