mirror of
https://github.com/heyarne/airsonic-ui.git
synced 2026-05-06 18:33:38 +02:00
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
52 lines
1.7 KiB
Clojure
52 lines
1.7 KiB
Clojure
(ns airsonic-ui.views
|
|
(:require [re-frame.core :refer [dispatch subscribe]]
|
|
[airsonic-ui.config :as config]
|
|
[airsonic-ui.routes :as routes :refer [url-for]]
|
|
[airsonic-ui.events :as events]
|
|
[airsonic-ui.subs :as subs]
|
|
|
|
[airsonic-ui.views.breadcrumbs :refer [breadcrumbs]]
|
|
[airsonic-ui.views.bottom-bar :refer [bottom-bar]]
|
|
[airsonic-ui.views.login :refer [login-form]]
|
|
[airsonic-ui.views.album :as album]
|
|
[airsonic-ui.views.song :as song]))
|
|
|
|
;; TODO: Find better names and places for these.
|
|
|
|
(defn album-detail [content]
|
|
[:div
|
|
[:h2.title (str (:artist content) " - " (:name content))]
|
|
[song/listing (:song content)]])
|
|
|
|
(defn artist-detail [content]
|
|
[:div
|
|
[:h2.title (:name content)]
|
|
[album/listing (:album content)]])
|
|
|
|
(defn most-recent [content]
|
|
[:div
|
|
[:h2.title "Recently played"]
|
|
[album/listing (:album content)]])
|
|
|
|
;; putting everything together
|
|
|
|
(defn app [route params query]
|
|
(let [login @(subscribe [::subs/login])
|
|
content @(subscribe [::subs/current-content])]
|
|
[:div
|
|
[:section.section>div.container
|
|
[:div.level
|
|
[:div.level-left [:span (str "Currently logged in as " (:u login))]]
|
|
[:div.level-right [:a {:on-click #(dispatch [::events/initialize-db]) :href "#"} "Logout"]]]
|
|
[breadcrumbs content]
|
|
(case route
|
|
::routes/main [most-recent content]
|
|
::routes/artist-view [artist-detail content]
|
|
::routes/album-view [album-detail content])]
|
|
[bottom-bar]]))
|
|
|
|
(defn main-panel []
|
|
(let [[route params query] @(subscribe [::subs/current-route])]
|
|
(case route
|
|
::routes/login [login-form]
|
|
[app route params query])))
|