      [:tr
       [:td.column-key "Required level"]
       [:td (get item "DropLevel")]]
-     [:tr
-      [:td.column-key "Cast time"]
-      [:td (if meta
-             (str (format "%.2f" (/ (get meta "CastTime") 1000.0)) " secs")
-             "N/A")]]
+     (if active-skill
+       [:tr
+        [:td.column-key "Cast time"]
+        [:td (str (format "%.2f" (/ (get active-skill "CastTime") 1000.0)) " secs")]])
      [:tr
       [:td.column-key "Per 1% quality"]
-      [:td (if meta
-             (let [row (first (filter #(> (count (get %1 "Quality_StatsKeys")) 0) (find-all data/granted-effects-per-level "ActiveSkillsKey" (get meta "Row"))))]
+      ;; FIXME: Copy-paste code, this whole page really needs refactoring/cleaning
+      [:td (if active-skill
+             (let [row (first (filter #(> (count (get %1 "Quality_StatsKeys")) 0) (find-all data/granted-effects-per-level "ActiveSkillsKey" (get active-skill "Row"))))]
                (if row
                  (let [stats-keys (get row "Quality_StatsKeys")
                        stats-values (get row "Quality_Values")]

       %1)
    (.split s " "))))

(defn get-skill-small-table [item meta id]
  (let [all-tags (get (find-first data/skill-gems "BaseItemTypesKey" id) "GemTagsKeys")
        display-tags (filter #(> (.length (get %1 "Tag")) 0)
                             (map #(find-first data/gem-tags "Row" %1)

           (map #(vector (str "/gemtags/" (get %1 "Row") "/") (get-gemtag %1))
                (filter #(> (.length (get %1 "Tag")) 0) data/gem-tags)))))

(defn changelog  [ctx]
  (layout-page
   ctx
   nil
   [:div
    [:h3 "2015-12-10"]
    [:ul
     [:li "Added some info to passive skill pages"]]
    [:h3 "2015-12-09"]
    [:ul
     [:li "Added mana cost to skill page"]]]))

(defn get-pages []
  (merge {"/index.html" index
          "/404.html" not-found
          "/50x.html" server-error
          "/changelog/" changelog}
         (get-gemtags)
         (get-affixes)
         (get-item-classes)
