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

Fix breadcrumbs

This commit is contained in:
Arne Schlüter 2018-08-22 18:57:47 +02:00
commit 5344975363

View file

@ -6,12 +6,12 @@
;; navigation upwards that hierarchy (e.g. album -> artist) ;; navigation upwards that hierarchy (e.g. album -> artist)
(defn content-type (defn content-type
"Helper to see what kind of server response" "Helper to see what kind of view we're currently dealing with"
[content] [content]
(cond (case (set (keys content))
(and (vector? (:album content)) (:id content)) :artist #{:artist :artist-info} :artist
(vector? (:song content)) :album #{:album} :album
:else :unknown-content)) :other-content))
(defn- bulma-breadcrumbs [& items] (defn- bulma-breadcrumbs [& items]
[:nav.breadcrumb {:aria-label "breadcrumbs"} [:nav.breadcrumb {:aria-label "breadcrumbs"}
@ -25,13 +25,13 @@
(defmethod breadcrumbs :default [content] (defmethod breadcrumbs :default [content]
[bulma-breadcrumbs "Start"]) [bulma-breadcrumbs "Start"])
(defmethod breadcrumbs :artist [content] (defmethod breadcrumbs :artist [{:keys [artist]}]
[bulma-breadcrumbs [bulma-breadcrumbs
[(url-for ::routes/main) "Start"] [(url-for ::routes/main) "Start"]
(:name content)]) (:name artist)])
(defmethod breadcrumbs :album [content] (defmethod breadcrumbs :album [{:keys [album]}]
[bulma-breadcrumbs [bulma-breadcrumbs
[(url-for ::routes/main) "Start"] [(url-for ::routes/main) "Start"]
[(url-for ::routes/artist-view {:id (:artistId content)}) (:artist content)] [(url-for ::routes/artist-view {:id (:artistId album)}) (:artist album)]
(:name content)]) (:name album)])