             [:button {:on-click #(new-deck "Runner" owner)} "New Runner deck"]]
            (if (empty? decks)
              [:h4 "You have no deck"]
-             (om/build-all deck-view decks))]
+             (for [deck decks]
+               [:div.block-link {:class (when (= (:deck state) deck) "active")
+                                 :on-click #(om/set-state! owner :deck deck)}
+                [:h4 (:name deck)]
+                [:p (:identity deck)]]))]
 
           [:div.decklist
            (when-not (empty? (:deck state))


(om/root deck-builder app-state {:target (. js/document (getElementById "deckbuilder"))})

;; (defn load-deck [data]
;;   (let [cards (:cards @cb/app-state)
;;         decks (for [deck data line (:cards deck)]
;;                 (some #(when (= (:code %) (:card line)) %) cards)
;;                 )]
;;       ;; (swap! app-state assoc :decks data)
;;       (println decks)
;;       ))

(when-not (empty? (:user @auth/app-state))
  (go (swap! app-state assoc :decks (:json (<! (GET (str "/data/decks" (:username user))))))))

  (end-edit owner)
  (let [deck (om/get-state owner :deck)
        cards (for [card (:cards deck)]
                {:qty (:qty card) :card (get-in card [:card :title])})
        data (assoc deck :cards cards)]
    (swap! app-state assoc :decks (conj (:decks @app-state) deck))
    (go (let [response (<! (POST "/data/decks/" data :json))]))))

(defn handle-edit [event owner]
  (let [deck (-> owner (om/get-node "deck-edit") .-value)]
    (om/set-state! owner [:deck :cards] (parse-deck deck))))

(defn decklist-view [{:keys [name identity cards]} owner]
  (om/component
