Skip to content

Commit

Permalink
comment out older related_to code
Browse files Browse the repository at this point in the history
  • Loading branch information
jendiamond committed Oct 23, 2023
1 parent 2c8b9fc commit 12d542d
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 40 deletions.
20 changes: 10 additions & 10 deletions app/helpers/blacklight_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,17 +64,17 @@ def render_other_versions_link
data.html_safe
end

def render_related_to_markup
related_to_text = ''
urls = @document[:related_to_ssm]
urls.each { |url| related_to_text += '<a href="' + url + '">' + url + '</a> <br>' }
related_to_text
end
# def render_related_to_markup
# related_to_text = ''
# urls = @document[:related_to_ssm]
# urls.each { |url| related_to_text += '<a href="' + url + '">' + url + '</a> <br>' }
# related_to_text
# end

def render_related_to_link
data = render_related_to_markup
data.html_safe
end
# def render_related_to_link
# data = render_related_to_markup
# data.html_safe
# end

def render_table_of_contents_key
unless @document[:toc_tesim].nil? || @document[:toc_tesim].empty?
Expand Down
7 changes: 0 additions & 7 deletions app/views/catalog/work_record--ursus/_note_metadata.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,10 @@
<dd class="blacklight-<%= field_name.parameterize %> metadata-block__label-value metadata-block__label-value--ursus">
<%= raw doc_presenter.field_value field %>
</dd>

</dt>
<!-- LOOP END -->
<% end %>

<% if @document[:related_to_ssm] %>
<dt class="metadata-block__label-key">Related Item(s)</dt>

<dd class="metadata-block__label-value document__list-metadata-value--ursus"><%= render_related_to_link %></dd>
<% end %>

<!-- TABLE OF CONTENTS -->
<dt class='metadata-block__label-key'><%= toc_key %></dt>
<dd class='metadata-block__label-value'><%= raw toc_value %></dd>
Expand Down
1 change: 1 addition & 0 deletions config/metadata/note_metadata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ contents_note_tesim: 'Contents note'
colophon_tesim: 'Colophon'
provenance_tesim: 'Provenance'
note_tesim: 'Note'
related_to_ssm: 'Related items'
# toc_tesim: 'Table of Contents' (render_table_of_contents_key / value)
resp_statement_tesim: 'Statement of Responsibility'
citation_source_tesim: 'References'
Expand Down
51 changes: 28 additions & 23 deletions spec/presenters/ursus/note_metadata_presenter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,18 @@
RSpec.describe Ursus::NoteMetadataPresenter do
let(:solr_doc) do
{
'caption_tesim' => 'Caption',
'summary_tesim' => 'Summary',
'description_tesim' => 'Description',
'provenance_tesim' => 'Provenance',
'caption_tesim' => 'Caption',
'contents_note_tesim' => 'Contents note',
'colophon_tesim' => 'Colophon',
'incipit_tesim' => 'Incipit',
'explicit_tesim' => 'Explicit',
'provenance_tesim' => 'Provenance',
'note_tesim' => 'Note',
'related_to_ssm' => 'Related items',
'resp_statement_tesim' => 'Statement of Responsibility',
'citation_source_tesim' => 'References'
'citation_source_tesim' => 'References',
'incipit_tesim' => 'Incipit',
'explicit_tesim' => 'Explicit'
}
end
let(:solr_doc_missing_items) do
Expand All @@ -30,10 +31,6 @@

context 'with a solr document containing overview metadata' do
describe 'config' do
it 'returns the Caption Key' do
expect(config['caption_tesim'].to_s).to eq('Caption')
end

it 'returns the Summary Key' do
expect(config['summary_tesim'].to_s).to eq('Summary')
end
Expand All @@ -42,37 +39,45 @@
expect(config['description_tesim'].to_s).to eq('Description')
end

it 'returns the Provenance Key' do
expect(config['provenance_tesim'].to_s).to eq('Provenance')
end
it 'returns the Caption Key' do
expect(config['caption_tesim'].to_s).to eq('Caption')
end

it 'returns the Contents note Key' do
expect(config['contents_note_tesim'].to_s).to eq('Contents note')
end
expect(config['contents_note_tesim'].to_s).to eq('Contents note')
end

it 'returns the Colophon Key' do
expect(config['colophon_tesim'].to_s).to eq('Colophon')
end
expect(config['colophon_tesim'].to_s).to eq('Colophon')
end

it 'returns the Incipit Key' do
expect(config['incipit_tesim'].to_s).to eq('Incipit')
end

it 'returns the Explicit Key' do
expect(config['explicit_tesim'].to_s).to eq('Explicit')
it 'returns the Provenance Key' do
expect(config['provenance_tesim'].to_s).to eq('Provenance')
end

it 'returns the Note Key' do
expect(config['note_tesim'].to_s).to eq('Note')
end

it 'returns the Related items Key' do
expect(config['related_to_ssm'].to_s).to eq('Related items')
end

it 'returns the Statement of Responsibility Key' do
expect(config['resp_statement_tesim'].to_s).to eq('Statement of Responsibility')
end

it 'returns the References Key' do
expect(config['citation_source_tesim'].to_s).to eq('References')
end

it 'returns the Incipit Key' do
expect(config['incipit_tesim'].to_s).to eq('Incipit')
end

it 'returns the Explicit Key' do
expect(config['explicit_tesim'].to_s).to eq('Explicit')
end
end

describe "#note terms" do
Expand All @@ -81,7 +86,7 @@

it "returns existing keys" do
expect(presenter_object.note_terms).to be_instance_of(Hash)
expect(all).to eq 11
expect(all).to eq 12
expect(config.length).to eq all
end

Expand Down

0 comments on commit 12d542d

Please sign in to comment.