                                                            (from-string end-time))))
                                      #(reset-form!))))]
         (when (seq event)
-          [:div.ui.page.grid
-           [:div.sixteen.wide.column
-            [:div.ui.segment
-             [:div.ui.vertical.segment
-              [:h2.ui.header
-               (:Name event)]]
-             [:div.ui.vertical.segment
-              [:h2.ui.header
-               "Add activity"]
-              [:form.ui.form
-               [:div.one.field
-                [:div.required.field {:class (when (and Name (:Name errors))
-                                               "error")}
-                 [:label "Name"]
-                 [input-atom :text (r/wrap Name swap! form assoc :Name)]]]
-               [:div.two.fields
-                [:div.field
-                 [:label "Location"]
-                 [input-atom :text (r/wrap Location swap! form assoc :Location)]]
-                [:div.field {:class (when (and EnrollmentCap (:EnrollmentCap errors))
-                                      "error")}
-                 [:label "Enrollment Cap"]
-                 [input-atom :text (r/wrap EnrollmentCap swap! form assoc :EnrollmentCap)]]]
-               [:div.two.fields =
-                [:div.required.field {:class (when (and StartTime (:StartTime errors))
-                                               "error")}
-                 [:label "Start Time"]
-                 [input-atom :datetime-local
-                  (r/wrap StartTime swap! form assoc :StartTime)
-                  #(or % (unparse (:date-hour-minute formatters) (now))) ; todo: date inputs clear on input
-                  #(unparse (:date-hour-minute formatters) (from-string %))]]
-                [:div.required.field {:class (when (and EndTime (:EndTime errors))
-                                               "error")}
-                 [:label "End Time"]
-                 [input-atom :datetime-local
-                  (r/wrap EndTime swap! form assoc :EndTime)
-                  #(or % (unparse (:date-hour-minute formatters) (now)))
-                  #(unparse (:date-hour-minute formatters) (from-string %))]]]
+          [:div.sixteen.wide.column
+           [:div.ui.segment
+            [:div.ui.vertical.segment
+             [:h2.ui.header
+              (:Name event)]]
+            [:div.ui.vertical.segment
+             [:h2.ui.header
+              "Add activity"]
+             [:form.ui.form
+              [:div.one.field
+               [:div.required.field {:class (when (and Name (:Name errors))
+                                              "error")}
+                [:label "Name"]
+                [input-atom :text (r/wrap Name swap! form assoc :Name)]]]
+              [:div.two.fields
                [:div.field
-                [:label "Description"]
-                [input-atom :textarea
-                 (r/wrap Description swap! form assoc :Description)]]
-               [:button.ui.primary.button {:class (when (seq errors) "disabled")
-                                           :type :submit
-                                           :on-click #(create-activity @form)}
-                "Add"]]]
-             [:div.ui.vertical.segment
-              [:h2.ui.header
-               "Activities"]
-              [:table.ui.table
-               [:thead
-                [:tr
-                 [:th "Start Time"]
-                 [:th "End Time"]
-                 [:th "Activity"]
-                 [:th "Location"]]]
-               [:tbody
-                (for [activity activities]
-                  ^{:key (:ActivityId activity)}
-                  [:tr
-                   [:td (let [start (from-string (:StartTime activity))]
-                          (unparse datetime-formatter start))]
-                   [:td (let [end   (from-string (:EndTime   activity))]
-                          (unparse datetime-formatter end))]
-                   [:td (:Name activity)]
-                   [:td (:Location activity)]])]]]]]])))))
+                [:label "Location"]
+                [input-atom :text (r/wrap Location swap! form assoc :Location)]]
+               [:div.field {:class (when (and EnrollmentCap (:EnrollmentCap errors))
+                                     "error")}
+                [:label "Enrollment Cap"]
+                [input-atom :text (r/wrap EnrollmentCap swap! form assoc :EnrollmentCap)]]]
+              [:div.two.fields =
+               [:div.required.field {:class (when (and StartTime (:StartTime errors))
+                                              "error")}
+                [:label "Start Time"]
+                [input-atom :datetime-local
+                 (r/wrap StartTime swap! form assoc :StartTime)
+                 #(or % (unparse (:date-hour-minute formatters) (now))) ; todo: date inputs clear on input
+                 #(unparse (:date-hour-minute formatters) (from-string %))]]
+               [:div.required.field {:class (when (and EndTime (:EndTime errors))
+                                              "error")}
+                [:label "End Time"]
+                [input-atom :datetime-local
+                 (r/wrap EndTime swap! form assoc :EndTime)
+                 #(or % (unparse (:date-hour-minute formatters) (now)))
+                 #(unparse (:date-hour-minute formatters) (from-string %))]]]
+              [:div.field
+               [:label "Description"]
+               [input-atom :textarea
+                (r/wrap Description swap! form assoc :Description)]]
+              [:button.ui.primary.button {:class (when (seq errors) "disabled")
+                                          :type :submit
+                                          :on-click #(create-activity @form)}
+               "Add"]]]
+            [:div.ui.vertical.segment
+             [:h2.ui.header
+              "Activities"]
+             [:table.ui.table
+              [:thead
+               [:tr
+                [:th "Start Time"]
+                [:th "End Time"]
+                [:th "Activity"]
+                [:th "Location"]]]
+              [:tbody
+               (for [activity activities]
+                 ^{:key (:ActivityId activity)}
+                 [:tr
+                  [:td (let [start (from-string (:StartTime activity))]
+                         (unparse datetime-formatter start))]
+                  [:td (let [end   (from-string (:EndTime   activity))]
+                         (unparse datetime-formatter end))]
+                  [:td (:Name activity)]
+                  [:td (:Location activity)]])]]]]])))))
 
 (defn event-page [event-id]
   (let [event (into {} (seq (d/entity @events-db event-id)))

                     (str " to " (unparse datetime-formatter end)))))]
           [:div.meta
            [:strong "Venue:"]
            " "
            (:Venue event)]
           [:div.description
            (:Description event)]
           [:div.extra
            [:a.ui.right.floated.button {:href (event-activities-route)}
             "Your activities"
             [:i.right.chevron.icon]]]]])]]]
    [:div.ui.dimmer {:class (when (empty? @events) "active")}

(defroute event-activity-add-route
  "/events/:EventId/activities/add" [EventId]
  (reset! current-page [#'event-activity-edit-page (int EventId)]))

(defroute event-schedule-route
  "/events/:EventId/schedule" [EventId]
  (reset! current-page [#'event-schedule-page (int EventId)]))

(defroute event-activity-route
  "/events/:EventId/activities/:ActivityId" [EventId ActivityId]
