some attempts at fixing the nil forms

This commit is contained in:
Chris Cochrun 2024-04-25 22:08:05 -05:00
parent e35c29d189
commit 5b988b14ae
2 changed files with 38 additions and 37 deletions

View file

@ -225,26 +225,26 @@
<h3 class="basis-full">2024-2025 Health Form</h3>
<div class="basis-full flex flex-wrap my-4">
<label for="firstname" class="basis-full">What is your first and last name? <span class='inline-block text-[#f39] text-sm'>* required</span></label>
<label for="first-name" class="basis-full">What is your first and last name? <span class='inline-block text-[#f39] text-sm'>* required</span></label>
<br/>
<input type="text" id="firstname" name="firstname" required
<input type="text" id="first-name" name="first-name" required
placeholder="First Name" class="flex-1 form-input {{ $formClasses }}">
<input type="text" id="lastname" name="lastname" required
<input type="text" id="last-name" name="last-name" required
placeholder="Last Name" class="flex-1 form-input {{ $formClasses }}">
</div>
<div class="basis-full my-8">
<div class="">
<label for="birthdate" class="">When were you born? <span class='inline-block text-[#f39] text-sm'>* required</span></label>
<input type="date" id="birthdate" name="birthdate"
<label for="birth-date" class="">When were you born? <span class='inline-block text-[#f39] text-sm'>* required</span></label>
<input type="date" id="birth-date" name="birth-date"
class="form-date {{ $formClasses }}" required>
</div>
</div>
<div class="basis-full flex flex-wrap my-4">
<label for="parentfirstname" class="basis-full">What is your parent's first and last name? <span class='inline-block text-[#f39] text-sm'>* required</span></label>
<input type="text" id="parentfirstname" name="parentfirstname"
<label for="parent-first-name" class="basis-full">What is your parent's first and last name? <span class='inline-block text-[#f39] text-sm'>* required</span></label>
<input type="text" id="parent-first-name" name="parent-first-name"
class="flex-1 form-input {{ $formClasses }}"
placeholder="First Name" required>
<input type="text" id="parentlastname" name="parentlastname"
<input type="text" id="parent-last-name" name="parent-last-name"
class="flex-1 form-input {{ $formClasses }}"
placeholder="Last Name" required>
</div>
@ -265,36 +265,37 @@
</div>
<div class="basis-full flex flex-wrap items-center my-8">
<div class="flex-auto flex flex-wrap items-center">
<label for="cellphone" class="mr-4">Parent Cell phone</label>
<input type="tel" id="cellphone" name="cellphone"
<label for="cell-phone" class="mr-4">Parent Cell phone</label>
<input type="tel" id="cell-phone" name="cell-phone"
class="flex-auto form-input {{ $formClasses }}">
</div>
<div class="flex-auto flex flex-wrap items-center">
<label for="homephone" class="mr-4">Home phone</label>
<input type="tel" id="homephone" name="homephone"
<label for="home-phone" class="mr-4">Home phone</label>
<input type="tel" id="home-phone" name="home-phone"
class="flex-auto form-input {{ $formClasses }}">
</div>
</div>
<div class="basis-full flex flex-wrap my-4">
<label for="add-emergency-contact" class="basis-full">Additional Emergency Contact</label>
<input type="text" id="add-emergency-contact" name="add-emergency-contact"
<label for="additional-emergency-contact" class="basis-full">Additional Emergency Contact</label>
<input type="text" id="additional-emergency-contact"
name="additional-emergency-contact"
class="flex-auto form-input {{ $formClasses }}"
placeholder="Full Name">
<input type="tel" id="add-emergency-contact-phone"
name="add-emergency-contact-phone"
<input type="tel" id="additional-emergency-contact-phone"
name="additional-emergency-contact-phone"
class="flex-auto form-input {{ $formClasses }}"
placeholder="Phone Number">
</div>
<div class="basis-full flex flex-wrap my-4">
<label for="doctor" class="basis-full">Doctor</label>
<input type="text" id="doctorname" name="doctorname"
<label for="doctor-name" class="basis-full">Doctor</label>
<input type="text" id="doctor-name" name="doctor-name"
class="flex-auto form-input {{ $formClasses }}"
placeholder="Doctor's Name">
<input type="text" id="doctorcity" name="doctorcity"
<input type="text" id="doctor-city" name="doctor-city"
class="flex-auto form-input {{ $formClasses }}"
placeholder="Doctor's City">
<input type="tel" id="doctorphone"
name="doctorphone"
<input type="tel" id="doctor-phone"
name="doctor-phone"
class="flex-auto form-input {{ $formClasses }}"
placeholder="Phone Number">
</div>

View file

@ -374,7 +374,6 @@ with the image attached"
(attachment nil))
(loop :for d :in data
:do (progn
(uiop:println d)
(if (string= "first-name" (car d))
(progn
(setf first-name (cdr d))))
@ -397,21 +396,22 @@ with the image attached"
(setf attachment path)
(log:info attachment)))))
(log:info data)
(mail-health-form data attachment)
(cond ((string= registration "now")
(setf (hunchentoot:header-out :HX-Redirect) "https://secure.myvanco.com/L-Z772/campaign/C-13JPJ"))
((string= registration "full")
(setf (tbnl:header-out :HX-Redirect) "https://secure.myvanco.com/L-Z772/campaign/C-13JQE"))
((string= registration "later")
(with-html-string
(:div
:class "mt-8"
(:h2 (format nil
"Thank You ~A!"
(concat
first-name " " last-name)))
(:p :class "text-md"
"If you'd like to pay for your registration go to the donate tab in the top right when you are ready and find the camp registration option.")))))))
(when data
(mail-health-form data attachment)
(cond ((string= registration "now")
(setf (hunchentoot:header-out :HX-Redirect) "https://secure.myvanco.com/L-Z772/campaign/C-13JPJ"))
((string= registration "full")
(setf (tbnl:header-out :HX-Redirect) "https://secure.myvanco.com/L-Z772/campaign/C-13JQE"))
((string= registration "later")
(with-html-string
(:div
:class "mt-8"
(:h2 (format nil
"Thank You ~A!"
(concat
first-name " " last-name)))
(:p :class "text-md"
"If you'd like to pay for your registration go to the donate tab in the top right when you are ready and find the camp registration option."))))))))
(hunchentoot:define-easy-handler (camp-form :uri "/camp-form") ()
(let* ((request-type (hunchentoot:request-method hunchentoot:*request*))