Skip to content

Commit

Permalink
AR-1780 show terms in subject list for any agents with a subject role…
Browse files Browse the repository at this point in the history
… and terms
  • Loading branch information
payten authored and marktriggs committed Jun 19, 2017
1 parent ccc3513 commit 45c76d0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions public-new/app/models/record.rb
Expand Up @@ -260,8 +260,11 @@ def parse_agents(subjects_arr)
unless agent['role'].blank? || agent['_resolved'].blank?
role = agent['role']
ag = title_and_uri(agent['_resolved'], agent['_inherited'])
if role == 'subject'
subjects_arr.push(ag) if ag
if role == 'subject' && ag
unless (terms = ASUtils.wrap(agent.dig('terms'))).empty?
ag['title'] += " — #{terms.collect{|t| t['term']}.join(' -- ')}"
end
subjects_arr.push(ag)
elsif ag
agents_h[role] = agents_h[role].blank? ? [ag] : agents_h[role].push(ag)
end
Expand Down
2 changes: 1 addition & 1 deletion public-new/app/views/shared/_present_list.html.erb
Expand Up @@ -26,7 +26,7 @@
<% unless item['uri'].blank? %>
<a href="<%= item['uri'] %>">
<% end %>
<%= item['title'] %>
<%= item['title'].html_safe %>
<% unless item['uri'].blank? %>
</a>
<% end %>
Expand Down

0 comments on commit 45c76d0

Please sign in to comment.