mirror of
https://github.com/heyarne/airsonic-ui.git
synced 2026-05-06 18:33:38 +02:00
Put on some lipgloss
commit 9fa1a611e2fa093819b332791c28783a4f92a6dc
Author: Arne Schlüter <arne@schlueter.is>
Date: Fri May 18 00:00:31 2018 +0200
Add album previews
commit 317a6632b898039e370e3f8d52627e08a8c8186c
Author: Arne Schlüter <arne@schlueter.is>
Date: Fri May 18 00:00:06 2018 +0200
Fix cover art url
commit 0ba09903b96f5241853f003f679c0f407243f12a
Author: Arne Schlüter <arne@schlueter.is>
Date: Thu May 17 22:59:23 2018 +0200
Add bulma breadcrumbs
commit d21c7c8acc802101ff8ec096d5c6fad90e4f8ea7
Author: Arne Schlüter <arne@schlueter.is>
Date: Wed May 16 18:55:45 2018 +0200
Add basic styling to bottom bar
commit 23b37984ca9e8af84767e073492a42bf6c5924ea
Author: Arne Schlüter <arne@schlueter.is>
Date: Wed May 16 18:21:27 2018 +0200
Add retina version of cover component
commit d86a44bc5f7b7472f0084c47b691b0f7d151f497
Author: Arne Schlüter <arne@schlueter.is>
Date: Wed May 16 18:20:47 2018 +0200
Add info about server address to README
commit 4114581c259e17e3d0342755124e4fa56cd5dd3a
Author: Arne Schlüter <arne@schlueter.is>
Date: Tue May 8 11:51:07 2018 +0200
Add cover image
commit e6cb0745b366cbce3c25f225d8e008f12fcaae8b
Author: Arne Schlüter <arne@schlueter.is>
Date: Tue May 8 10:49:26 2018 +0200
Move views to their own namespaces
commit 5c24a47cc07b347beedd972e32ec145348a82d65
Author: Arne Schlüter <arne@schlueter.is>
Date: Mon May 7 18:10:00 2018 +0200
Add login styling
commit e04e0505f684d99316bdb3e875c403af2c28c127
Author: Arne Schlüter <arne@schlueter.is>
Date: Sun May 6 11:19:08 2018 +0200
Add gh-pages deploy script
commit e1a4cb4bb646def28989100f2084990863160dd9
Author: Arne Schlüter <arne@schlueter.is>
Date: Sun May 6 00:43:51 2018 +0200
Add bulma
This commit is contained in:
parent
94d6c25d9e
commit
8d24c1b42a
15 changed files with 2544 additions and 612 deletions
37
src/airsonic_ui/views/breadcrumbs.cljs
Normal file
37
src/airsonic_ui/views/breadcrumbs.cljs
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
(ns airsonic-ui.views.breadcrumbs
|
||||
(:require [airsonic-ui.routes :as routes :refer [url-for]]))
|
||||
|
||||
;; Breadcrumbs are implemented in such a way that they provide a stringent
|
||||
;; hierarchy no matter how you came to the url. They should allow easy
|
||||
;; navigation upwards that hierarchy (e.g. album -> artist)
|
||||
|
||||
(defn content-type
|
||||
"Helper to see what kind of server response"
|
||||
[content]
|
||||
(cond
|
||||
(and (vector? (:album content)) (:id content)) :artist
|
||||
(vector? (:song content)) :album
|
||||
:else :unknown-content))
|
||||
|
||||
(defn- bulma-breadcrumbs [& items]
|
||||
[:nav.breadcrumb {:aria-label "breadcrumbs"}
|
||||
[:ul
|
||||
(for [[idx [href label]] (map-indexed vector (butlast items))]
|
||||
[:li {:key idx} [:a {:href href} label]])
|
||||
[:li.is-active>a (last items)]]])
|
||||
|
||||
(defmulti breadcrumbs content-type)
|
||||
|
||||
(defmethod breadcrumbs :default [content]
|
||||
[bulma-breadcrumbs "Start"])
|
||||
|
||||
(defmethod breadcrumbs :artist [content]
|
||||
[bulma-breadcrumbs
|
||||
[(url-for ::routes/main) "Start"]
|
||||
(:name content)])
|
||||
|
||||
(defmethod breadcrumbs :album [content]
|
||||
[bulma-breadcrumbs
|
||||
[(url-for ::routes/main) "Start"]
|
||||
[(url-for ::routes/artist-view {:id (:artistId content)}) (:artist content)]
|
||||
(:name content)])
|
||||
Loading…
Add table
Add a link
Reference in a new issue