   [stories & [hide-author]]
   [:ul
    (for [{:keys [id title synopsis username]} stories]
-     [:li 
+     [:li
       [:a {:href (urlfor/story username id)} title]
-      (when-not hide-author 
-        [:span " — " synopsis " "]    
+      (when-not hide-author
+        [:span " — " synopsis " "]
         [:i [:a {:href (urlfor/user-index username)}
-             " [ by " username " ]"]])])]) 
+             " [ by " username " ]"]])])])
 
 (defn story-control-list
   ([stories & args]
    [:ul
     (for [{:keys [id title username]} stories]
-      [:li 
-       [:a {:href (urlfor/story username id)} 
+      [:li
+       [:a {:href (urlfor/story username id)}
         title]
        " "
        [:a {:href (urlfor/story-edit username id)} "[edit]"]
        " "
        [:a {:href (urlfor/story-delete username id)} "[delete]"]])]))
 
-(defn input-field 
+(defn input-field
   ([name & {:keys [label errors type value]}]
    (let [fk (keyword name)
          label (or label name)]
-     [:p (str label ": ") 
+     [:p (str label ": ")
       [:input {:name name :value value :type type}]
       [:span.error (fk errors)]])))
 

(ns storemi.views.component
  (: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 
               :value (or val "")
               :id id
               :class class}]

    (editing-options)]]
  )

(defn story-link [story & [title]]
  [:a {:href (urlfor/story (:username story) (:id story))}
   (or (:title story) title)])

(defn user-link [username]
  [:a {:href (urlfor/user-index username)}
   username])


