       [:fieldset
        [:legend "New post - bbcode is not yet supported"]
        ;[:input {:type 'text :name "newpost"}]
+       [:input {:type 'hidden :name "redirecturl" :value (:url request)}]
        [:textarea {:rows 10 :cols 56 :name "newpost"}]
        [:br]
        [:input {:type 'submit :value "Send"}]]]]]])

    [request]
    (db/db-add-row! (:newpost (:params request)) (str request)))

(defroutes app-routes
  ;(GET "/" [] (resource-response "index.html" {:root "public"}))
  ;(ANY "/*" request (html (html-from-request request)))

    (do
      ;(println request) 
      (record-post! request)
      (html-redirect (:redirecturl (:params request)))
      ))
  (GET "/*" request (html (html-from-request request)))
  (route/resources "/")
  (route/not-found "<h1>Page not found<h1>"))
