sul-dlss / mods_display

MODS Display is a gem to centralize the display logic of MODS medadata.
Other
2 stars 5 forks source link

Add support for Purl/SearchWorks ActionView helpers #71

Closed mejackreed closed 3 years ago

mejackreed commented 3 years ago

This pull request ports over the functionality from Purl and originally SearchWorks that provides the custom display of mods_display in the context of ActionView. The intent here being able to remove the RecordHelper modules from both applications.

The tests are ported over from SearchWorks to ensure compatibility there, with one large difference.

Currently in SearchWorks (uses all subjects):

<%= mods_subject_field(document.mods.subject)%>

https://github.com/sul-dlss/SearchWorks/blob/4fc8b0d10d5f3f2ab02638f8ca901ce6735d7a45/app/views/catalog/record/_mods_subjects.html.erb#L2-L5

Currently in Purl (each subject):

<% document.mods.subject.each do |subject| %>
  <%= mods_subject_field(subject)%>
<% end %>

https://github.com/sul-dlss/purl/blame/master/app/views/purl/_mods_subjects.html.erb#L3-L6

This code takes the "each subject" approach, so that SearchWorks will need to update how it handles that. Should be a simple change.

Running in Purl locally fs947tw3404

Screen Shot 2021-02-12 at 4 53 09 PM

This sets us up to do: https://github.com/sul-dlss/exhibits/issues/1958 https://github.com/sul-dlss/exhibits/issues/1961 https://github.com/sul-dlss/exhibits/issues/697