            [:i.icon-remove]
            "Failed compiling "
            (if public-gist
-             ($link-gist gist-id gist-id)
+             ($link-gist login gist-id gist-id)
              "a private gist")
            " "(util/timeago (:started job)) " ago."]
 

           [:i.icon-ok]
           "Compiled "
           (if public-gist
             ($link-gist gist-id gist-id)
             "a private gist")
           " " (util/timeago (:started job)) " ago."
           " Took " (compile-duration job) " s."]

(defn compile-duration [{:keys [started succeeded]}]
  (format "%.2f" (/ (- succeeded started) 1000.0)))

(defn $link-gist [login gist-id text]
  [:a {:href (str "/" login "/" gist-id)} text])

(defn $jobs-section [{:keys [jobs]}]
  [:section.jobs
   [:h3 "Work Queue"]
   (if (> (count jobs) 0)
     [:ul
      (for [{:keys [login gist-id public-gist] :as job} jobs]
        (cond
          (compiling-job? job)
          [:li.compiling
           [:i.icon-cogs]
           "Gist " (if public-gist
                     ($link-gist login gist-id gist-id)
                     "a private gist")
           ", started compiling " (util/timeago (:started job)) " ago."]

