       (let [issue-db (om/get-shared owner :issue-db)
             cust (om/get-shared owner :cust)]
         (html
-          [:div.content.make
-           [:form.adaptive {:on-submit #(do (utils/stop-event %)
-                                          (when (seq comment-body)
-                                            (d/transact! issue-db [{:db/id issue-id
-                                                                    :issue/comments (merge {:db/id -1
-                                                                                            :comment/created-at (datetime/server-date)
-                                                                                            :comment/body comment-body
-                                                                                            :comment/author (:cust/email cust)
-                                                                                            :frontend/issue-id (utils/squuid)}
-                                                                                           (when parent-id
-                                                                                             {:comment/parent parent-id}))}])
-                                            (om/set-state! owner :comment-body ""))
-                                          (close-callback))}
+         [:div.content.make
+          [:form.adaptive {:on-submit #(do (utils/stop-event %)
+                                         (when (seq comment-body)
+                                           (d/transact! issue-db [{:db/id issue-id
+                                                                   :issue/comments (merge {:db/id -1
+                                                                                           :comment/created-at (datetime/server-date)
+                                                                                           :comment/body comment-body
+                                                                                           :comment/author (:cust/email cust)
+                                                                                           :frontend/issue-id (utils/squuid)}
+                                                                                          (when parent-id
+                                                                                            {:comment/parent parent-id}))}])
+                                           (om/set-state! owner :comment-body ""))
+                                         (close-callback))}
 
            [:textarea {:required true
                        :value comment-body

  (:require-macros [sablono.core :refer (html)])
  (:import [goog.ui IdGenerator]))

; (defn description-form [{:keys [issue issue-id]} owner]
;   (reify
;     om/IDisplayName (display-name [_] "Description form")
;     om/IInitState (init-state [_] {:issue-description nil
;                                    :describing? false})
;     om/IRenderState
;     (render-state [_ {:keys [issue-description]}]
;       (let [{:keys [issue-db cust cast!]} (om/get-shared owner)]
;         (html
;           [:div.original-comment
;           (if (:issue/description issue)

;             [:div.issue-comment
;              [:p.make (:issue/description issue)]
;              [:p.issue-foot.make
;               [:span (common/icon :user) " "]
;               [:a {:role "button"}
;                (:issue/author issue)]
;               [:span " on "]
;               [:a {:role "button"}
;                (datetime/month-day (:issue/created-at issue))]
;               [:span " — "]
;               [:a {:role "button"
;                    :on-click #(do
;                                 (if (om/get-state owner :replying?)
;                                   (om/set-state! owner :replying? false)
;                                   (om/set-state! owner :replying? true)))}
;                (if (om/get-state owner :describing?) "Cancel" "Reply")]]]

;             [:div.content.make
;              [:form.adaptive {:on-submit #(do (utils/stop-event %)
;                                             (when issue-description
;                                               (d/transact! issue-db [{:db/id (:db/id issue)
;                                                                       :issue/description issue-description}]))
;                                             (om/set-state! owner :issue-description nil)
;                                             (om/set-state! owner :replying? false))}
;               [:textarea {:value (or issue-description (:issue/description issue ""))
;                           :required "true"
;                           :onChange #(om/set-state! owner :issue-description (.. % -target -value))}]
;               [:label {:data-label "label here"
;                        :data-placeholder "How can we improve Precursor?"}]
;               [:input {:type "submit"
;                        :value "Submit idea."}]]])

;           (om/build comment-form {:issue-id issue-id})

;           ])))))

(defn issue-form [_ owner]
  (reify
    om/IDisplayName (display-name [_] "Issue form")

                          [?e :vote/cust ?email]]
                        @issue-db (:db/id issue) (:cust/email cust))]
        (html
         [:div.issue-vote {:role "button"
                           :class (if voted? " voted " " novote ")
                           :on-click #(d/transact! issue-db
                                                   [{:db/id (:db/id issue)
                                                     :issue/votes {:db/id -1
                                                                   :frontend/issue-id (utils/squuid)
                                                                   :vote/cust (:cust/email cust)}}])}
          [:div.issue-votes {:key (count (:issue/votes issue))}
           (count (:issue/votes issue))]
          [:div.issue-upvote
           (common/icon :north)]])))))

(defn single-comment [{:keys [comment-id issue-id]} owner {:keys [ancestors]
                                                           :or {ancestors #{}}}]
