Yu-Gi-Oh! Deck Building and Card Inventory Management web interface written in Common Lisp, utilizing HTMX.
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
- (in-package #:cl-deck-builder2.web.flash-message)
-
- (defvar *flash-messages* '())
-
- (defclass flash-message ()
- ((body :accessor flash-body-of
- :initarg :body)
- (class :accessor flash-class-of
- :initarg :class)
- (title :accessor flash-title-of
- :initarg :title)))
-
- (defun flash (class title body)
- "Essentially HASH-TABLE-PUSH: helper function to PUSHNEW a VALUE associated with KEY to *SESSION* HASH-TABLE."
- (let ((obj (make-instance 'flash-message
- :class class
- :title title
- :body body)))
- (push obj *flash-messages*)
- (flash-body-of obj)))
-
- (defun flash-gethash ()
- (let ((messages *flash-messages*))
- (setf *flash-messages* '())
- (reverse messages)))
-
- ;; error -> is-danger
- (defun flash-error (msg)
- (flash "is-danger" "Error" (princ-to-string msg)))
-
- ;; message -> is-success
- (defun flash-message (msg)
- (flash "is-success" "Success" (princ-to-string msg)))
-
- ;; info -> is-info
- (defun flash-info (title msg)
- (flash "is-info" title (princ-to-string msg)))
-
- ;; link -> is-link
- (defun flash-link (title msg)
- (flash "is-link" title (princ-to-string msg)))
-
- ;; primary -> is-primary
- (defun flash-primary (title msg)
- (flash "is-primary" title (princ-to-string msg)))
-
- ;; warning -> is-warning
- (defun flash-warning (msg)
- (flash "is-warning" "warning" (princ-to-string msg)))
|