|
|
|
@ -22,7 +22,8 @@
|
|
|
|
|
#:create-thumbnail |
|
|
|
|
#:create-timestamp-id |
|
|
|
|
#:format-filename |
|
|
|
|
#:format-keywords) |
|
|
|
|
#:format-keywords |
|
|
|
|
#:build-alert-string) |
|
|
|
|
(:documentation "Utilities that do not depend on models.")) |
|
|
|
|
|
|
|
|
|
(in-package #:utils) |
|
|
|
@ -84,15 +85,27 @@ POST request."
|
|
|
|
|
(setf (gethash :alert ningle:*session*) |
|
|
|
|
(build-alert-string alert-type "vomit-cat.png" message))) |
|
|
|
|
((string= "success" alert-type) |
|
|
|
|
(setf (gethash :alert ningle:*session*) |
|
|
|
|
(build-alert-string alert-type "success-cat.png" message))) |
|
|
|
|
((string= "missing-data" alert-type) |
|
|
|
|
(setf (gethash :alert ningle:*session*) |
|
|
|
|
(build-alert-string alert-type "sherlock-cat.png" message))) |
|
|
|
|
((string= "invalid-data" alert-type) |
|
|
|
|
(setf (gethash :alert ningle:*session*) |
|
|
|
|
(build-alert-string alert-type "confused-cat.png" message))) |
|
|
|
|
((string= "created" alert-type) |
|
|
|
|
(setf (gethash :alert ningle:*session*) |
|
|
|
|
(build-alert-string alert-type "disco-cat.png" message))) |
|
|
|
|
((string= "warning" alert-type) |
|
|
|
|
(setf (gethash :alert ningle:*session*) |
|
|
|
|
(build-alert-string alert-type "workout-cat.png" message))) |
|
|
|
|
(t (setf (gethash :alert ningle:*session*) message)))) |
|
|
|
|
|
|
|
|
|
(defun build-alert-string (alt-text src-image message) |
|
|
|
|
(defun build-alert-string (alert-text src-image message) |
|
|
|
|
(format nil |
|
|
|
|
"<p class=\"~a\"><img alt=\"~a\" src=\"/images/alerts/~a\">~a</p>" |
|
|
|
|
alt-text |
|
|
|
|
alt-text |
|
|
|
|
alert-text |
|
|
|
|
alert-text |
|
|
|
|
src-image |
|
|
|
|
message)) |
|
|
|
|
|
|
|
|
|