summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob L. Kreuze <zerodaysfordays@sdf.org>2023-08-11 19:13:48 -0400
committerJakob L. Kreuze <zerodaysfordays@sdf.org>2023-08-11 19:13:48 -0400
commit850c390c93f7f0ecfd0e5e277daa426903c5b58c (patch)
tree8b1be2f422a44496f275131c9b2a848cb867bbe7
parent0c428d2dadac603b0710ee9be9740d789889f1ad (diff)
[rsvp] Hasty rewrite fixes
-rw-r--r--haunt/api.scm2
-rw-r--r--haunt/jakob/dynamic/capabilities/rsvp.scm21
2 files changed, 12 insertions, 11 deletions
diff --git a/haunt/api.scm b/haunt/api.scm
index 6a104dd..de385dd 100644
--- a/haunt/api.scm
+++ b/haunt/api.scm
@@ -105,4 +105,4 @@
(values (wrap-response response) resp-body)))
(format #t "Server started.~%")
-(run-server main-request-handler 'http `(#:addr ,INADDR_ANY #:port (%api-server-port)))
+(run-server main-request-handler 'http `(#:addr ,INADDR_ANY #:port ,(%api-server-port)))
diff --git a/haunt/jakob/dynamic/capabilities/rsvp.scm b/haunt/jakob/dynamic/capabilities/rsvp.scm
index 5acdc2f..25f13b8 100644
--- a/haunt/jakob/dynamic/capabilities/rsvp.scm
+++ b/haunt/jakob/dynamic/capabilities/rsvp.scm
@@ -39,7 +39,7 @@
(define %vanity-length (make-parameter 12))
;; Path where event header images are stored.
-(define %event-image-path-fmt (make-parameter "/home/jakob/event-images/~a.png"))
+(define %event-image-path-fmt (make-parameter "/opt/jakob-dynamic/event-images/~a.png"))
;; Global handle to the RSVP database.
(define conn (connect-to-postgres-paramstring (paramstring-for-dbname "jakob_rsvp")))
@@ -114,7 +114,7 @@ It is a base64 string, encoding `%vanity-length' bytes of randomness."
(define (render-event-rsvp-receipt receipt-code)
- (let ((update-url (absolute-url (format #f "apps/rsvp/event-info?r=~a" receipt-code))))
+ (let ((update-url (absolute-url (format #f "/apps/rsvp/event-info?r=~a" receipt-code))))
`(div
(p "Thanks for registering! Please bookmark or save the following link:"
(a (@ (href ,update-url)) ,update-url))
@@ -225,7 +225,7 @@ It is a base64 string, encoding `%vanity-length' bytes of randomness."
`(div (@ (id "rsvp"))
(div (@ (id "event-info"))
(h1 ,title)
- (img (@ (src ,(get-event-image invitation))
+ (img (@ (src ,(format #f "data:image/png;base64, ~a" (get-event-image (car invitation))))
(style "float: right; margin: 16px;")))
(p "Where: " ,location)
(p "When: " ,date)
@@ -293,7 +293,6 @@ It is a base64 string, encoding `%vanity-length' bytes of randomness."
(input (@ (type "text")
(id "guest-names")
(name "guest-names")
- (required #t)
(size "24")
,@(if guests `((value ,guests)) '()))))
@@ -303,12 +302,14 @@ It is a base64 string, encoding `%vanity-length' bytes of randomness."
(id "submit-form")
(value "Submit")))))
- (h2 "Current RSVPs")
- (table
- ,@(map (match-lambda
- ((name email attending guests)
- `(tr (td ,name) (td ,email) (td ,guests) (td ,attending))))
- rsvps))))))
+ ,@(if (equal? capabilities "1")
+ `((h2 "Current RSVPs")
+ (table
+ ,@(map (match-lambda
+ ((name email attending guests)
+ `(tr (td ,name) (td ,email) (td ,guests) (td ,attending))))
+ rsvps)))
+ `())))))
(define (get-event-invitation invitation-code)
"Handler for reading information about an event."