             [frontend.components.common :as common]
             [frontend.utils :as utils :include-macros true]
             [frontend.utils.github :as gh-utils]
-            [om.core :as om :include-macros true])
+            [om.core :as om :include-macros true]
+            [frontend.utils.github :refer  [auth-url]])
   (:require-macros [frontend.utils :refer [html]]))
 
 (defn error-page [app owner]

              (cond
                (= status 500) [:img.error-img {:src  (utils/cdn-path "/img/outer/errors/500.svg")
                                                :alt "500"}]
                (or (= status 401) (and (not logged-in?) maybe-login-page?)) [:img.error-img {:src (utils/cdn-path "/img/outer/errors/401.svg")
                                                                                              :alt "401"}]
                (= status 404) [:img.error-img {:src (utils/cdn-path "/img/outer/errors/404.svg")
                                                :alt "404"}]
                :else [:span.error-zero])]]
            [:div.container
             [:p "Something doesn't look right ..."]

                               " or "
                               [:a {:href "mailto:sayhi@circleci.com"} "contact us"]
                               "." ]
               (or (= status 404) (= status 401))
               [:p.error-message "Try heading back to our "
                [:a {:href "/"} "homepage"]
               (if (not logged-in?)
                  [:span ", " [:a {:href (auth-url)
                              :on-click #(raise! owner  [:track-external-link-clicked  {:path  (auth-url)
                                                                                        :event "login_click"
                                                                                        :properties
                                                                                        {:source "header log-in"
                                                                                         :url js/window.location.pathname}}])}
                          "logging in"]
                   ", or "
                   [:a {:href "/signup"} "signing up"]]
                  '(" or checking out our " [:a {:href "http://blog.circleci.com/"} "blog"]))]
               :else "Something completely unexpected happened")]]])))))
