               :on-click #(delete-badge id state init-data)}
      (t :core/Delete)]]])
 
+
 (defn badge-grid-element [element-data state badge-type init-data]
   (let [{:keys [id image_file name description visibility expires_on revoked issuer_content_name issuer_content_url recipients badge_id assertion_url meta_badge meta_badge_req]} element-data
         expired? (bh/badge-expired? expires_on)

                                  ]])

       #_(= "export" badge-type) #_[:div {:key id}
                                [:div.media-content
                                 [:a {:href "#" :on-click #(mo/open-modal [:badge :info] {:badge-id id})}
                                  [:div.visibility-icon
                                   (case visibility
                                     "private" [:i {:class "fa fa-lock"}]
                                     "internal" [:i {:class "fa fa-group"}]
                                     "public" [:i {:class "fa fa-globe"}]
                                     nil)]
                                  (if image_file
                                    [:div.media-left
                                     [:img {:src (str "/" image_file) :alt name}]])
                                  [:div.media-body
                                   [:div.media-heading name]
                                   [:div.media-issuer issuer_content_name]]]]
                                [:div.media-bottom
                                 [:div.row
                                  [:div.col-xs-9
                                   (let [checked? (boolean (some #(= id %) (:badges-selected @state)))]
                                     [:div.checkbox
                                      [:label {:for (str "checkbox-" id)}
                                       [:input {:type "checkbox"
                                                :id (str "checkbox-" id)
                                                :on-change (fn []
                                                             (if checked?
                                                               (swap! state assoc :badges-selected (remove #(= % id) (:badges-selected @state)))
                                                               (swap! state assoc :badges-selected (conj (:badges-selected @state) id))))
                                                :checked checked?}]

                                       (t :badge/Exporttobackpack)]])]
                                  [:div {:class "col-xs-3 text-right"}
                                   [:a {:href (str obf_url "/c/receive/download?url="(js/encodeURIComponent assertion_url)) :class "badge-download"}
                                    [:i {:class "fa fa-download"}]]]]]]

       (= "gallery" badge-type) [:div
                                 [:a {:href "#" :on-click #(mo/open-modal [:gallery :badges] {:badge-id badge_id})

                                                                                                                  {:size :lg})) :title (t :badge/Delete)} [:i {:class "fa fa-trash"}]]])
                                 [:a {:href "#" :on-click #(mo/open-modal [:badge :info] {:badge-id id} {:hide (fn [] (init-data state))})}
                                  (if image_file
                                    [:div.media-left
                                     [:img.badge-img {:src (str "/" image_file)
                                                      :alt name}]])
                                  [:div.media-body
                                   [:div.media-heading
                                    [:p.heading-link name]]
                                   [:div.media-issuer
                                    [:p issuer_content_name]]]
                                  ]]
                                [:div {:class (str "media-content " (if expired? "media-expired") (if revoked " media-revoked"))}
                                 [:a {:href "#" :on-click #(do
                                                             (mo/open-modal [:badge :info] {:badge-id id} {
                                                                                                            :shown (fn [] (.replaceState js/history {} "Badge modal" (path-for (str "/badge?id=" id))))
                                                                                                            :hidden (fn []
                                                                                                                      (do
                                                                                                                        (if (clojure.string/includes? (str js/window.location.href) (path-for (str "/badge?id=" id)))
                                                                                                                          (.replaceState js/history {} "Badge modal" (path-for "/badge"))
                                                                                                                          (navigate-to (current-route-path)))
                                                                                                                        (init-data state)))
                                                                                                            }))}
                                  [:div.icons
                                   [:div.visibility-icon.inline
                                    (case visibility
                                      "private" [:i {:class "fa fa-lock"}]
                                      "internal" [:i {:class "fa fa-group"}]
                                      "public" [:i {:class "fa fa-globe"}]
                                      nil)
                                    (if metabadge-icon-fn [:div.pull-right [metabadge-icon-fn id]])]

                                   (if expires_on
                                     [:div.righticon
