           )))))
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; ClassRow
+
+(defui ClassRow
+  static om/IQuery
+  (query [_]
+    [:class/position :class/name :class/remaining :class/starting
+     {:class/rounds
+      [{:round/status ['*]}
+       {:round/type ['*]}]}
+     {:class/adjudicator-panel
+      [:adjudicator-panel/name]}
+     {:class/dances ['*]}])
+  Object
+  (render [this]
+    (log "ClassRow")
+    (log (:class/dances (om/props this)))
+    (let [{:keys [position name panel type starting status]}
+          (presentation/make-class-presenter (om/props this))]
+      (dom/tr nil
+        (dom/td nil position)
+        (dom/td nil name)
+        (dom/td nil panel)
+        (dom/td nil type)
+        (dom/td nil starting)
+        (dom/td nil status)))))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; ClassesView
+(defui ClassesView
+  static om/IQuery
+  (query [_]
+    (into [] (om/get-query ClassRow)))
+  Object
+  (render
+    [this]
+    (let [classes (sort-by :class/position (om/props this))]
+      (dom/div nil
+        (dom/h2 {:className "sub-header"} "Klasser")
+        (dom/table
+          #js {:className "table"}
+          (dom/thead nil
+            (dom/tr nil
+              (dom/th #js {:width "20"} "#")
+              (dom/th #js {:width "200"} "Dansdisciplin")
+              (dom/th #js {:width "20"} "Panel")
+              (dom/th #js {:width "20"} "Typ")
+              (dom/th #js {:width "20"} "Startande")
+              (dom/th #js {:width "20"} "Status")))
+          (apply dom/tbody nil (map (om/factory ClassRow) classes)))))))
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; Import/Export Component
 (defui ImportExportComponent
   static om/IQuery

(defui MainComponent
  static om/IQuery
  (query [_]
    [{:app/selected-competition (into [:competition/name :competition/location
                                       {:competition/panels [:adjudicator-panel/name
                                                             {:adjudicator-panel/adjudicators
                                                              [:adjudicator/id
                                                               :adjudicator/name]}]}]
                                      (concat (om/get-query ScheduleView)))}
     :app/status
     :app/selected-page
     {:app/selected-activities [:activity/id] }

          :home (dom/div nil
                  (dom/h1 nil (str "Runtime of " (:competition/name selected-competition)))
                  ((om/factory AdminViewComponent) {:status status}))

          :classes ((om/factory ClassesView) (:competition/classes selected-competition))

          :time-schedule ((om/factory ScheduleView) {:competition/activities
                                                     (:competition/activities selected-competition)
