           )
         )         
       )
-      ;(apply dom/ul #js {:className "animals"} 
-        ;(map story-view (:stories app) )
-      ;)
-
-    )
-  )
-)
-
-
+    )
+  )
+)
+
+(defmulti website-view (fn [data _] (:view data)))
+
+(defmethod website-view 0
+  [data owner] 
+  (list-view data owner)
+)
+
+(defmethod website-view 1
+  [data owner] 
+  (item-view data owner)
+)
+
+
+(defn changeview [data]
+  (->> data
+    :stories
+    (mapv (fn [x]
+            (if (:view data)
+              x)
+      )
+    )
+  )
+)
+
+(defn main-view [app owner]
+  (reify
+    om/IRender
+    (render [_]
+      (dom/div nil
+        ;(apply dom/ul nil      )
+        (om/build website-view app {:key :Reference} )
+      )      
+    )
+  )
+)
 
 
 
 (om/root
- stories-view
+ main-view
  app-state
  {:target (js/document.getElementById "app")})

      (map
        (fn [story]
          (assoc story
           :Title (get story "Title") :Introduction (get story "Introduction") :Reference (get story "Reference") ))
              (get response "Data")
      ))





;;[{:Title (get (first response) "Title") :Introduction  (get (first response) "Introduction") :Reference  (get (first response) "Reference") :Updated  (get (first response) "Updated") :Published (get (first response) "Pub;ished")}]
    ]

    (.log js/console (str pageid))

  
)





(defn downloadpage [pageid]
  (GET (str "http://localhost:8083/api/page/" pageid)  {:handler handler
                                              :error-handler error-handler})
