             [salava.admin.ui.reporttool :refer [reporttool1]]
             [salava.badge.ui.verify :refer [check-badge]]
             [salava.core.ui.tag :as tag]
-            [clojure.string :refer [blank?]]))
+            [clojure.string :refer [blank?]]
+            [salava.badge.ui.evidence :refer [evidence-icon]]))
 
 
 (defn init-badge-connection [state badge-id]

                                     :content-language (init-content-language (:content data))
                                     :tab-no tab-no
                                     :permission "success"
                                     :evidence {:url nil :show_url false}
                                     ))
                   (if (:user-logged-in @state)  (init-badge-connection state (:badge_id data)))))}
     (fn [] (swap! state assoc :permission "error"))))

        [:a {:href criteria_url :target "_blank"} (t :badge/Opencriteriapage) "..."]
        [:div {:dangerouslySetInnerHTML {:__html criteria_content}}]]]


      (when (and (pos? show_evidence) (not (empty? evidences)))
        [:div.row {:id "badge-settings"}
         [:div.col-md-12
          [:h2.uppercase-header (if (= (count evidences) 1)  (t :badge/Evidence) (str (t :badge/Evidence) " (" (count evidences) ")") ) ]
          (reduce (fn [r evidence]
                    (let [{:keys [description name evidence_type id url mtime ctime]} evidence]
                      (conj r
                            [:div.modal-evidence
                             [evidence-icon evidence_type]
                             [:div.content

                              (when-not (blank? name) [:div.content-body.name name])
                              (when-not (blank? description) [:div.content-body.description description])
                              [:div.content-body.url (hyperlink url)]]
                             ])))
                  [:div ] evidences)]])]]))

(defn modal-navi [state]
  (let [invalid? (or (bh/badge-expired? (:expires_on @state)) (pos? (:revoked @state)))
