summaryrefslogtreecommitdiff
path: root/playlist.lisp
diff options
context:
space:
mode:
Diffstat (limited to 'playlist.lisp')
-rw-r--r--playlist.lisp16
1 files changed, 12 insertions, 4 deletions
diff --git a/playlist.lisp b/playlist.lisp
index 5ff57bd..3ddffda 100644
--- a/playlist.lisp
+++ b/playlist.lisp
@@ -400,6 +400,9 @@
(dolist (editor (playlist-editors playlist))
(create-editor-item editor))))))
+(defun url-to-user (user)
+ (format nil "/user/~a" (key user)))
+
(defun playlist-key-from-url (url)
(first (last (ppcre:split "/" (nth 4 (multiple-value-list (quri:parse-uri url)))))))
@@ -424,7 +427,8 @@
(form-element (:text :bind input))
(:span (:content " -- "))
(:span (:bind dur-elem :content (secs-to-hms (playlist-duration pl)))))
- (p (:content (format nil "by ~a" (user-name (playlist-user pl)))))
+ (a (:link (url-to-user (playlist-user pl))
+ :content (format nil "by ~a" (user-name (playlist-user pl)))))
(p (:bind collaborators-elem))
(track-listing (pl))))
(div (:class "row")
@@ -437,9 +441,13 @@
(display title-elem) "inline")
(when (playlist-editors pl)
- (setf (text collaborators-elem)
- (format nil "with help from ~{~a~^, ~}"
- (mapcar #'user-name (playlist-editors pl)))))
+ (setf (inner-html collaborators-elem)
+ (with-output-to-string (out)
+ (princ "with help from " out)
+ (loop for (u . more) on (playlist-editors pl)
+ do (format out "<a href='/user/~a'>~a</a>"
+ (key u) (user-name u))
+ when more do (princ ", " out)))))
(when (editorp ctl)
(setf (attribute title-elem "title") "Click to edit the title.")