                   (title-for projects)]]
             [:li [:a
                   {:onClick (back-to-properties history)}
-                  (title-for properties)]
-             " " (when (:fetching devices) [:span {:class "glyphicon glyphicon-cloud-download spinner"}])]]
+                  (title-for properties)]]]
            (om/build devices-table devices {:opts {:histkey :devices}})]])))))
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

                                                      (keep identity)
                                                      (remove empty?))))))

(defn devices-table [devices owner]
  (reify
    om/IRender
    (render [_]
      (let [table-id   "devices-table"
            history    (om/get-shared owner :history)]
        (html
         [:table {:className "table table-hover"}
          [:thead
           [:tr [:th "Name"] [:th "Description"] [:th "Privacy"]]]
          [:tbody
           (for [row (sort-by :name (:data devices))]
             (let [{:keys [id location description privacy]} row
                   name (:name location)]
               [:tr {:onClick (fn [_ _]
                                (om/update! devices :selected id)
                                (history/update-token-ids! history :devices id)
                                (fixed-scroll-to-element "sensors-div"))
                     :className (if (= id (:selected devices)) "success")
                     :id (str table-id "-selected")}
                [:td name]
                [:td description]
                [:td privacy]]))]])))))

(defn devices-div [data owner]
  (reify

        (if (and new-property-id
                 (not (= (:property-id devices) new-property-id)))
          (do
            (om/update! devices :fetching :fetching)
            (GET (str "/4/entities/" new-property-id "/devices/")
                 {:handler  (fn [x]
                              (println "Fetching devices for property: " new-property-id)
                              (om/update! devices :fetching false)
                              (om/update! devices :data (mapv slugify-device x))
                              (om/update! devices :fetching (if (empty? x) :no-data :has-data))
                              (om/update! devices :selected nil))
                  :error-handler (fn [{:keys [status status-text]}]
                                   (om/update! devices :fetching :error)
                                   (om/update! devices :error-status status)
                                   (om/update! devices :error-text status-text))
                  ;; FIXME: This should be application/edn
