       [:a {:href "#" :on-click #(do (.preventDefault %) (toggle-panel :badges visible-area-atom) #_(reset! (cursor state [:visible-area]) :badges))}
        [:h2 (str (t :badge/Badges) " (" (count badges) ")")]
        #_[:p {:style {:margin-top "5px"}} (t :connections/Badgeblockinfo)]
-         [:i.fa.fa-lg.panel-status-icon {:class icon-class}]]]
+       [:i.fa.fa-lg.panel-status-icon {:class icon-class}]]]
      (when (= @(cursor state [:visible-area]) panel-identity)
        [:div.panel-body
         [:table {:class "table" :summary (t :badge/Badgeviews)}


(defn init-issuer-connections [state]
  (ajax/GET
    (path-for "/obpv1/connections/connections_issuer")
    {:handler (fn [data]
                (swap! state assoc :issuers data))}))

(defn init-data [state]
  (ajax/GET
    (path-for "/obpv1/connections/connections_badge" true)
    {:handler (fn [data]
                ; (prn data)
                (swap! state assoc :badges data
                       :visible-area (session/get! :visible-area nil))
                (init-issuer-connections state))}))


(defn unfollow [badge-id state]
  [:a {:href "#" :on-click #(ajax/POST
                              (path-for (str "/obpv1/social/delete_connection_badge/" badge-id))
                              {:response-format :json
                               :keywords?       true
                               :handler         (fn [data]
                                                  (do
                                                    (init-data state)))
                               :error-handler   (fn [{:keys [status status-text]}]
                                                  (.log js/console (str status " " status-text)))})}
      (t :social/Unfollow)])

(defn remove-issuer-from-favourites [issuer-id state]
  [:a {:href "#"

                                 :on-click #(do
                                              (mo/open-modal [:gallery :badges] {:badge-id id} {:hide (fn [] (init-data state))})
                                              ;(b/open-modal id false init-data state)
                                              (.preventDefault %))} name]]
                  [:td.action (unfollow id state)]]))]])]))

(defn content [state]
  (let [badges (:badges @state)
