aboutsummaryrefslogtreecommitdiffhomepage
path: root/explore.lisp
diff options
context:
space:
mode:
authorColin Okay <colin@cicadas.surf>2022-10-27 15:10:28 -0500
committerColin Okay <colin@cicadas.surf>2022-10-27 15:10:28 -0500
commitf0586d83687271525f8d6f0874dbb924ecb7f7c2 (patch)
treef986423c0e272f0c51a9bf234002fa9c93776704 /explore.lisp
parentf80c82597ffcf3a65cc49ffca8f3b7ffa8117c27 (diff)
Add: explore page; editor privilege views
Diffstat (limited to 'explore.lisp')
-rw-r--r--explore.lisp32
1 files changed, 32 insertions, 0 deletions
diff --git a/explore.lisp b/explore.lisp
new file mode 100644
index 0000000..f562448
--- /dev/null
+++ b/explore.lisp
@@ -0,0 +1,32 @@
+;;; explore.lisp
+
+(in-package :vampire)
+
+(defun create-media-search-area (parent)
+ (with-clog-create parent
+ (p (:content "media search area"))))
+
+(defun create-playlist-explore-card (parent pl)
+ (with-clog-create parent
+ (div ()
+ (img (:bind thumb))
+ (section (:h4)
+ (a (:link (url-to-playlist pl) :content (playlist-title pl)))
+ (span (:content " -- "))
+ (span (:content (secs-to-hms (playlist-duration pl))))))
+ (setf (maximum-width thumb) "120px")
+ (when-let (track (first (playlist-tracks pl)))
+ (setf (url-src thumb) (or (track-thumb-url track) "")))))
+
+(defun create-recent-playlists-area (parent)
+ (let* ((container (create-div parent)))
+ (dolist (pl (recent-playlists 10))
+ (create-playlist-explore-card container pl))))
+
+(defun explore-page (body)
+ (with-clog-create body
+ (div ()
+ (navigation-header ())
+ ;(media-search-area ())
+ (section (:h2 :content "Recent Playlists"))
+ (recent-playlists-area ()))))