Skip to content

Commit dfa0f1b

Browse files
authored
Merge pull request #61 from MITLibraries/bugfix
contentType is not a required field
2 parents df76681 + 769541b commit dfa0f1b

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

app/views/record/_record.html.erb

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,12 @@
1111
</h2>
1212

1313
<p>
14-
<span class="record-type">
15-
<% # we need to create separate displays for different types of content types, see https://github.com/MITLibraries/bento/pull/908/files#diff-6718f9b88f6f93e59d8c2509512dc40a62088430ff3cce1165ab414565949415L22-L57 for starting point but we should anticipate wanting to expand to many more unique content types %>
16-
<span class="sr">Type</span> <%= @record['contentType'].join %>
17-
</span>
14+
<% if @record['contentType'].present? %>
15+
<span class="record-type">
16+
<% # we need to create separate displays for different types of content types, see https://github.com/MITLibraries/bento/pull/908/files#diff-6718f9b88f6f93e59d8c2509512dc40a62088430ff3cce1165ab414565949415L22-L57 for starting point but we should anticipate wanting to expand to many more unique content types %>
17+
<span class="sr">Type</span> <%= @record['contentType'].join %>
18+
</span>
19+
<% end %>
1820
1921
<% if @record['citation'].present? %>
2022

app/views/search/_result.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
</h2>
55

66
<p class="pub-info">
7-
<span><%= result['contentType']&.each { |type| type['value'] }.join(' ; ') %></span>
7+
<span><%= result['contentType']&.each { |type| type['value'] }&.join(' ; ') %></span>
88
<span>
99
<% result['dates']&.each do |date| %>
1010
<%= date['value'] if date['kind'] == 'Publication date' %>

0 commit comments

Comments
 (0)