Skip to content

Commit

Permalink
πŸ› Make date created consistent
Browse files Browse the repository at this point in the history
Ref:
- https://github.com/scientist-softserv/adventist-dl/issues/632
Related to:
- #77

Property date_created was defined inconsistently, which broke creation
and editing of Image and GenericWork types.

This pull request adds a partial with a date picker for date_created and
removes `multiple: false` from the definition for GenericWork and
Image work types.

Additionally, several unused view partials are being removed, as they
were in the wrong path location and would never be hit.
  • Loading branch information
laritakr authored and jeremyf committed Oct 12, 2023
1 parent 218d671 commit 1904439
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 19 deletions.
4 changes: 2 additions & 2 deletions app/models/adventist_metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ module AdventistMetadata
# This is for the rights statement
property :rights_statement, predicate: ::RDF::Vocab::EDM.rights
property :publisher, predicate: ::RDF::Vocab::DC11.publisher
property :date_created, predicate: ::RDF::Vocab::DC.created, multiple: false do |index|
index.as :stored_searchable
property :date_created, predicate: ::RDF::Vocab::DC.created do |index|
index.as :stored_searchable, :facetable, :stored_sortable
end
property :subject, predicate: ::RDF::Vocab::DC11.subject
property :language, predicate: ::RDF::Vocab::DC11.language
Expand Down
2 changes: 1 addition & 1 deletion app/views/hyrax/base/_attribute_rows.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<%= presenter.attribute_to_html(:remote_url, render_as: :external_link) %>
<%= presenter.attribute_to_html(:rights_statement, render_as: :rights_statement, html_dl: true) %>
<%= presenter.attribute_to_html(:extent) %>
<%= presenter.attribute_to_html(:date_issued, label: 'Date') %>
<%= presenter.attribute_to_html(:date_issued, label: 'Date Issued') %>
<%= presenter.attribute_to_html(:alt, label: 'Publication GeoCode') %>
<%= presenter.attribute_to_html(:embargo_release_date, render_as: :date, html_dl: true) %>
<%= presenter.attribute_to_html(:lease_expiration_date, render_as: :date, html_dl: true) %>
Expand Down
6 changes: 0 additions & 6 deletions app/views/journal_articles/edit_fields/_default.html.temp.erb

This file was deleted.

5 changes: 0 additions & 5 deletions app/views/records/edit_fields/_abstract.html.erb

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<% # use date picker %>
<%# use date picker %>
<% if f.object.class.multiple? key %>
<%= f.input key, as: :multi_value, input_html: { data: { provide: 'datepicker', 'date-force-parse': 'false', 'date-autoclose': 'true' } }, required: f.object.required?(key) %>
<% else %>
<%= f.input key, input_html: { value: f.object.model[key].first, data: { provide: 'datepicker', 'date-force-parse': 'false', 'date-autoclose': 'true' } }, required: f.object.required?(key) %>
<% end %>
<%= f.input key, input_html: { value: f.object.model[key]&.first, data: { provide: 'datepicker', 'date-force-parse': 'false', 'date-autoclose': 'true' } }, required: f.object.required?(key) %>
<% end %>
4 changes: 2 additions & 2 deletions config/locales/dog_biscuits.en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ en:
date_created: Date created
date_collected: Date collected
date_copyrighted: Date copyrighted
date_issued: Date
date_issued: Date issued
date_of_award: Date of award
date_published: Publication date
date_submitted: Date submitted
Expand Down Expand Up @@ -151,7 +151,7 @@ en:
date_created: Date created
date_collected: Date collected
date_copyrighted: Date copyrighted
date_issued: Date
date_issued: Date issued
date_of_award: Date of award
date_published: Publication date
date_submitted: Date submitted
Expand Down

0 comments on commit 1904439

Please sign in to comment.