       [:value [:app-model :home :search-results] render-search-results]
 
       ;; types page
-      [:node-create [:app-model :types] render-types-page]
+      [:node-create [:app-model :types] (navigate-fn :types)]
       [:node-destroy [:app-model :types] (clear-id "content")]
       [:value [:app-model :types :types-results] render-types-results]
 
       ;; tag-stats page
-      [:node-create [:app-model :tag-stats] render-tag-stats-page]
+      [:node-create [:app-model :tag-stats] (navigate-fn :tag-stats)]
       [:node-destroy [:app-model :tag-stats] (clear-id "content")]
       [:value [:app-model :tag-stats :tag-stats-results] render-tag-stats-results]
 

                      :row-partial p/type-stats-row
                      :fields [:name :count :name-percent :url-percent])))

(defn render-tags-results [_ [_ _ _ new-value] _]
  (dom/insert-after!
    (dom/by-id "url_search_text")
    (p/generate-datalist new-value)))

(defn render-tag-stats-results [_ [_ _ _ new-value] _]
  (dom/set-html!

                        :row-partial p/tag-search-row
                        :caption (format "Total: %s" (count (map :url things)))))))

(defn render-tags-results [_ [_ _ _ new-value] _]
  (dom/insert-after!
    (dom/by-id "url_search_text")
    (p/generate-datalist new-value)))

(defn url-search [{:keys [transform messages]}]
  (msg/fill transform messages {:query (.-value (dom/by-id "url_search_text"))
                                :search-type (dom/value (css/sel "input[name=search_type]:checked"))}))

(defn create-url [{:keys [transform messages]}]
  (msg/fill transform messages {:value (dom/value (dom/by-id "add_url_text"))}))

;;; Other pages
;;;
(defn render-types-results [_ [_ _ _ new-value] _]
  (dom/set-html!
    (dom/by-id "content")
