 
 ;; -------------------------
 ;; Views
+(defn form-input [label input]
+  [:div {:class "form-group"}
+   [:label {:for (:id (second input))} label]
+   input])
+
 (defn display-loading []
   [:div [:h2 "Loading..."]])
 

      (display-loading))))


(defn row [label input]
  [:div.row
   [:div.col-md-2 [:label label]]
   [:div.col-md-5 input]])

(def conference-form-template
  [:div
   (row "Name" [:input {:field :text :id :name}])
   (row "Description" [:textarea {:field :textarea :id :description}])])

(defn create-conference [form-data]
  (ajax/POST "/api/conferences/" {:params @form-data


(defn add-conference-page []
  (let [doc (atom {})]
    [:div {:class "container"}
     [:div {:class "panel panel-default"}
      [:div {:class "panel-heading"} "Add conference"]
      [:div {:class "panel-body"}
       [forms/bind-fields conference-form-template doc]
       [:div [:button {:class "btn btn-primary":on-click #(create-conference doc)} "Create"]]]]]))