js loading made optional

This commit is contained in:
Christian Mueller
2012-06-05 22:39:15 +02:00
parent a05ac74185
commit 6dbfaa058b
2 changed files with 88 additions and 80 deletions
+13 -5
View File
@@ -91,18 +91,26 @@
(rule "h1, h2, h3, h4"
:font-family (gen-comma-list "'Noticia Text'" "'PT Serif'"))))
(defpartial layout [title & content]
(defpartial generate-layout
[params title & content]
(html5
[:head
[:title "NoteHub — " title]
(include-js "https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js")
[:link {:href (str "http://fonts.googleapis.com/css?family="
"PT+Serif:700|Noticia+Text:700"
"&subset=latin,cyrillic" )
:rel "stylesheet"
:type "text/css"}]
[:style {:type "text/css"} global-css]]
[:body
content
(if (params :js)
[:body content
(javascript-tag "var CLOSURE_NO_DEPS = true;")
(include-js "/cljs/main.js")]))
(include-js "https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js")
(include-js "/cljs/main.js")]
[:body content])))
(defn layout [& args]
(if (map? (first args))
(apply generate-layout args)
(apply generate-layout {} args)))
+1 -1
View File
@@ -58,7 +58,7 @@
; New Note Page
(defpage "/new" {}
(common/layout "New Markdown Note"
(common/layout {:js true} "New Markdown Note"
[:div.central-element
(form-to [:post "/post-note"]
(hidden-field :session-key (get-flash-key))