mirror of
https://github.com/heyarne/airsonic-ui.git
synced 2026-05-07 02:33:39 +02:00
Fix breadcrumbs
This commit is contained in:
parent
5bfc883de9
commit
5344975363
1 changed files with 10 additions and 10 deletions
|
|
@ -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)])
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue