gmusicprocurator/templates/js/search-results.mtpl
<div>[% /* For flexbox */ %]
<h3>Search Results</h3>
<div class="scrollable-contents"><div>
[% if (!!model.artist_hits) { %]
<section id="artist-results" class="scrollable-figures">
<h4>Artists</h4>
<ul>
[% model.artist_hits.forEach(function (hit) { %]
<li><a href="#/artists/[[ hit.artist.artistId ]]"><figure>
<img src="[[ hit.artist.artistArtRef ]]" alt="" title="[%- hit.artist.name %]" class="secondary-artist-art">
<figcaption title="[%- hit.artist.name %]">[%- hit.artist.name %]</figcaption>
</figure></a></li>
[% }); /* artist_hits.forEach */ %]
</ul>
</section>
[% } /* artist_hits */ %]
[% if (!!model.album_hits) { %]
<section id="album-results" class="scrollable-figures">
<h4>Albums</h4>
<ul>
[% model.album_hits.forEach(function (hit) { %]
<li><figure>
<a href="#/albums/[[ hit.album.albumId ]]"><img src="[[ hit.album.albumArtRef ]]" alt="" title="[%- hit.album.name %]" class="secondary-album-art"></a>
<figcaption>
<p><a href="#/albums/[[ hit.album.albumId ]]" title="[%- hit.album.name %]">[%- hit.album.name %]</a></p>
<p>[% if (!!hit.album.artistId[0]) { %]<a href="#/artists/[[ hit.album.artistId[0] ]]" title="[%- hit.album.artist %]">[% } %][% hit.album.artist %][% if (!!hit.album.artistId[0]) { %]</a>[% } %]</p>
</figcaption>
</figure></li>
[% }); /* album_hits.forEach */ %]
</ul>
</section>
[% } /* album_hits */ %]
[% if (!!model.song_hits && model.song_hits.get('tracks').length > 0) { %]
<h4>Songs</h4>
[% } /* song_hits */ %]
</div></div>
</div>