   ))
 
 (defn render-add-card
-  [card-refs]
-  (let [on-click #(js/alert "toto - use route to display the form")]
+  [on-add-card]
+  (fn []
     [:button.header-button
-     {:on-click on-click :type "button"} "Add card"]
+     {:on-click on-add-card :type "button"} "Add card"]
   ))
 
 (defn toggle-all-cards

    (fn []
      (let [filter (r/cursor app-state [:filter])
            cards (r/cursor app-state [:cards])
            on-toggle-all #(swap! cards toggle-all-cards)
            filtered-cards (reaction (filter-by-title @filter @cards))]
        [:div
         (render-filter filter)
         [render-add-card cards]
         [render-toggle-all on-toggle-all]
         [render-board filtered-cards] ;filtered-cards
        ]))
  ))


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(defn render-card
  ; TODO - Try to remove the mess of call-backs
  "[Pure] Render a card" 
  [on-toggle-card on-remove-task on-check-task on-add-task]
  (fn [card]
    (let [card-id (:card-id card)
          details-style (when-not (:show-details card) {:style {:display "none"}})
          title-style (if (:show-details card) :div.card__title--is-open :div.card__title)]
      [:div.card
       [:div {:style (card-side-color card)}]
       [title-style {:on-click #(on-toggle-card card-id)} (:title card)]
       [:div.card__details details-style
        (:description card)
        [render-tasks (:tasks card) #(on-remove-task card-id %) #(on-check-task card-id %)]
        [render-add-task #(on-add-task card-id %)]
      ]]
  )))

(defn render-column
  [status cards card-renderer]
  [:div.list
   [:h1 (status->str status)]
   (for [c (filter-by-status status cards)]
     ^{:key (:card-id c)} [card-renderer c])
  ])

(defn render-board
  [cards card-renderer]
  [:div.app
   (for [status [:backlog :under-dev :done]]
     ^{:key status} [render-column status cards card-renderer])
  ])

(defn render-filter
