Be able to load a form from disk

This commit is contained in:
Marcus Kammer 2024-06-15 13:51:47 +02:00
parent 80fbaccf68
commit 16ad1e6c77
Signed by: marcuskammer
GPG key ID: C374817BE285268F

View file

@ -1,5 +1,14 @@
(in-package :ml-survey/views) (in-package :ml-survey/views)
(defun load-form (lang form-file-name)
"Load a Lisp file containing form definitions."
(let* ((relative-path (concatenate 'string "src/views/forms/" lang "/"))
(full-path (merge-pathnames relative-path *default-pathname-defaults*))
(form-path (merge-pathnames form-file-name full-path)))
(unless (probe-file form-path)
(error "Form file ~A does not exist." form-path))
(load form-path)))
(defun sus-form-en (survey-id) (defun sus-form-en (survey-id)
(with-page (:title "SUS Form") (with-page (:title "SUS Form")
(navbar-en) (navbar-en)