1
0
Fork 0

Bootstrap post page

This commit is contained in:
Tom Willemsen 2012-09-10 10:13:57 +02:00
parent b6faf6fded
commit 35c56844aa
2 changed files with 49 additions and 32 deletions

View file

@ -214,25 +214,43 @@
(define (comment-form post author email url comment)
`(form
(@ (action ,(post-url post)) (method "POST"))
(p (input (@ (type "text") (name "author") (value ,author)
(size "22") (tabindex "1")))
" " (label (@ (for "author")) (small "Name")))
(p (input (@ (type "text") (name "email") (value ,email)
(size "22") (tabindex "2")))
" " (label (@ (for "email")) (small "Mail (will not be published)")))
(p (input (@ (type "text") (name "url") (value ,url)
(size "22") (tabindex "3")))
" " (label (@ (for "url")) (small "Website")))
(p (input (@ (type "text") (name "x") (value "")
(size "22") (tabindex "3")))
" " (label (@ (for "x")) (small "What's your favorite number?")))
;(p (small "allowed tags: "))
(p (textarea (@ (name "comment") (id "comment") (cols "65")
(rows "10") (tabindex "4"))
,comment))
(p (input (@ (name "submit") (type "submit") (id "submit") (tabindex "5")
(value "Submit Comment"))))))
(@ (action ,(post-url post)) (method "POST")
(class "form-horizontal"))
(div (@ (class "control-group"))
(label (@ (class "control-label") (for "author")) "Name")
(div (@ (class "controls"))
(input (@ (type "text") (name "author") (id "author")
(value ,author) (tabindex "1") (class "span6")
(placeholder "Your Name")))))
(div (@ (class "control-group"))
(label (@ (class "control-label") (for "email"))
"Mail (will not be published)")
(div (@ (class "controls"))
(input (@ (type "text") (name "email") (id "email")
(value ,email) (tabindex "2") (class "span6")
(placeholder "you@somehost.com")))))
(div (@ (class "control-group"))
(label (@ (class "control-label") (for "url")) "Website")
(div (@ (class "controls"))
(input (@ (type "text") (name "url") (id "url")
(value ,url) (tabindex "3") (class "span6")
(placeholder "http://your.website.com")))))
(div (@ (class "control-group"))
(label (@ (class "control-label") (for "x"))
"What's your favorite number?")
(div (@ (class "controls"))
(input (@ (type "text") (name "x") (id "x") (value "")
(tabindex "3") (class "span6")))))
(div (@ (class "control-group"))
(div (@ (class "controls"))
(textarea (@ (name "comment") (id "comment") (cols "65")
(rows "10") (tabindex "4") (class "span6"))
,comment)))
(div (@ (class "control-group"))
(div (@ (class "controls"))
(button (@ (type "submit") (class "btn btn-primary")
(name "submit") (id "submit") (tabindex "5"))
"Submit Comment")))))
(define (comments-sxml-content-edit post)
(map
@ -336,17 +354,13 @@
,@(tag-cloud (top-tags index 30))))
(define (post-sidebar post index)
(sidebar-ul
`((li (h2 (a (@ (href ,(relurl '("feed" "atom"))))
"subscribe "
(img (@ (src ,(relurl '("wp-content" "feed-icon-14x14.png")))
(alt "[feed]")))
)))
(li (h2 "related")
(ul ,@(map (lambda (post-and-tags)
`(li (@ (style "margin-top: 5px"))
,(post-link (car post-and-tags))))
(take-max (compute-related-posts post index) 10)))))))
`((h2 (a (@ (href ,(relurl '("feed" "atom"))))
"subscribe "))
(h2 "related")
(ul ,@(map (lambda (post-and-tags)
`(li (@ (style "margin-top: 5px"))
,(post-link (car post-and-tags))))
(take-max (compute-related-posts post index) 10)))))
(define (related-tag-cloud tag index)
`(div (@ (id "tag-cloud"))

View file

@ -198,8 +198,11 @@
(cond
((post-from-key index (make-post-key year month day post))
=> (lambda (post)
(respond `(,(post-sidebar post index)
,(show-post post #t))
(respond `((div (@ (class "row"))
(div (@ (class "span9"))
,(show-post post #t))
(div (@ (class "span3"))
,(post-sidebar post index))))
#:title (string-append (post-title post) " -- " *title*)
#:etag (assq-ref index 'master))))
(else