 (ns storemi.views.component
-  (:require 
+  (:require
     [hiccup.page :refer [html5 include-css]]
     [storemi.models.db :refer [json-string]]
     [storemi.settings :as settings]
     [storemi.urlfor :as urlfor]))
 
 (defn hidden-field [val & {:keys [name id class]}]
-  (let [props {:type "hidden" 
-               :name name 
+  (let [props {:type "hidden"
+               :name name
                :value (or val "")
                :id id
                :class class}]

    (editing-options)]]
  )




(defn main-nav [& [username]]
  [:span.nav
   (if-not (empty? username)
     (list
       [:a {:href (urlfor/logout)} "logout"]
       [:a {:href (urlfor/user-index username)} "your stories"] )
     (list
       [:a {:href (urlfor/login)} "login"]
       [:a {:href (urlfor/register)} "register"]))
   [:a {:href (urlfor/browse)} "browse"]
   [:a {:href (urlfor/about)} "about"]])

(defn story-creator [{errors :errors :as req}]
  [:form.story-creator
   {:method "POST" :action (urlfor/story-create)}
   [:h4 "Write New Story"]
   [:p "Title "
    [:input {:name "title" :value (get-in req [:params :title])}]
    [:span.error (:title errors)]]
   [:p "Synopsis "]
