|
|
|
@ -1,9 +1,10 @@ |
|
|
|
(ns NoteHub.views.pages |
|
|
|
(ns NoteHub.views.pages |
|
|
|
(:require [NoteHub.views.common :as common]) |
|
|
|
(:require [NoteHub.views.common :as common]) |
|
|
|
(:use [noir.core :only [defpage]] |
|
|
|
(:use [noir.core :only [defpage]] |
|
|
|
[hiccup.form])) |
|
|
|
[hiccup.form] |
|
|
|
|
|
|
|
[markdown :only [md-to-html-string]])) |
|
|
|
|
|
|
|
|
|
|
|
(defpage "/" [] |
|
|
|
(defpage "/" {} |
|
|
|
(common/layout "Free Markdown Hosting" |
|
|
|
(common/layout "Free Markdown Hosting" |
|
|
|
[:div#hero |
|
|
|
[:div#hero |
|
|
|
[:h1 "NoteHub"] |
|
|
|
[:h1 "NoteHub"] |
|
|
|
@ -12,9 +13,16 @@ |
|
|
|
[:br] |
|
|
|
[:br] |
|
|
|
[:a.button {:href "/new"} "New Page"]])) |
|
|
|
[:a.button {:href "/new"} "New Page"]])) |
|
|
|
|
|
|
|
|
|
|
|
(defpage "/new" [] |
|
|
|
(defpage "/new" {} |
|
|
|
(common/layout "New Markdown Note" |
|
|
|
(common/layout "New Markdown Note" |
|
|
|
[:div.central-body.max-width |
|
|
|
[:div.central-body |
|
|
|
(text-area {:class "max-width"} :write-textarea) |
|
|
|
(form-to [:post "/preview-note"] |
|
|
|
(submit-button {:id "form-button"} "Preview")])) |
|
|
|
(text-area {:class "max-width"} :draft) |
|
|
|
|
|
|
|
(submit-button {:id "preview-button"} "Preview"))])) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
; Actions. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(defpage [:post "/preview-note"] {:keys [draft]} |
|
|
|
|
|
|
|
(common/layout "Preview of ..." |
|
|
|
|
|
|
|
[:article.central-body |
|
|
|
|
|
|
|
(md-to-html-string draft)])) |
|
|
|
|