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

            [:div [:a {:target "_blank" :href evidence_url} (t :badge/Openevidencepage) "..."]]]])

      (if (and (pos? show_evidence) (not (empty? evidences)))
        [:div.row
         [:div.col-md-12
          [:h2.uppercase-header (if (= (count evidences) 1)  (t :badge/Evidence) (str (t :badge/Evidences) ": " (count evidences)) ) ]
          (reduce (fn [r e]
                    (let [{:keys [name narrative description genre audience url]} e]
                      (conj r [:div {:style {:margin-bottom "10px"}}
                               (if name [:div.inline [:label (t :badge/Name) ": "] name])
                               (if narrative [:div [:label (t :badge/Narrative)] narrative])
                               (if description [:div [:label (t :admin/Description)]  description])
                               (if genre [:div [:label (t :badge/Genre) ": "] genre])
                               (if audience [:div [:label (t :badge/Audience) ": "] audience])
                               [:div [:a {:target "_blank" :href url} (t :badge/Openevidencepage) "..."]]
                               ]
                            )
                      )) [:div] evidences)
          ]
         ]
        )]]
    ))

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

                (swap! state assoc :badge-settings data (assoc data :new-tag ""))
                (if (= context "settings")
                  (swap! state assoc :tab [se/settings-tab-content data state init-data]
                         :tab-no 2
                         :evidences (:evidences data))
                  (swap! state assoc :tab [se/share-tab-content data state init-data]
                         :tab-no 3)))}))

