Permalink
Browse files

Not so deep indentation for `with-request-variables' body

Signed-off-by: Christian Kellermann <ckeen@pestilenz.org>
  • Loading branch information...
1 parent 235ce59 commit 767da31ca695f4ba3f863e84da66903859bbbe40 @mario-goulart mario-goulart committed with Jul 26, 2012
Showing with 51 additions and 51 deletions.
  1. +51 −51 pastiche.scm
View
@@ -271,57 +271,57 @@
(title (nonempty as-string))
paste
id)
- (html-page
- (++
- (<div> id: "content"
- (or (and-let* ((nick (or (and nick (htmlize nick)) "anonymous"))
- (title (or (and title (htmlize title)) "no title"))
- (time (current-seconds))
- (paste (and (not (equal? "" paste)) paste))
- (hashsum (string->sha1sum
- (++ nick title (->string time) paste)))
- (url '())
- (snippet (map
- (lambda (i)
- (if (and (string? i) (string-null? i))
- "anonymous"
- i))
- (list nick title time paste))))
- (if (and use-captcha?
- (not (equal? ($ 'captcha-user-answer)
- (and-let* ((hash ($ 'captcha-hash))
- (captcha (alist-ref hash captchas equal?)))
- (captcha-string captcha)))))
- (bail-out "Wrong captcha answer.")
- (if (string-null? paste)
- (bail-out "I am not storing empty pastes.")
- (begin (cond ((fetch-paste id)
- => (lambda (p)
- (let ((count (+ 1 (length (cdr p)))))
- (update-paste id snippet)
- (set! url (make-pathname
- base-path
- (++ "paste?id=" id "#a" (->string count)))))))
- (else (insert-paste hashsum snippet)
- (set! url (make-pathname base-path (++ "paste?id=" hashsum)))))
- (set! paste-title title)
- (when ($ 'notify-irc) (notify nick title url))
- (++ (<h2> align: "center" "Thanks for your paste!")
- (<p> "Hi " nick ", thanks for pasting: " (<em> title) (<br>))
- (<p> align: "center") "Your paste can be reached with this url: " (link url url))))))
- (cond ((fetch-paste id)
- => (lambda (p)
- (set! paste-title (third (last p)))
- (++
- (format-all-snippets p)
- (<div> id: "paste-footer"
- (<h2> align: "center"
- (link (++ base-path "?id=" id
- ";annotate=t") "Annotate this paste!"))))))
- (else (bail-out "Could not find a paste with this id:" id)))))
- (navigation-links))
- css: (page-css)
- title: paste-title)))))
+ (html-page
+ (++
+ (<div> id: "content"
+ (or (and-let* ((nick (or (and nick (htmlize nick)) "anonymous"))
+ (title (or (and title (htmlize title)) "no title"))
+ (time (current-seconds))
+ (paste (and (not (equal? "" paste)) paste))
+ (hashsum (string->sha1sum
+ (++ nick title (->string time) paste)))
+ (url '())
+ (snippet (map
+ (lambda (i)
+ (if (and (string? i) (string-null? i))
+ "anonymous"
+ i))
+ (list nick title time paste))))
+ (if (and use-captcha?
+ (not (equal? ($ 'captcha-user-answer)
+ (and-let* ((hash ($ 'captcha-hash))
+ (captcha (alist-ref hash captchas equal?)))
+ (captcha-string captcha)))))
+ (bail-out "Wrong captcha answer.")
+ (if (string-null? paste)
+ (bail-out "I am not storing empty pastes.")
+ (begin (cond ((fetch-paste id)
+ => (lambda (p)
+ (let ((count (+ 1 (length (cdr p)))))
+ (update-paste id snippet)
+ (set! url (make-pathname
+ base-path
+ (++ "paste?id=" id "#a" (->string count)))))))
+ (else (insert-paste hashsum snippet)
+ (set! url (make-pathname base-path (++ "paste?id=" hashsum)))))
+ (set! paste-title title)
+ (when ($ 'notify-irc) (notify nick title url))
+ (++ (<h2> align: "center" "Thanks for your paste!")
+ (<p> "Hi " nick ", thanks for pasting: " (<em> title) (<br>))
+ (<p> align: "center") "Your paste can be reached with this url: " (link url url))))))
+ (cond ((fetch-paste id)
+ => (lambda (p)
+ (set! paste-title (third (last p)))
+ (++
+ (format-all-snippets p)
+ (<div> id: "paste-footer"
+ (<h2> align: "center"
+ (link (++ base-path "?id=" id
+ ";annotate=t") "Annotate this paste!"))))))
+ (else (bail-out "Could not find a paste with this id:" id)))))
+ (navigation-links))
+ css: (page-css)
+ title: paste-title)))))
(define-page "paste" handle-paste method: 'POST no-template: #t)
(define-page "paste" handle-paste method: 'GET no-template: #t)

0 comments on commit 767da31

Please sign in to comment.