      (text-input-control cursor owner [:sensors sensor_id] :resolution "Resolution")
      (checkbox cursor owner [:sensors sensor_id] :actual_annual "Calculated Field")]))
 
+(defn synthetic-sensor-edit-div [cursor owner]
+  (let [sensor_id   (:sensor_id cursor)]
+    [:div
+     [:li.list-group-item
+      (static-text cursor [:type] "Type")
+      (static-text cursor [:unit] "Unit")
+      (static-text cursor [:period] "Period")
+      (checkbox cursor owner [:sensors sensor_id] :actual_annual "Calculated Field")]]))
+
 (defn privacy-checkbox [cursor owner keys label]
   [:div.checkbox
    [:label

  (:require [cljs.core.async :refer [<! >! chan put!]]
            [om.core :as om :include-macros true]
            [sablono.core :as html :refer-macros [html]]
            [kixi.hecuba.bootstrap :refer (static-text) :as bs]
            [kixi.hecuba.tabs.hierarchy.data :refer (fetch-property fetch-devices fetch-sensors)]
            [clojure.string :as string]
            [kixi.hecuba.common :refer (log delete-resource) :as common]

                        :class (str "btn btn-danger")
                        :onClick (fn [_]
                                   (put! event-chan {:event :editing :value false}))} "Cancel"]
              (when-not synthetic?
                [:button {:type "button"
                          :class "btn btn-danger pull-right"
                          :onClick (fn [_]
                                     (delete-device property_id device_id event-chan refresh-chan))}
                 "Delete Device"])]]
            [:h3 "Device"]
            (bs/static-text cursor [:device :device_id] "Device ID")
            (if-not synthetic?
              [:div
               (bs/text-input-control cursor owner [:device :description] "Unique Description")
               (bs/text-input-control cursor owner [:device :name] "Further Description")
               (location-input cursor owner)
               (privacy-checkbox cursor owner [:device :privacy] "Private")]
              [:div
               (bs/static-text cursor [:device :description] "Unique Description")])
            [:h3 "Sensors"]
            (let [sensors (into [] (:readings (:device cursor)))]
              (if (seq sensors)
                [:ul.list-group
                 (for [sensor  sensors]
                   (if (:synthetic sensor)
                     (synthetic-sensor-edit-div sensor owner)
                     (sensor-edit-div property_id sensor owner event-chan refresh-chan)))]
                [:p "No sensors found."]))]]])))))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
