summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Okay <colin@cicadas.surf>2022-10-27 14:51:23 -0500
committerColin Okay <colin@cicadas.surf>2022-10-27 14:51:23 -0500
commitf80c82597ffcf3a65cc49ffca8f3b7ffa8117c27 (patch)
tree8d0094933ebfaff490319cecf9e3c94ee5c316c4
parentc5f0f6c32f3aa5ce2cac56e10585dac49617dec7 (diff)
Add: navigation header
-rw-r--r--navigation.lisp9
-rw-r--r--playlist.lisp1
-rw-r--r--user.lisp9
-rw-r--r--vampire.asd1
4 files changed, 15 insertions, 5 deletions
diff --git a/navigation.lisp b/navigation.lisp
new file mode 100644
index 0000000..4f73917
--- /dev/null
+++ b/navigation.lisp
@@ -0,0 +1,9 @@
+;;;; navigation
+
+(in-package :vampire)
+
+(defun create-navigation-header (parent)
+ (with-clog-create parent
+ (unordered-list ()
+ (list-item () (a (:link "/home" :content "Home")))
+ (list-item () (a (:link "/explore" :content "Explore"))))))
diff --git a/playlist.lisp b/playlist.lisp
index d7b08f1..8b4b4e6 100644
--- a/playlist.lisp
+++ b/playlist.lisp
@@ -306,6 +306,7 @@
(install-new-playlist-ctl pl body)))
(with-clog-create body
(div ()
+ (navigation-header ())
(section (:h2)
(:span (:bind title-elem :content (playlist-title pl)))
(form-element (:text :bind input))
diff --git a/user.lisp b/user.lisp
index 6f95b2c..c0ec8a6 100644
--- a/user.lisp
+++ b/user.lisp
@@ -26,17 +26,15 @@
(new-playlist (session-user parent) :title (value pl-title))
(reload (location (connection-body parent)))))))
-(defun url-to-playlist (pl location)
- (format nil "~a//~a/playlist/~a"
- (protocol location)
- (host location)
+(defun url-to-playlist (pl)
+ (format nil "/playlist/~a"
(key pl)))
(defun create-playlist-listing (parent &rest args)
(declare (ignorable args))
(dolist (pl (user-playlists (session-user parent)))
(let ((url
- (url-to-playlist pl (location (connection-body parent)))))
+ (url-to-playlist pl)))
(with-clog-create parent
(div ()
(section (:h4)
@@ -50,6 +48,7 @@
(defun user-home-page (body)
(with-clog-create body
(div ()
+ (navigation-header ())
(p (:content (format nil "Welcome ~a" (user-name (session-user body)))))
(new-playlist-form ())
(playlist-listing ()))))
diff --git a/vampire.asd b/vampire.asd
index dbde6f1..63d7715 100644
--- a/vampire.asd
+++ b/vampire.asd
@@ -19,6 +19,7 @@
(:file "downloader")
(:file "model")
(:file "session")
+ (:file "navigation")
(:file "new-account")
(:file "login")
(:file "user")