       (let [{:keys [issue-db]} (om/get-shared owner)
             comments (issue-model/top-level-comments issue)]
         (html
-          [:div.comments
-           (for [{:keys [db/id]} comments]
-             (om/build single-comment {:comment-id id
-                                       :issue-id (:db/id issue)}
-                       {:key :comment-id}))])))))
+         [:div.comments
+          (for [{:keys [db/id]} comments]
+            (om/build single-comment {:comment-id id
+                                      :issue-id (:db/id issue)}
+                      {:key :comment-id}))])))))
 
 (defn issue-card [{:keys [issue-id]} owner]
   (reify

         [:div.issue-card.content.make
          [:div.issue-info
           [:a.issue-title {:href (urls/issue-url issue)
                            :target "_top"
                            :role "button"}
            ; (or title (:issue/title issue ""))
            (:issue/title issue)
            ]
           ; (issue-foot issue)

           [:p.issue-foot
            [:a {:role "button"}
             (str comment-count " comment" (when (not= 1 comment-count) "s"))]
            [:span " for "]
            [:a {:role "button"}
             ; "feature"
             ; "integration"
             "bugfix"]
            [:span " in "]
            [:a {:role "button"}
             ; "review"
             ; "production"
             "development."]]]
          (om/build vote-box {:issue issue})])))))

; (defn issue-summary [{:keys [issue-id]} owner]
;   (reify
;     om/IInitState
;     (init-state [_] {:listener-key (.getNextUniqueId (.getInstance IdGenerator))})
;     om/IDidMount
;     (did-mount [_]
;       (fdb/add-entity-listener (om/get-shared owner :issue-db)
;                                issue-id
;                                (om/get-state owner :listener-key)
;                                (fn [tx-report]
;                                  (om/refresh! owner))))
;     om/IWillUnmount
;     (will-unmount [_]
;       (fdb/remove-entity-listener (om/get-shared owner :issue-db)
;                                   issue-id
;                                   (om/get-state owner :listener-key)))
;     om/IRender
;     (render [_]
;       (let [{:keys [cast! issue-db]} (om/get-shared owner)
;             issue (ds/touch+ (d/entity @issue-db issue-id))
;             comment-count (count (:issue/comments issue))]
;         (html
;           [:div.issue-summary
;            [:div.issue-info
;             [:a.issue-title {:on-click #(cast! :issue-expanded {:issue-id issue-id})
;                              :role "button"}
;              ; (or title (:issue/title issue ""))
;              (:issue/comments issue)
;              ]
;             ; (issue-foot issue)

;             [:p.issue-foot
;              [:a {:role "button"}
;               (str comment-count " comment" (when (< 1 comment-count) "s"))]
;              [:span " for "]
;              [:a {:role "button"}
;               ; "feature"
;               ; "integration"
;               "bugfix"]
;              [:span " in "]
;              [:a {:role "button"}
;               ; "review"
;               ; "production"
;               "development."]]]
;            (om/build vote-box {:issue issue})])))))

(defn issue* [{:keys [issue-id]} owner]
  (reify

      (let [{:keys [cast! issue-db cust]} (om/get-shared owner)]
        (html
         [:div.menu-view.issues-list
          (let [deleted (set/difference rendered-issue-ids all-issue-ids)
                added (set/difference all-issue-ids rendered-issue-ids)]
            (when (or (seq deleted) (seq added))
              [:a {:role "button"
                   :on-click #(om/update-state! owner (fn [s]
                                                        (assoc s
                                                          :rendered-issue-ids (:all-issue-ids s)
                                                          :render-time (datetime/server-date))))}
               (cond (empty? deleted)
                     (str (count added) (if (< 1 (count added))
                                          " new issues were"
                                          " new issue was")
                          " added, click to refresh.")
                     (empty? added)
                     (str (count deleted) (if (< 1 (count deleted))
                                            " issues were"
                                            " issue was")
                          " removed, click to refresh.")
                     :else
                     (str (count added) (if (< 1 (count added))
                                          " new issues were"
                                          " new issue was")
                          " added, " (count deleted) " removed, click to refresh."))]))
          (om/build issue-form {})
          (when-let [issues (seq (map #(d/entity @issue-db %) rendered-issue-ids))]
            (om/build-all issue-card (map (fn [i] {:issue-id (:db/id i)})
                                          (sort (issue-model/issue-comparator cust render-time) issues))
                          {:key :issue-id
                           :opts {:issue-db issue-db}}))])))))

(defn issue [{:keys [issue-uuid]} owner]
  (reify
