aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2020-08-12 06:47:49 +0200
committerHugo Hörnquist <hugo@lysator.liu.se>2020-08-12 06:47:49 +0200
commitaa1670d5a0973ef52f75d7771ccfc7f0f5807e1b (patch)
treec680c4f16fcc662a4cc0cbd5bb4cdb618dbb19c6
parentMerge branch 'master' into calchooser (diff)
downloadcalp-aa1670d5a0973ef52f75d7771ccfc7f0f5807e1b.tar.gz
calp-aa1670d5a0973ef52f75d7771ccfc7f0f5807e1b.tar.xz
Slightly clean up server imports.
-rw-r--r--module/entry-points/server.scm17
-rw-r--r--module/html/view/calendar.scm2
-rw-r--r--module/server/macro.scm3
3 files changed, 11 insertions, 11 deletions
diff --git a/module/entry-points/server.scm b/module/entry-points/server.scm
index dc675813..ec9d3c3f 100644
--- a/module/entry-points/server.scm
+++ b/module/entry-points/server.scm
@@ -1,6 +1,5 @@
(define-module (entry-points server)
:use-module (util)
- :use-module (util config)
:use-module (util options)
:use-module (util exceptions)
@@ -9,11 +8,9 @@
:use-module (ice-9 match)
:use-module (ice-9 control)
- :use-module (ice-9 rdelim)
- :use-module (ice-9 curried-definitions)
- :use-module (ice-9 ftw)
+ :use-module ((ice-9 rdelim) :select (read-string))
+ :use-module ((ice-9 ftw) :select (scandir))
:use-module (ice-9 getopt-long)
- :use-module (ice-9 iconv)
:use-module (ice-9 regex) #| regex here due to bad macros |#
:use-module (web server)
@@ -38,6 +35,7 @@
:autoload (vcomponent instance) (global-event-object)
:use-module (html view calendar)
+ :use-module ((html view search) :select (search-result-page))
:export (main)
)
@@ -101,8 +99,7 @@
;; It would be much better if most of the page could still make it.
(GET "/week/:start-date.html" (start-date)
(let* ((start-date
- (start-of-week (parse-iso-date start-date)
- (get-config 'week-start))))
+ (start-of-week (parse-iso-date start-date))))
(return `((content-type application/xhtml+xml))
(with-output-to-string
@@ -132,8 +129,8 @@
prev-start: month-
render-calendar: (@ (html view calendar month)
render-calendar-table)
- pre-start: (start-of-week start-date (get-config 'week-start))
- post-end: (end-of-week (end-of-month start-date) (get-config 'week-start))
+ pre-start: (start-of-week start-date)
+ post-end: (end-of-week (end-of-month start-date))
intervaltype: 'month
))))))
@@ -332,7 +329,7 @@
(with-output-to-string
(lambda ()
(sxml->xml
- ((@ (html view search) search-result-page)
+ (search-result-page
search-term search-result page paginator q=))))))
;; NOTE this only handles files with extensions. Limited, but since this
diff --git a/module/html/view/calendar.scm b/module/html/view/calendar.scm
index 72fcccbd..ed6ea066 100644
--- a/module/html/view/calendar.scm
+++ b/module/html/view/calendar.scm
@@ -304,6 +304,8 @@
;; but "spill" into our time span.
(section (@ (class "text-day"))
(header (h2 "Tidigare"))
+ ;; TODO this group gets styles applied incorrectly.
+ ;; Figure out way to merge it with the below call.
,@(stream->list
(stream-map
fmt-single-event
diff --git a/module/server/macro.scm b/module/server/macro.scm
index b6983c7e..15bc0d0a 100644
--- a/module/server/macro.scm
+++ b/module/server/macro.scm
@@ -92,7 +92,8 @@
(args (cdr content-type)))
(when (eq? type 'application/x-www-form-urlencoded)
(let ((encoding (or (assoc-ref args 'encoding) "UTF-8")))
- (parse-query (bytevector->string body encoding)
+ (parse-query ((@ (ice-9 iconv) bytevector->string)
+ body encoding)
encoding)))))))))))
(case-lambda ((headers body new-state) (values headers body new-state))
((headers body) (values headers body state))