         [:td (he/url-format (.-url bm) (.-title bm))]
         [:td (.-description bm)]])]]])
 
+(defn row [label input]
+  [:div.row
+   [:div.col-md-2 [:label label]]
+   [:div.col-md-5 input]])
+(defn radio [label name value]
+  [:div.radio
+   [:label
+    [:input {:field :radio :name name :value value}]
+    label]])
+
+(defn input [label type id]
+  (row label [:input.form-control {:type type :id id}]))
+
+
+(defn bookmark-template []
+  [:div.form-group
+   [:div (input "Title" "text" "title")]
+   [:div  (input "URL" "text" "url")]
+   [:div (input "Tags" "text" "tags")]
+   [:div  (input "Description" "textarea" "desc")]])
+
+(defn getinputvalue[id]
+(.-value (.getElementById js/document id)))
+
+(defn get-bookmark-formdata []
+  { :title (getinputvalue "title")
+    :url (getinputvalue "url")
+    :description (getinputvalue "desc")})
+
+
+
+(defn save [event]
+  (let [onres (fn[data] (set! (.-location js/window) "http://localhost:8090"))]
+    (http-post "http://localhost:8090/bookmark" 
+               onres  (JSON/stringify (clj->js (get-bookmark-formdata))))))
+
+(defn page [body]
+  (fn []
+    [:div
+     [:div.padding]
+     [:div.page-header [:h1 "Book Marks"]]
+     [bookmark-template]
+     [:input {:type "button" :value "Save"
+              :class "btn btn-primary" :on-click save}]
+     [:div.padding]
+     [:div.page-footer [:h6 "Copyright ©2015 A TechnoIdentity Creations — All Rights Reserved."]]
+     ]))
 
 (defroute home-path "/" []
   (let [onres (fn [json]

(defn http-get [url callback]
  (xhr/send url callback))


(defn search [event]
  (let [stext (.-value (.getElementById js/document "sText"))

            [goog.net.XhrIo :as xhr]
            [reagent.core :as r]
            [bookmarks.helpers :as he]
            [bookmarks.createbookmarks :as cb]
            [cognitect.transit :as t]
            [goog.structs :as structs])
  (:import goog.History)
  )


(defn url-format [url title]
  [:a {:href url :class "btn btn-primary"} title])

(def w (t/writer :json-verbose))

(defn getdata [res]
  (.getResponseJson (.-target res)))
