From b6faf6fded2ef5eeca6ca4d3f3097e857a013ac8 Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Sun, 9 Sep 2012 01:27:24 +0200 Subject: Turn footer into small * tekuti/template.scm (templatize): Replace `div.footer' with `p small', looks more like fine-print. --- tekuti/template.scm | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/tekuti/template.scm b/tekuti/template.scm index c472b12..874dc22 100644 --- a/tekuti/template.scm +++ b/tekuti/template.scm @@ -42,6 +42,7 @@ (let lp ((in (cdr l)) (out (list (car l)))) (cond ((null? in) (reverse out)) (else (lp (cdr in) (cons* (car in) infix out))))))) + (define (make-navbar) `((div (@ (class "navbar navbar-inverse navbar-fixed-top")) (div (@ (class "navbar-inner")) @@ -82,11 +83,11 @@ ,@(make-navbar) (div (@ (class "container")) (div (@ (id "content")) ,@body) - (div (@ (id "footer")) - "powered by " - (a (@ (href "http://wingolog.org/software/tekuti/")) - "tekuti") - ", " - (a (@ (href "http://twitter.github.com/bootstrap/")) - "bootstrap"))) + (p (small + "powered by " + (a (@ (href "http://wingolog.org/software/tekuti/")) + "tekuti") + ", " + (a (@ (href "http://twitter.github.com/bootstrap/")) + "bootstrap")))) (script (@ (src ,*bootstrap-base* "/js/bootstrap.min.js")))))) -- cgit v1.2.3-54-g00ecf 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 From 4258614af9f6776f3aaa56feab4c78f4b49451ec Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Mon, 10 Sep 2012 10:58:32 +0200 Subject: Bootstrap admin page --- tekuti/page-helpers.scm | 93 +++++++++++++++++++++++++++++++------------------ tekuti/page.scm | 19 +++++----- 2 files changed, 71 insertions(+), 41 deletions(-) diff --git a/tekuti/page-helpers.scm b/tekuti/page-helpers.scm index bdaa970..2f99117 100644 --- a/tekuti/page-helpers.scm +++ b/tekuti/page-helpers.scm @@ -154,43 +154,70 @@ (form (@ (method "POST") (action ,(if post (relurl `("admin" "modify-post" ,(post-key post))) - (relurl '("admin" "new-post"))))) - (p (input (@ (name "title") (type "text") - (value ,(if post (post-title post) "")))) - (label (@ (for "title")) " <- title")) - (p (input (@ (name "tags") (type "text") - (value ,(if post - (string-join (post-tags post) ", ") - "")))) - (label (@ (for "tags")) " <- tags, comma-separated")) - (p (input (@ (name "date") (type "text") - (value ,(if (and=> post post-published?) - (timestamp->rfc822-date (post-timestamp post)) - "")))) - (label (@ (for "date")) " <- date (empty == now)")) - (p (input (@ (name "comments") (type "checkbox") - ,@(if (or (not post) (post-comments-open? post)) - `((checked "checked")) '()))) - (label (@ (for "comments")) " comments open?")) - (div (textarea (@ (name "body") (rows "20") (cols "60")) - ,(if post (post-raw-content post) ""))) - (input (@ (type "submit") (name "status") - (value "publish"))) - " " - (input (@ (type "submit") (name "status") - (value "draft")))) + (relurl '("admin" "new-post")))) + (class "form-horizontal")) + (div (@ (class "control-group")) + (label (@ (class "control-label") (for "title")) "Title") + (div (@ (class "controls")) + (input (@ (type "text") (name "title") (id "title") + (value ,(if post (post-title post) "")) + (class "span6") + (placeholder "New post"))))) + (div (@ (class "control-group")) + (label (@ (class "control-label") (for "tags")) + "Tags, comma-separated") + (div (@ (class "controls")) + (input (@ (type "text") (name "tags") (id "tags") + (value ,(if post + (string-join (post-tags post) + ", ") + "")) + (class "span6"))))) + (div (@ (class "control-group")) + (label (@ (class "control-label") (for "date")) + "Date (empty == now)") + (div (@ (class "controls")) + (input (@ (type "text") (name "date") (id "date") + (value ,(if (and=> post post-published?) + (timestamp->rfc822-date + (post-timestamp post)) + "")) + (class "span6") (placeholder "Now"))))) + (div (@ (class "control-group")) + (div (@ (class "controls")) + (label (@ (class "checkbox")) + (input (@ (type "checkbox") (name "comments") + ,@(if + (or (not post) + (post-comments-open? post)) + `((checked "checked")) '()))) + " comments open?"))) + (div (@ (class "control-group")) + (div (@ (class "controls")) + (textarea (@ (name "body") (rows "20") (cols "60") + (class "span6")) + ,(if post (post-raw-content post) "")))) + (div (@ (class "control-group")) + (div (@ (class "controls")) + (input (@ (type "submit") (name "status") + (value "publish") + (class "btn btn-primary"))) + " " + (input (@ (type "submit") (name "status") + (value "draft") (class "btn")))))) ,@(if post `((form (@ (method "POST") (action ,(relurl `("admin" "delete-post" ,(post-key post))))) " " - (input (@ (type "submit") (name "delete") (value "delete")))) - ,@(let ((l (comments-sxml-content-edit post))) - (if (null? l) l - `((h2 "comments") - (ol (@ (class "commentlist")) ,@l)))) - (h2 "preview") - ,(show-post post #f)) - '()))) + ,@(let ((l (comments-sxml-content-edit post))) + (if (null? l) l + `((h2 "comments") + (ol (@ (class "commentlist")) ,@l)))) + (h2 "preview") + ,(show-post post #f) + (input (@ (type "submit") (name "delete") + (value "delete") (class "btn btn-primary"))))) + '()))) (define (sidebar-ul body) `(div (@ (id "menu")) diff --git a/tekuti/page.scm b/tekuti/page.scm index 1fa57f7..cf916d5 100644 --- a/tekuti/page.scm +++ b/tekuti/page.scm @@ -83,14 +83,17 @@ `(li ,(rellink `("admin" "changes" ,(car rev)) (caddr rev)))) (git-rev-list "refs/heads/master" n))) - (respond `(,(sidebar-ul `((li (h2 "posts " ,(rellink '("admin" "posts") - ">>")) - (ul ,@(post-links 5))) - (li (h2 "changes" ,(rellink '("admin" "changes") - ">>")) - (ul ,(recent-changes 5))))) - (h2 "new post") - ,(post-editing-form #f)))))) + (respond `((div (@ (class "row")) + (div (@ (class "span9")) + (h2 "new post") + ,(post-editing-form #f)) + (div (@ (class "span3")) + (h2 "posts " ,(rellink '("admin" "posts") + ">>")) + (ul ,@(post-links 5)) + (h2 "changes " ,(rellink '("admin" "changes") + ">>")) + (ul ,(recent-changes 5))))))))) (define (page-admin-posts request body index) (with-authentication -- cgit v1.2.3-54-g00ecf From 5366157a75957579bd4ff6c1aed22ba695febef8 Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Mon, 10 Sep 2012 11:03:49 +0200 Subject: Remove sidebar-ul --- tekuti/page-helpers.scm | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/tekuti/page-helpers.scm b/tekuti/page-helpers.scm index 2f99117..66a7b42 100644 --- a/tekuti/page-helpers.scm +++ b/tekuti/page-helpers.scm @@ -42,7 +42,7 @@ relurl rellink post-url post-editing-form - sidebar-ul top-tags tag-cloud + top-tags tag-cloud main-sidebar post-sidebar related-tag-cloud post-link admin-post-url admin-post-link show-post with-authentication @@ -219,10 +219,6 @@ (value "delete") (class "btn btn-primary"))))) '()))) -(define (sidebar-ul body) - `(div (@ (id "menu")) - (ul ,@body))) - (define (admin-post-url post) (relurl `("admin" "posts" ,(post-key post)))) -- cgit v1.2.3-54-g00ecf From be1d54ad32c69ed5577c664da8b4f011f82d281f Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Mon, 10 Sep 2012 11:05:43 +0200 Subject: Bootstrap change page --- tekuti/page.scm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tekuti/page.scm b/tekuti/page.scm index cf916d5..912f85b 100644 --- a/tekuti/page.scm +++ b/tekuti/page.scm @@ -176,7 +176,9 @@ (pre ,(git "diff-tree" "-M" "-p" sha1)) (form (@ (action ,(relurl `("admin" "revert-change" ,sha1))) (method "POST")) - (input (@ (type "submit") (value "Undo this change")))))))))) + (input (@ (type "submit") + (class "btn btn-primary") + (value "Undo this change")))))))))) (define (page-admin-revert-change request body index sha1) -- cgit v1.2.3-54-g00ecf