                [:div.description
                 (:Description event)]
                [:div.extra
-                [:a.ui.right.floated.small.button {:href nil}
+                [:a.ui.right.floated.small.button
+                 {:href (event-edit-route event)}
                  "Edit"
                  [:i.right.chevron.icon]]]]])]
           [:p "You don't own any events."])]]

             (create-event @form)]]]]]))))

(defn event-activity-edit-page [event-id & [activity-id]]
  (let [form (atom {:EventId event-id})
        validator (validation-set (presence-of :Name)
                                  (presence-of :StartTime)
                                  (presence-of :EndTime)
                                  (format-of :EnrollmentCap :format #"^\d*$"
                                             :allow-blank true
                                             :allow-nil true))
        reset-form!
        (fn []
          (reset! form {:EventId event-id}))]
    (when activity-id
      (if-let [activity (seq (d/entity @activities-db activity-id))]
        (reset! form (into {} activity))
        (add-watch activities-db
                   :activity-edit
                   (fn [_ _ _ _]
                     (reset! form (into {} (d/entity @activities-db
                                                     activity-id)))
                     (remove-watch activities-db :activity-edit)))))
    (fn [event-id]
      (let [{:keys [Name Location EnrollmentCap StartTime EndTime Description]}

                         [:div])})))

(defn calendar [options]
  (let [options (atom {})]
    (r/create-class
      {:component-did-mount #(.fullCalendar (js/jQuery (r/dom-node %))
                                            (clj->js @options))
       :component-did-update #(.fullCalendar (js/jQuery (r/dom-node %))
                                             (clj->js @options))
       :reagent-render (fn [x]
                         (reset! options x)
                         [:div])})))

(defn qr-code [options]
  (let [options (atom {})]
    (r/create-class
      {:component-did-mount #(.qrcode (js/jQuery (r/dom-node %))
                                      (clj->js @options))
       :component-did-update #(.qrcode (js/jQuery (r/dom-node %))
                                       (clj->js @options))
       :reagent-render (fn [x]
                         (reset! options x)
                         [:div])})))

; action must be a function that takes a callback for the API call as a param
(defn action-button [options text action & [alt-text]]
