             [clj-money.pagination :as pagination]
             [clj-money.validation :as validation]
             [clj-money.models.images :as images] 
+            [clj-money.models.transactions :as transactions]
             [clj-money.models.attachments :as attachments])
   (:use [clj-money.web.shared :refer :all]))
 


(defn index
  [{{transaction-id :transaction-id} :params}]
  (let [attachments (attachments/search
                      (env :db)
                      {:transaction-id (Integer. transaction-id)})]
    (with-layout "Attachments" {}
      [:div.row
       [:div.col-md-4

          [:th "&nbsp;"]]
         (map attachment-row attachments)]]]
      [:a.btn.btn-primary {:href (format "/transactions/%s/attachments/new" transaction-id)}
       "Add"]
      "&nbsp;"
      ; TODO Fix this hack, we need to know the correct account to go back to
      [:a.btn.btn-default
       {:href (format "/accounts/%s"
                      (-> transaction :items first :account-id))}
       "Back"])))

(defn new-attachment
  ([{{transaction-id :transaction-id} :params :as req}]
