       :style {:width "50px"}}]))
 
 (defn content [issuer-id]
-  (let [state (atom {:issuer nil :endorsement []})]
+  (let [state (atom {:issuer nil :endorsement []})
+        connected? (cursor state [:connected])]
     (init-issuer-content state issuer-id)
     (fn []
       (let [{:keys [name description email url image_file]} @state]
         [:div.row {:id "badge-contents"}
          [:div.col-xs-12
+          [:div.row
+           ;TODO users not logged in don't see this
+           [:div.pull-right
+            (if-not @connected?
+              [:a {:href "#" :on-click #(add-issuer-to-favourites issuer-id state)} [:i {:class "fa fa-bookmark-o"}] " add to favourites"]
+              [:a {:href "#" :on-click #(remove-issuer-from-favourites issuer-id state)} [:i {:class "fa fa-bookmark"}] " remove from favourites"]
+              )]
+           ]
           [:h2.uppercase-header
            (issuer-image image_file)
            " "




(defn init-issuer-content [state issuer-id]
  (ajax/GET
    (path-for (str "/obpv1/badge/issuer/" issuer-id))
    {:handler (fn [data] (reset! state data))}))

(defn init-creator-content [state creator-id]
  (ajax/GET
    (path-for (str "/obpv1/badge/creator/" creator-id))
    {:handler (fn [data]
                (prn data)
                (reset! state data))}))

(defn- issuer-image [path]
  (when (not-empty path)

(ns salava.badge.ui.issuer
  (:require [reagent.core :refer [atom cursor]]
            [salava.core.i18n :refer [t]]
            [salava.core.ui.ajax-utils :as ajax]
            [salava.core.ui.helper :refer [path-for private?]]
