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

Merge feature/search

Squashed commit of the following:

commit 8a19df91f8daa1b791d40cc910947c94355a8d0d
Author: Arne Schlüter <arne@schlueter.is>
Date:   Tue Aug 28 16:06:35 2018 +0200

    Implement search UI (closes #19)

commit bf661dd25ec9f1d5569df88a8a87f94c1bc1b317
Author: Arne Schlüter <arne@schlueter.is>
Date:   Tue Aug 28 11:09:46 2018 +0200

    Re-add subscription for single endpoint and move helpers to a different location
This commit is contained in:
Arne Schlüter 2018-08-28 16:07:45 +02:00
commit 7653af5dd1
22 changed files with 236 additions and 49 deletions

View file

@ -5,12 +5,13 @@
;; hierarchy no matter how you came to the url. They should allow easy
;; navigation upwards that hierarchy (e.g. album -> artist)
(defn content-type
(defn page-type
"Helper to see what kind of view we're currently dealing with"
[content]
(case (set (keys content))
#{:artist :artist-info} :artist
#{:album} :album
#{:search} :search
:other-content))
(defn- bulma-breadcrumbs [& items]
@ -20,7 +21,7 @@
[:li {:key idx} [:a {:href href} label]])
[:li.is-active>a (last items)]]])
(defmulti breadcrumbs content-type)
(defmulti breadcrumbs page-type)
(defmethod breadcrumbs :default [content]
[bulma-breadcrumbs "Start"])
@ -35,3 +36,8 @@
[(url-for ::routes/main) "Start"]
[(url-for ::routes/artist-view {:id (:artistId album)}) (:artist album)]
(:name album)])
(defmethod breadcrumbs :search [_]
[bulma-breadcrumbs
[(url-for ::routes/main) "Start"]
"Search"])