From f80c82597ffcf3a65cc49ffca8f3b7ffa8117c27 Mon Sep 17 00:00:00 2001 From: Colin Okay Date: Thu, 27 Oct 2022 14:51:23 -0500 Subject: Add: navigation header --- navigation.lisp | 9 +++++++++ playlist.lisp | 1 + user.lisp | 9 ++++----- vampire.asd | 1 + 4 files changed, 15 insertions(+), 5 deletions(-) create mode 100644 navigation.lisp 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") -- cgit v1.2.3