<%= link_to "〈".html_safe, :back, title: "Back" %>
Artists & Albums
<% @artists.each do |artist| %>
<%= content_tag :div, class: 'result clearfix' do %>
<%= link_to artist do %>
<%= highlighted(artist, :name) %>
<%= pluralize artist.album_count, 'album' %>
<% end %>
<% if highlight = highlight(artist, :members_combined) %>
Members
<%= highlight.first.html_safe %>
<% end %>
<% if highlight = highlight(artist, :profile) %>
Profile
<%= highlight.join('…').html_safe %>
<% end %>
<% end %>
<% end %>
<% @albums.each do |album| %>
<%= content_tag :div, class: 'result clearfix' do %>
<%= link_to artist_path(album.artist_id, anchor: "album_#{album.id}") do %>
<%= highlighted(album, :title) %>
<%= album.artist %>
(<%= [album.meta.formats.first, album.released].compact.join(' ') %>)
<% end %>
<% if highlight = highlight(album, 'tracklist.title') %>
Tracks
<%= highlight.join('…').html_safe %>
<% end %>
<% if highlight = highlight(album, :notes) %>
Notes
<%= highlight.map { |d| d.gsub(/^\.\s?/, '') }.join('…').html_safe %>
<% end %>
<% end %>
<% end %>
<% if @artists.empty? && @albums.empty? %>
The search hasn't returned any results...
<% end %>