         [:span.file-label (tr [:choose-vubis])]]
        [:span.file-name (if file (.-name file) (tr [:no-file]))]]]]))
 
-(defn production [id]
+(defn- file-upload []
+  (let [klass (when @(rf/subscribe [::notifications/button-loading? :vubis :vubis-file]) "is-loading")
+        admin? @(rf/subscribe [::auth/is-admin?])
+        file @(rf/subscribe [::vubis-file])]
+    [:div.field.is-grouped
+     [file-input]
+     [:p.control
+      [:button.button
+       {:disabled (or (nil? file) (not admin?))
+        :class klass
+        :on-click (fn [e] (rf/dispatch [::vubis-file file]))}
+       [:span.material-icons "upload_file"]]]])  )
+
+(defn- production [id]
   (let [{:keys [title creator source description
                 library_number source_publisher source_date]
          :as production} @(rf/subscribe [::production id])]

  ::set-vubis-file
  (fn [db [_ file]] (assoc db :vubis-file file)))

(defn- vubis-file []
  (let [get-value (fn [e] (-> e .-target .-files (aget 0)))
        save!     #(rf/dispatch [::set-vubis-file %])
        file      @(rf/subscribe [::vubis-file])]

(defn page []
  (let [loading? @(rf/subscribe [::notifications/loading? :vubis])
        errors? @(rf/subscribe [::notifications/errors?])
        confirming? @(rf/subscribe [::has-productions?])]
    [:section.section>div.container>div.content
     (cond
        errors? [notifications/error-notification]
        loading? [notifications/loading-spinner]
        confirming? [productions]
        :else [file-upload])]))
