                          :status "false"}]
 
     (ajax/GET
-     (path-for (str "/obpv1/user/profile/" user-id) true)
-     {:handler (fn [data]
-                 (reset! state (assoc data :user-id user-id
-                                      :show-link-or-embed-code nil
-                                      :permission "success"
-                                      :badge-small-view false
-                                      :reporttool reporttool-init)))}
-     (fn [] (swap! state assoc :permission "error")))))
+      (path-for (str "/obpv1/user/profile/" user-id) true)
+      {:handler (fn [data]
+                  (reset! state (assoc data :user-id user-id
+                                  :show-link-or-embed-code nil
+                                  :permission "success"
+                                  :badge-small-view false
+                                  :reporttool reporttool-init)))}
+      (fn [] (swap! state assoc :permission "error")))))
 
 (defn handler [site-navi params]
   (let [user-id (:user-id params)

              :checked   (= "public" @visibility-atom)}]
     (t :user/Publishandshare)]]])

(defn badge-grid-element [element-data]
  (let [{:keys [id image_file name description issuer_content_name issuer_content_url]} element-data]
    ;[:div {:class "col-xs-12 col-sm-6 col-md-4" :key id}
     [:div {:class "media grid-container"}
      [:div.media-content
       (if image_file
         [:div.media-left
          [:a{:href "#"
              :on-click #(do
                           (mo/open-modal [:badge :info] {:badge-id id})
                                        ;(b/open-modal id false init-data state)
                           (.preventDefault %)) }
            [:img {:src (str "/" image_file)
                 :alt name}]]])
       [:div.media-body
        [:div.media-heading
         [:a.heading-link {:href "#"
                           :on-click #(do
                                        (mo/open-modal [:badge :info] {:badge-id id})
                                        ;(b/open-modal id false init-data state)
                                        (.preventDefault %)) }
          name]]
        [:div.media-issuer
         [:p issuer_content_name]]]]]
              ;]
              ))

(defn page-grid-element [element-data profile_picture]
  (let [{:keys [id name first_name last_name badges mtime]} element-data


(defn toggle-visibility [visibility-atom]
  (ajax/POST
    (path-for "/obpv1/user/profile/set_visibility")
    {:params  {:visibility (if (= "internal" @visibility-atom) "public" "internal")}
     :handler (fn [new-value]
                (reset! visibility-atom new-value)
                )}))

(defn profile-visibility-input [visibility-atom]
  [:div.col-xs-12
