 
 
 (def app-state
-  (atom {:state []}))
+  (atom {}))
+
+(defn refresh-navigation []
+;;   (
+;;    ;;let [token (.getToken history)
+;;    let [token "/employee/1"
+;;         set-active (fn [nav]
+;;                      (assoc-in [:state :active] (= (:path nav) token)))]
+
+;;    ;; #(map set-active %)
+;;    (swap! app-state #(map set-active %))
+;;    (println (str "token: " token))
+;;    (app-state))
+;;   (let [token "/employee/1"
+;;         set-active (fn [nav] (assoc nav :active (= (:path nav) token)))])
+;;   (swap! app-state #(map set-active %))
+)
+
+(refresh-navigation)
 
 (def history (History.))
 
-(defn refresh-navigation []
-   (
-     let [token (.getToken history)
-          set-active (fn [nav]
-                       (assoc-in nav [:state] :active (= (:path nav) token)))]
-
-    ;; #(map set-active %)
-    (swap! app-state #(map set-active %))
-    (println (str "token: " token))))
-
- 
 (defn on-navigate [event]
-  (refresh-navigation)
-  (secretary/dispatch! (.-token event)))
+  (refresh-navigation)
+  (secretary/dispatch! (.-token event)))
 
 (defroute "/employees/:id" [id]
   (println (str "employee id: " id )))
-
 
 (defn fetch-departments
   [url]

                 [:div.row
                  (->department-list app)])))


(defcomponent om-app [app owner]
  (display-name [_]
                "app")

                [:div.col-md-4.col-xs-4 (om/build gravatar manager-email {:opts {:size 50}})]
                [:div.col-md-8.col-xs-8
                 [:h5 (str manager-firstname " " manager-lastname)]
                 ]
                ]
               [:div.col-md-10.col-xs-10
                [:div.col-md-11.col-xs-11
                 [:h2 department]
                 ]
                [:div.col-md-1.col-xs-1
                 [:button {:class "btn btn-default glyphicon glyphicon-sort"
                           :data-toggle "collapse"
                           :data-parent "accordian"
                           :data-target (str "#" (clojure.string/replace department #"[\s]" "-"))}]
                 ]
                ]
               ]

              [:div.panel-body.panel-collapse.collapse {:id (clojure.string/replace department #"[\s]" "-") :style {:height "auto"}}
               (if (not (zero? (count rows-of-employees)))
                 (for [employee-row rows-of-employees]
                   [:div.row.accordian-inner
                    (for [employee-info-component (om/build-all employee-info employee-row)]
                      employee-info-component)])
                 [:div.row.accordian-inner
                  [:h5.text-center "Currently, this department does not contain any employees"]])]]))))


(defcomponent department-list [{:keys [departments]}]
  (display-name [_]
                "department-list")

  (render [_]
          (html
           [:div.clearfix.accordian
            (dom/ul (om/build-all department-employees departments))])))


(defcomponent departments-container [app owner opts]
  (display-name [_]
                "departments-box")

  (will-mount [_]
              (go
