summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorGravatar Tom Willemsen2012-09-10 10:13:57 +0200
committerGravatar Tom Willemsen2012-09-10 10:13:57 +0200
commit35c56844aac23acfcf898353a4b31e9d76f74a6c (patch)
treee7ed75a2cd65052c6409997e8886be5608a1cae9
parentb6faf6fded2ef5eeca6ca4d3f3097e857a013ac8 (diff)
downloadtekuti-35c56844aac23acfcf898353a4b31e9d76f74a6c.tar.gz
tekuti-35c56844aac23acfcf898353a4b31e9d76f74a6c.zip
Bootstrap post page
-rw-r--r--tekuti/page-helpers.scm74
-rw-r--r--tekuti/page.scm7
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