 (ns salava.badge.ui.evidence
   (:require [salava.core.ui.modal :as mo]
-            [reagent.core :refer [cursor]]
+            [reagent.core :refer [cursor atom]]
             [salava.core.i18n :refer [t]]
             [reagent.session :as session]
-            [salava.core.ui.helper :refer [plugin-fun path-for]]
-            [salava.core.ui.ajax-utils :as ajax]))
+            [salava.core.ui.helper :refer [plugin-fun path-for hyperlink base-url]]
+            [salava.core.ui.ajax-utils :as ajax]
+            [salava.core.time :refer [date-from-unix-time]]
+            [clojure.string :refer [blank? includes?]]
+            [salava.file.icons :refer [file-icon]]))
 
 (defn input [input-data textarea?]
   (let [{:keys [name atom placeholder type error-message-atom rows cols]} input-data]

      :rows rows
      :cols cols}]))

(defn toggle-url-input [state]
  (let [show-url-input-atom (cursor state [:enable_url_input])]
    (if @show-url-input-atom (swap! state assoc :enable_url_input false) (swap! state assoc :enable_url_input true))
    ))

(defn user-pages [pages-atom]
  (ajax/GET
    (path-for "/obpv1/page" true)
    {:handler (fn [data]
                (reset! pages-atom data)
                )}))

(defn pages-tab [state]
  (let [pages-atom (atom {})]
    ()
    )

  )


(defn evidence-form [data state init-data]

        evidence-audience-atom (cursor state [:evidence :audience])
        evidence-genre-atom (cursor state [:evidence :genre])
        evidence-url-atom (cursor state [:evidence :url])
        url-input-enabled? (cursor state [:url_input])
        resource-input-enabled? (cursor state [:resource_input])
        {:keys [image_file name]} data]
    [:div {:id "badge-settings" :class "row flip"}
     [:div {:class "col-md-3 badge-image modal-left"}
