From 16ad1e6c7796c75dff813c79aa3f8558690fd33e Mon Sep 17 00:00:00 2001 From: Marcus Kammer Date: Sat, 15 Jun 2024 13:51:47 +0200 Subject: [PATCH] Be able to load a form from disk --- src/views/sus.lisp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/views/sus.lisp b/src/views/sus.lisp index 6e8749c..ed573c2 100644 --- a/src/views/sus.lisp +++ b/src/views/sus.lisp @@ -1,5 +1,14 @@ (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) (with-page (:title "SUS Form") (navbar-en)