mirror of
https://github.com/heyarne/airsonic-ui.git
synced 2026-05-07 02:33:39 +02:00
Move all source files to src folder
This commit is contained in:
parent
cdf3785f82
commit
47c37e198c
20 changed files with 24 additions and 9 deletions
23
src/cljs/airsonic_ui/views/song.cljs
Normal file
23
src/cljs/airsonic_ui/views/song.cljs
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
(ns airsonic-ui.views.song
|
||||
(:require [re-frame.core :refer [dispatch]]
|
||||
[airsonic-ui.events :as events]
|
||||
[airsonic-ui.routes :as routes :refer [url-for]]))
|
||||
|
||||
(defn item [songs song]
|
||||
(let [artist-id (:artistId song)]
|
||||
[:div
|
||||
[:a
|
||||
(when artist-id {:href (url-for ::routes/artist-view {:id artist-id})})
|
||||
(:artist song)]
|
||||
" - "
|
||||
[:a
|
||||
{:href "#" :on-click (fn [e]
|
||||
(.preventDefault e)
|
||||
(dispatch [::events/play-songs songs song]))}
|
||||
(:title song)]]))
|
||||
|
||||
;; FIXME: This is very similar to album-listing
|
||||
|
||||
(defn listing [songs]
|
||||
[:ul (for [[idx song] (map-indexed vector songs)]
|
||||
[:li {:key idx} [item songs song]])])
|
||||
Loading…
Add table
Add a link
Reference in a new issue