 (defn open-to-add-projects! [nav-ch]
   (put! nav-ch [:add-projects]))
 
-(defn open-to-project-settings! [nav-ch org-id repo-id subpage]
-  (let [project-name (str org-id "/" repo-id)]
+(defn open-to-project-settings! [nav-ch org repo subpage]
+  (let [project-name (str org "/" repo)]
     (put! nav-ch [:project-settings {:project-name project-name
                                      :subpage subpage
-                                     :org org-id
-                                     :repo repo-id}])))
+                                     :org org
+                                     :repo repo}])))
 
 (defn v1-build-path
   "Temporary helper method for v1-build until we figure out how to make

      (add-watch app listener-id sentinel))))

(defn open-to-build!
  [app nav-ch org-id repo-id build-num]
  (let [project-name (str org-id "/" repo-id)]
    (put! nav-ch [:build {:project-name project-name :build-num build-num :org org-id :repo repo-id}])))

(defn open-to-dashboard! [nav-ch & [args]]
  (put! nav-ch [:dashboard args]))

    (defroute v1-project-branch-dashboard "/gh/:org/:repo/tree/:branch" {:as params}
      (open-to-dashboard! nav-ch params))
    (defroute v1-build #"/gh/([^/]+)/([^/]+)/(\d+)"
      [org repo build-num]
      (open-to-build! app nav-ch org repo (js/parseInt build-num)))
    (defroute v1-project-settings "/gh/:org/:repo/edit"
      [org repo]
      (open-to-project-settings! nav-ch org repo nil))
    (defroute v1-project-settings-subpage "/gh/:org/:repo/edit#:subpage"
      [org repo subpage]
      (open-to-project-settings! nav-ch org repo (keyword subpage)))
    (defroute v1-org-settings "/gh/organizations/:org/settings"
      [org]
      (utils/mlog "org settings route hasn't been hooked up yet"))
    (defroute v1-org-settings-subpage "/gh/organizations/:org/settings#:subpage"
      [org subpage]
      (utils/mlog "org settings route hasn't been hooked up yet"))
    (defroute v1-add-projects "/add-projects" []
      (open-to-add-projects! nav-ch))
    (defroute v1-root "/"
      [org repo build-num]
      (open-to-dashboard! nav-ch))))
