                  (om/build projects-div tables)
                  (om/build properties-div tables)
                  (om/build devices-div tables)
-                     
                  ;; (om/build device-detail devices)
-
-                 [:h2 {:id "sensors"} "Sensors"]
-                 [:ul {:class "breadcrumb"}
-                  [:li (title-for programmes)]
-                  [:li (title-for projects)]
-                  [:li (title-for properties :title-key :addressStreetTwo)]
-                  [:li (title-for devices :title-key [:location :name])]]
-                 (om/build sensor/table data {:opts {:histkey :sensors
-                                                     :path    :readings}})
+                 (om/build sensors-div data)
                  ;; (om/build sensor/define-data-set-button data)
 
-                 [:h2 "Chart"]
-                 [:ul {:class "breadcrumb"}
-                  [:li (title-for programmes)]
-                  [:li (title-for projects)]
-                  [:li (title-for properties :title-key :addressStreetTwo)]
-                  [:li (title-for devices :title-key [:location :name])]
-                  [:li (title-for-sensor sensors)]]
-                 [:div {:id "date-picker"}
-                  (om/build dtpicker/date-picker data {:opts {:histkey :range}})]
-                 (om/build chart-feedback-box (get-in data [:chart :message]))
-                 [:div {:className "well" :id "chart" :style {:width "100%" :height 600}}
-                  (om/build chart/chart-figure (:chart data))]
-                 (om/build sensor/selection-dialog (:tables data)
-                           {:opts {:id "sensor-selection-dialog"
-                                   :handler (fn [e]
-                                              (.preventDefault e)
-                                              (POST (str "/4/entities/" (:selected @properties) "/datasets")
-                                                    {:params          (:sensor-group @sensor-select)
-                                                     :handler         #(println "Yah!")
-                                                     :error-handler   #(println "Error!")
-                                                     :response-format "application/edn"
-                                                     :keywords?       true}))}})]))))))
-
-
+                 [:div {:id "chart-div"}
+                  [:h2 "Chart"]
+                  [:div {:id "date-picker"}
+                   (om/build dtpicker/date-picker data {:opts {:histkey :range}})]
+                  (om/build chart-feedback-box (get-in data [:chart :message]))
+                  [:div {:className "well" :id "chart" :style {:width "100%" :height 600}}
+                   (om/build chart/chart-figure (:chart data))]
+                  (om/build sensor/selection-dialog (:tables data)
+                            {:opts {:id "sensor-selection-dialog"
+                                    :handler (fn [e]
+                                               (.preventDefault e)
+                                               (POST (str "/4/entities/" (:selected @properties) "/datasets")
+                                                     {:params          (:sensor-group @sensor-select)
+                                                      :handler         #(println "Yah!")
+                                                      :error-handler   #(println "Error!")
+                                                      :response-format "application/edn"
+                                                      :keywords?       true}))}})]]))))))
+
+

          [:thead
           [:tr [:th "ID"] [:th "Organisations"] [:th "Name"] [:th "Created At"]]]
          [:tbody
           (for [row (sort-by :id (:data cursor))]
             (let [{:keys [id lead-organisations name description created-at]} row]
               [:tr {:onClick (fn [_ _]
                                (om/update! cursor :selected id)
                                (history/update-token-ids! history :programmes id)
                                (fixed-scroll-to-element "projects-div"))
                     :className (if (= id (:selected cursor)) "success")
                     :id (str table-id "-selected")}
                [:td id [:a {:id (str "row-" id)}]] [:td lead-organisations] [:td name] [:td created-at]]))]])))))

(defn projects-div [tables owner]
  (reify

  (let [[type _] (str/split selected #"-")]
    type))

;; our banner is 50px so we need to tweak the scrolling
(defn fixed-scroll-to-element [element]
  (-> (.getElementById js/document element)
                                    .scrollIntoView)
  (.scrollBy js/window 0 -50))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; programmes
(defn programmes-table [programmes owner]
  (reify
    om/IRender
    (render [_]
