|
|
@ -76,11 +76,25 @@ name. Just specify it in this function's `REQUEST-VALUE' argument." |
|
|
|
(string= request-value (car item))) |
|
|
|
(string= request-value (car item))) |
|
|
|
collect item)) |
|
|
|
collect item)) |
|
|
|
|
|
|
|
|
|
|
|
(defun set-alert (message) |
|
|
|
(defun set-alert (message &optional alert-type) |
|
|
|
"Sets the alert `MESSAGE' stored in session, provide info. to users. |
|
|
|
"Sets the alert `MESSAGE' stored in session, provide info. to users. |
|
|
|
The intention is store a `MESSAGE' across a redirect during a HTTP |
|
|
|
The intention is store a `MESSAGE' across a redirect during a HTTP |
|
|
|
POST request." |
|
|
|
POST request." |
|
|
|
(setf (gethash :alert ningle:*session*) message)) |
|
|
|
(cond ((string= "error" alert-type) |
|
|
|
|
|
|
|
(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 "disco-cat.png" message))) |
|
|
|
|
|
|
|
(t (setf (gethash :alert ningle:*session*) message)))) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(defun build-alert-string (alt-text src-image message) |
|
|
|
|
|
|
|
(format nil |
|
|
|
|
|
|
|
"<p class=\"~a\"><img alt=\"~a\" src=\"/images/alerts/~a\">~a</p>" |
|
|
|
|
|
|
|
alt-text |
|
|
|
|
|
|
|
alt-text |
|
|
|
|
|
|
|
src-image |
|
|
|
|
|
|
|
message)) |
|
|
|
|
|
|
|
|
|
|
|
(defun get-alert () |
|
|
|
(defun get-alert () |
|
|
|
"Get alert message from session data." |
|
|
|
"Get alert message from session data." |
|
|
|