summaryrefslogtreecommitdiffstats
path: root/main.scm
diff options
context:
space:
mode:
Diffstat (limited to 'main.scm')
-rw-r--r--main.scm24
1 files changed, 13 insertions, 11 deletions
diff --git a/main.scm b/main.scm
index 175c0e1..7aa76e4 100644
--- a/main.scm
+++ b/main.scm
@@ -41,11 +41,14 @@
parent-id)]
[image-or-null (if (or (not image) (eof-object? image) (equal? "" image))
(sql-null)
- image)])
+ image)]
+ [content-or-empty (if (or (not content) (eof-object? content))
+ ""
+ content)])
(execute db "insert into posts
(id, user_id, content, parent_id, jpeg_image)
values (?, ?, ?, ?, ?)"
- id user content parent-id-or-null image-or-null)))
+ id user content-or-empty parent-id-or-null image-or-null)))
(define (vote-to-flush user)
(execute db "insert or ignore into flush_votes (user_id) values (?)"
@@ -174,7 +177,6 @@
"/")
)
-
(define (get-opt opt opts) (find (cut equal? <> opt) opts))
(define (post current-user p . opts)
@@ -219,13 +221,15 @@
[value ""]
[rows "5"]
[cols "50"])))
+ (div (@ [class "image-upload"])
+ (label (@ [for "image"]
+ [style "margin-right:0.1em"])
+ "Add Image")
+ (input (@ [type "file"]
+ [id "image"]
+ [accept "image/jpeg"]
+ [name "image"])))
(input (@ [id "submit"] [type "submit"] [value "Post"]))
- (label (@ [for "image"] [style "margin-left:1em"]) Image:)
- (input (@ [type "file"]
- [id "image"]
- [accept "image/jpeg"]
- [name "image"]
- [style "margin-left:0.5em"]))
))
(define (page inner)
@@ -235,8 +239,6 @@
(link (@ [rel "stylesheet"] [href "/style.css"]))
(meta (@ [name "viewport"] [content "width=device-width, initial-scale=1"])))
(body
-; (h1 "Title")
-; (a (@ [href "/"]) "Back")
,inner
))))))