             [salava.core.helper :refer [dump]]
             [salava.user.ui.helper :as uh]
             [salava.core.ui.modal :as mo]
-            [salava.core.ui.helper :refer [path-for private? js-navigate-to plugin-fun]]
+            [salava.core.ui.helper :refer [path-for private? js-navigate-to plugin-fun hyperlink]]
             [salava.core.time :refer [date-from-unix-time unix-time]]
             [salava.admin.ui.admintool :refer [admintool]]
             [salava.social.ui.follow :refer [follow-badge]]

  (let [{:keys [id badge_id email owner? issued_on expires_on assertion_url
                user-logged-in?
                evidence_url issued_by_obf verified_by_obf obf_url
                recipient_count assertion  qr_code owner message_count content issuer-endorsements user_exists?]} @state
        expired?                                                                 (bh/badge-expired? expires_on)
        show-recipient-name-atom                                                 (cursor state [:show_recipient_name])
        selected-language                                                        (cursor state [:content-language])

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

           (when (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 [narrative description name id url mtime ctime properties]} evidence
                               added-by-user? (and (not (blank? description)) (starts-with? description "Added by badge recipient")) ;;use regex
                               desc (cond
                                      (not (blank? narrative)) narrative
                                      (not added-by-user?) description ;;todo use regex to match description
                                      :else nil)]
                           (conj r
                                 [:div.modal-evidence
                                  (when-not added-by-user? [:span.label.label-success (t :badge/Verifiedevidence)])
                                  [:div.evidence-icon [:i.fa.fa-link]]
                                  [:div.content
                                   (when-not (blank? name) [:div.content-body.name name])
                                   (when-not (blank? desc) [:div.content-body.description desc])
                                   [:div.content-body.url
                                    (hyperlink url)]]])))
                       [:div ] evidences)]])

           #_(if evidence_url
               [:div.row
                [:div.col-md-12
                 [:h2.uppercase-header (t :badge/Evidence)]
                 [:div [:a.link {:target "_blank" :href evidence_url} (t :badge/Openevidencepage) "..."]]]])]]]]]]]))



