diff --git a/README.md b/README.md index 04a26b3..b5bc254 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,12 @@ $ lein deps $ ./bootstrap.sh ``` +Get CodeMirror and mousetrap by updating git submodules (you need to have the actual refheap repo): + +```bash +$ git submodule update --init` +``` + Start the Mongo daemon, and in a separate terminal start the RefHeap server using lein. The server will host content from [http://localhost:3000](http://localhost:3000). ```bash diff --git a/config.clj b/config.clj index 9216215..f12dfe3 100644 --- a/config.clj +++ b/config.clj @@ -1,5 +1,9 @@ -{:db-name "refheap" +{ + :db-name "refheap" :db-port 27017 :db-host "localhost" :hosts #{"localhost"} - :port 8080} \ No newline at end of file + :port 8080 + :default-language "Clojure" + :default-private? false +} \ No newline at end of file diff --git a/src/refheap/views/paste.clj b/src/refheap/views/paste.clj index b0e41e0..d56e83d 100644 --- a/src/refheap/views/paste.clj +++ b/src/refheap/views/paste.clj @@ -1,5 +1,6 @@ (ns refheap.views.paste (:require [refheap.models.paste :as paste] + [refheap.config :refer [config]] [refheap.models.users :as users] [refheap.highlight :refer [lexers]] [refheap.utilities :refer [to-booleany escape-string pluralize safe-parse-long]] @@ -31,13 +32,13 @@ (for [lang (sort #(.compareToIgnoreCase % %2) (keys (dissoc lexers lang)))] (l/on node (l/attr :value lang) (l/content lang)))) - (l/attr? :selected) (let [lang (or lang (:language old) (session/get :last-lang) "Clojure")] + (l/attr? :selected) (let [lang (or lang (:language old) (session/get :last-lang) (:default-language config) "Clojure")] (comp (l/attr :value lang) (l/content lang))) (l/element= :form) (l/attr :action (if old (paste-url old "/edit") "/create")) - (when (:private old) + (when (or (:private old) (:default-private? config) ) [(l/attr= :name :private) (l/attr :checked "")]) (when old [(l/element= :textarea) (l/content (:raw-contents old))])