1
0
Fork 0
mirror of https://github.com/heyarne/airsonic-ui.git synced 2026-05-06 18:33:38 +02:00

Add links to similar artists in collection

This commit is contained in:
Arne Schlüter 2018-11-25 16:33:45 +01:00
commit 2d05cdf9d6
2 changed files with 30 additions and 11 deletions

View file

@ -28,18 +28,30 @@
(when (:musicBrainzId artist-info)
[musicbrainz-link artist-info])]))
(defn similar-artists
"Given an artist-info response will return a list of similar artists"
[{similar-artists :similarArtist}]
[:div.tags.similar-artists
(for [{:keys [id name]} similar-artists]
^{:key id} [:a.tag {:href (routes/url-for ::routes/artist.detail {:id id})} name])])
(defn detail
"Creates a nice artist page displaying the artist's name, bio (if available and
listing) their albums."
[{:keys [artist artist-info]}]
[:div
[:section.hero>div.hero-body
[:div.container
[:section.hero.is-small>div.hero-body>div.container
[:h1.title (:name artist)]
[:div.content
[lastfm-bio artist-info]
[artist-links artist-info]]]]
[:section.section>div.container [collection/listing (:album artist)]]])
[artist-links artist-info]]]
[:section.section.is-small>div.container
[:h2.subtitle "Albums"]
[collection/listing (:album artist)]]
(when (:similarArtist artist-info)
[:section.section.is-small>div.container
[:h2.subtitle "Similar artists in your collection"]
[similar-artists artist-info]])])
(defn alphabetical-listing
[artists]

View file

@ -148,13 +148,20 @@
background-color: $light !important
font-weight: bold
// useful in general to pull elements closer together; bulma es very generous
// with whitespace
.section.is-small
padding-top: 24px
padding-bottom: 24px
// occurs on many pages at the top to show details
.hero
&.is-small + .section
padding-top: 0
.media-content
align-self: center
&.is-small + .section
padding-top: 0
// floating notifications
.notifications:not(:empty)