     (nm "button.pure-button" {:onclick #(edit pos)} "Annotate")))
 
 (defn annotate
-  [index item]
-  (if (false? (editing? index))
-      (nm "div.pure-u-1.pure-u-sm-1-2" [(annotate-button index item)])
+  [pos item]
+  (if (false? (editing? pos))
+      (nm "div.pure-u-1.pure-u-sm-1-2" [(annotate-button pos item)])
       [(nm "div.pure-u-1.pure-u-sm-1-2"
-           [(nm "button.pure-button" {:onclick #(close index)} "Close")])
+           [(nm "button.pure-button" {:onclick #(close-editor pos)} "Close")])
        (nm "div.pure-u-1-1.pure-u-sm-1"
-           [(annotate-editor index item)])]))
+           [(annotate-editor pos item)])]))
+
+(defn item-detail
+  [pos item]
+  (if (and (get item "mtime" false) (opened? pos))
+    (let [title (get item "title")]
+      (nm "div.pure-u-1-1.pure-u-sm-1" title))))
 
 (defn node
   "Renders one node from tree with indentation"

        level (count parts)
        base (last parts)
        icon (if (blob? item) (ftype-to-icon base) (nm "i.ftype.fa.fa-folder-open-o"))]
    (nm "div.pure-g" [(nm "div.pure-u-1.pure-u-sm-1-2" [(nm (str "div.level" level) [icon base])])
                      (annotate index item)])))

(defn reporender
  "Render repository trees"


(defn querydb [fields]
  (get-in db fields))


;; Utils

(defn blob?
  [item]
  (if (= (get item "type") "blob") true false))

(defn editing?
  [pos]
  (contains? (querydb [:editing]) pos))

(defn opened?
  [pos]
  (contains? (querydb [:opened]) pos))

;; Handlers

(defn edit [pos]
  (let [editing (querydb [:editing])]
