aboutsummaryrefslogtreecommitdiff
path: root/module
diff options
context:
space:
mode:
Diffstat (limited to 'module')
-rw-r--r--module/calp/html/vcomponent.scm4
-rw-r--r--module/calp/server/routes.scm4
-rw-r--r--module/web/http/make-routes.scm1
-rw-r--r--module/web/query.scm13
-rw-r--r--module/web/uri-query.scm4
5 files changed, 17 insertions, 9 deletions
diff --git a/module/calp/html/vcomponent.scm b/module/calp/html/vcomponent.scm
index 574ad954..9e70f910 100644
--- a/module/calp/html/vcomponent.scm
+++ b/module/calp/html/vcomponent.scm
@@ -481,7 +481,7 @@
;; description in sidebar / tab of popup
;; Template data for <vevent-description />
(define-public (description-template)
- '(template
+ `(template
(@ (id "vevent-description"))
(div (@ (class " vevent eventtext summary-tab " ()))
(h3 ((span (@ (class "repeating"))
@@ -563,7 +563,7 @@
(dd (input-list (@ (name ,name))
(input (@ (type "number")
(min ,min) (max ,max)))))))
- '((bysecond ,(_ "By Second") 0 60)
+ `((bysecond ,(_ "By Second") 0 60)
(byminute ,(_ "By Minute") 0 59)
(byhour ,(_ "By Hour") 0 23)
(bymonthday ,(_ "By Month Day") -31 31) ; except 0
diff --git a/module/calp/server/routes.scm b/module/calp/server/routes.scm
index 2e8f1131..762681d9 100644
--- a/module/calp/server/routes.scm
+++ b/module/calp/server/routes.scm
@@ -71,7 +71,7 @@
(drop-right 1)
(xcons "/static")
path-join)))
- "Return up")))
+ ,(_ "Return up"))))
,@(map (lambda (k)
(let* ((stat (lstat (path-append prefix dir k))))
`(tr (td ,(case (stat:type stat)
@@ -447,7 +447,7 @@
(lambda ()
((sxml->output html)
(xhtml-doc
- (head (title (_ "Calp directory listing for ") path)
+ (head (title ,(_ "Calp directory listing for ") path)
,(include-css
"/static/directory-listing.css"))
(body ,(directory-table (static-dir) path))))))))
diff --git a/module/web/http/make-routes.scm b/module/web/http/make-routes.scm
index 11f7dfb4..105bba50 100644
--- a/module/web/http/make-routes.scm
+++ b/module/web/http/make-routes.scm
@@ -102,6 +102,7 @@
(append
((@ (web query) parse-query) r:query)
+ ;; TODO what's happening here?
(let ((content-type (assoc-ref r:headers 'content-type)))
((@ (hnh util) when) content-type
(let ((type (car content-type))
diff --git a/module/web/query.scm b/module/web/query.scm
index e5057a24..a70903bc 100644
--- a/module/web/query.scm
+++ b/module/web/query.scm
@@ -8,9 +8,12 @@
(fold (lambda (str list)
;; only split on the first equal.
;; Does HTTP allow multiple equal signs in a data field?
- ;; NOTE that this fails if str lacks an equal sign.
- (define idx (string-index str #\=))
- (define key (uri-decode (substring str 0 idx) encoding: encoding))
- (define val (uri-decode (substring str (1+ idx)) encoding: encoding))
- (cons* (-> key string->symbol symbol->keyword) val list))
+ (let* ((key val
+ (cond ((string-index str #\=)
+ => (lambda (idx)
+ (values (uri-decode (substring str 0 idx) encoding: encoding)
+ (uri-decode (substring str (1+ idx)) encoding: encoding))))
+ (else (let ((v (uri-decode str encoding: encoding)))
+ (values v v))))))
+ (cons* (-> key string->symbol symbol->keyword) val list)))
'() (string-split query-string #\&))))
diff --git a/module/web/uri-query.scm b/module/web/uri-query.scm
index 40d89b11..56f3aef9 100644
--- a/module/web/uri-query.scm
+++ b/module/web/uri-query.scm
@@ -3,6 +3,10 @@
:use-module ((web uri) :select (uri-encode))
)
+;; TODO why this format for values?
+;; TODO why aren't we encoding the keys?
+;; TODO why isn't this in the same module as `parse-query'?
+;; TODO why isn't this on the same format as `parse-query'?
(define-public (encode-query-parameters parameters)
(string-join