Skip to content

Commit

Permalink
Use upstream rendering for abstracts + contents
Browse files Browse the repository at this point in the history
  • Loading branch information
cbeer committed Jul 7, 2022
1 parent 846dc4c commit 91f83fd
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 45 deletions.
6 changes: 3 additions & 3 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ GEM
iso-639
nokogiri (>= 1.6.6)
nom-xml (~> 1.0)
mods_display (1.1.0)
mods_display (1.2.0)
i18n
stanford-mods (>= 3.0.0.alpha1, < 4)
view_component
Expand Down Expand Up @@ -327,7 +327,7 @@ GEM
rspec-mocks (~> 3.10)
rspec-support (~> 3.10)
rspec-support (3.11.0)
rubocop (1.31.1)
rubocop (1.31.2)
json (~> 2.3)
parallel (~> 1.10)
parser (>= 3.1.0.0)
Expand All @@ -342,7 +342,7 @@ GEM
rubocop-performance (1.14.2)
rubocop (>= 1.7.0, < 2.0)
rubocop-ast (>= 0.4.0)
rubocop-rails (2.15.1)
rubocop-rails (2.15.2)
activesupport (>= 4.2.0)
rack (>= 1.1)
rubocop (>= 1.7.0, < 2.0)
Expand Down
6 changes: 0 additions & 6 deletions app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,4 @@ def embeddable_url(druid)
def with_copyright_symbol(str)
str.gsub(/\(c\) Copyright/i, '© Copyright')
end

def format_mods_content(values)
text = link_urls_and_email(values.join("\n\n").gsub('&#10;', "\n"))

simple_format text, {}, sanitize: false
end
end
16 changes: 3 additions & 13 deletions app/views/purl/_mods_abstract_contents.html.erb
Original file line number Diff line number Diff line change
@@ -1,18 +1,8 @@
<% document ||= @document %>
<% document.mods.abstract.each do |abstracts| %>
<% if abstracts.respond_to?(:values) %>
<%= mods_display_label(abstracts.label) %>
<dd class="section-abstract">
<%= format_mods_content(abstracts.values) %>
</dd>
<% end %>
<% document.mods.abstract.each do |abstract| %>
<%= mods_record_field(abstract) %>
<% end %>
<% document.mods.contents.each do |contents| %>
<% if contents.respond_to?(:values) %>
<%= mods_display_label(contents.label) %>
<dd class="section-contents">
<%= format_mods_content(contents.values) %>
</dd>
<% end %>
<%= mods_record_field(contents) %>
<% end %>
23 changes: 0 additions & 23 deletions spec/helpers/application_helper_spec.rb

This file was deleted.

0 comments on commit 91f83fd

Please sign in to comment.