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

Move artists into library (#68)

* Use more sensible naming for api responses

* Move artist overview into library; closes #50 and #52

* Fix sass live-reload

* Move editor config out of shadow-cljs.edn
This commit is contained in:
heyarne 2019-12-08 00:56:45 +01:00 committed by GitHub
commit 930bf55390
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 82 additions and 47 deletions

View file

@ -1,5 +1,6 @@
(ns airsonic-ui.components.artist.views
(:require [airsonic-ui.components.collection.views :as collection]
[airsonic-ui.components.library.views :as library]
[airsonic-ui.routes :as routes]
[clojure.string :as str]))
@ -68,7 +69,7 @@
(defn overview
"Displays the alphabetical listing of all artists along with some additional
information about the collection"
[{:keys [artists]}]
[current-route {:keys [artists]}]
(let [artists (:index artists)
;; TODO: Calculations in views should be avoided
artists-count (count (mapcat :artist artists))
@ -76,8 +77,9 @@
(map :albumCount)
(reduce +))]
[:div
[:section.hero.is-small>div.hero-body
[library/tab-section current-route]
[:section.hero.single-line.is-small>div.hero-body
[:div.container
[:h1.title "Artists"]
[:p.subtitle.is-5.has-text-grey [:strong artists-count] " artists in your collection with " [:strong album-count] " albums"]]]
[:p.subtitle.is-5.has-text-grey [:strong artists-count] " artists with " [:strong album-count] " albums"]]]
[:section.section>div.container [alphabetical-listing artists]]]))