Skip to content

Commit

Permalink
Fix #1137, do not display 787 as initial entry
Browse files Browse the repository at this point in the history
  • Loading branch information
xhero committed Aug 18, 2021
1 parent 00d0c3b commit 6e66098
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions app/models/source.rb
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,10 @@ def get_child_source(source_id)
nil
end

def get_initial_entries
self.sources.where("sources_to_sources.marc_tag": 775)
end

def siglum_matches?(siglum)
if self.record_type == MarcSource::RECORD_TYPES[:edition] ||
self.record_type == MarcSource::RECORD_TYPES[:libretto_edition] ||
Expand Down
4 changes: 2 additions & 2 deletions app/views/marc_show/_show_774_773_links.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<% if @item.parent_source || @item.child_sources.count > 0 || @item.sources.count > 0 || @item.collection_holdings.count > 0 %>
<% if @item.parent_source || @item.child_sources.count > 0 || @item.get_initial_entries.count > 0 || @item.collection_holdings.count > 0 %>
<div class="panel">
<h3><%= group[:title] %></h3>
<div class="panel_contents">
Expand Down Expand Up @@ -69,7 +69,7 @@
<% end %>
</table>
<% end %>
<% if @item.sources.count > 0 %>
<% if @item.get_initial_entries.count > 0 %>
<table border="0" cellpadding="0" cellspacing="0">
<tr class="row">
<th>
Expand Down

0 comments on commit 6e66098

Please sign in to comment.