diff options
author | Colin Okay <colin@cicadas.surf> | 2022-10-27 14:51:23 -0500 |
---|---|---|
committer | Colin Okay <colin@cicadas.surf> | 2022-10-27 14:51:23 -0500 |
commit | f80c82597ffcf3a65cc49ffca8f3b7ffa8117c27 (patch) | |
tree | 8d0094933ebfaff490319cecf9e3c94ee5c316c4 | |
parent | c5f0f6c32f3aa5ce2cac56e10585dac49617dec7 (diff) |
Add: navigation header
-rw-r--r-- | navigation.lisp | 9 | ||||
-rw-r--r-- | playlist.lisp | 1 | ||||
-rw-r--r-- | user.lisp | 9 | ||||
-rw-r--r-- | vampire.asd | 1 |
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)) @@ -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") |