From 35c56844aac23acfcf898353a4b31e9d76f74a6c Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Mon, 10 Sep 2012 10:13:57 +0200 Subject: Bootstrap post page --- tekuti/page-helpers.scm | 74 +++++++++++++++++++++++++++++-------------------- tekuti/page.scm | 7 +++-- 2 files changed, 49 insertions(+), 32 deletions(-) diff --git a/tekuti/page-helpers.scm b/tekuti/page-helpers.scm index 194c3ef..bdaa970 100644 --- a/tekuti/page-helpers.scm +++ b/tekuti/page-helpers.scm @@ -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")) diff --git a/tekuti/page.scm b/tekuti/page.scm index 75ef70f..1fa57f7 100644 --- a/tekuti/page.scm +++ b/tekuti/page.scm @@ -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 -- cgit v1.2.3-54-g00ecf