         (upload-form request year issue ["No file selected"])
         (upload-full-form request year issue {fmt ["No file selected"]})))))
 
-(defn upload [request year issue fmt items]
-  (case fmt
-    (:hörfilm :ludo :taktilesbuch) (db/save-full-catalog! year (name fmt) (edn/read-string items))
-    (db/save-catalog! year issue (edn/read-string items)))
-  (response/redirect-after-post (format "/%s/%s" year issue)))
-
 (defn editorial-form [request fmt year issue]
   (let [identity (friend/identity request)
         editorial (db/read-editorial year issue fmt)

                  (prn-str items))))
      ;; if the file is empty go back to the upload form
      (custom-form request year issue ["No file selected"]))))

(defmulti custom (fn [_ _ _ _ _ fmt _] fmt))

(defmethod custom :pdf [request year issue query customer fmt items]
  (let [filename (file-name :catalog-custom customer)
        temp-file (java.io.File/createTempFile filename ".pdf")]
    (-> items
        edn/read-string
        vubis/order
        (layout.fop/document :custom year issue nil nil :query query :customer customer)
        (layout.fop/generate-pdf! temp-file))
    (pdf-response temp-file filename)))

(defmethod custom :grossdruck [request year issue query customer fmt items]
  (let [filename (file-name :catalog-custom customer)
        temp-file (java.io.File/createTempFile filename ".pdf")]
    (-> items
        edn/read-string
        vubis/order
        (layout.fop/document :custom-grossdruck year issue nil nil :query query :customer customer)
        (layout.fop/generate-pdf! temp-file))
    (pdf-response temp-file filename)))

(defmethod custom :braille [request year issue query customer fmt items]
  (-> items
      edn/read-string
      vubis/order
      (layout.dtbook/dtbook {:query query :customer customer})
      (xml-response (file-name :catalog-custom customer))))

(defmethod custom :plain-text [request year issue query customer fmt items]
  (-> items
      edn/read-string
      vubis/order
      (layout.text/text {:query query :customer customer})
      (text-response (file-name :catalog-custom customer))))

       (customer-field nil)
       (format-field :pdf)
       (form/submit-button {:class "btn btn-default"} "Submit"))])))

(defmulti custom (fn [_ _ _ _ _ fmt _] fmt))

(defmethod custom :pdf [request year issue query customer fmt items]
  (let [filename (file-name :catalog-custom customer)
        temp-file (java.io.File/createTempFile filename ".pdf")]
    (-> items
        edn/read-string
        vubis/order
        (layout.fop/document :custom year issue nil nil :query query :customer customer)
        (layout.fop/generate-pdf! temp-file))
    (pdf-response temp-file filename)))

(defmethod custom :grossdruck [request year issue query customer fmt items]
  (let [filename (file-name :catalog-custom customer)
        temp-file (java.io.File/createTempFile filename ".pdf")]
    (-> items
        edn/read-string
        vubis/order
        (layout.fop/document :custom-grossdruck year issue nil nil :query query :customer customer)
        (layout.fop/generate-pdf! temp-file))
    (pdf-response temp-file filename)))

(defmethod custom :braille [request year issue query customer fmt items]
  (-> items
      edn/read-string
      vubis/order
      (layout.dtbook/dtbook {:query query :customer customer})
      (xml-response (file-name :catalog-custom customer))))

(defmethod custom :plain-text [request year issue query customer fmt items]
  (-> items
      edn/read-string
      vubis/order
      (layout.text/text {:query query :customer customer})
      (text-response (file-name :catalog-custom customer))))

(defn custom-confirm [request year issue query customer fmt file]
  (let [{tempfile :tempfile} file
