        [:button {:class "btn btn-primary"
                  :on-click #(do
                               (m/modal! [visibility-modal badge state reload-fn] {:size :md :hidden (fn [] (reload-fn state))})
-                              #_(update-status (:id badge) "accepted" state init-data)
                               (.preventDefault %)
                               )
                  :data-dismiss "modal"}

          }(t :admin/Showmore)]
     [show-more-content state]]))

#_(defn visibility-settings [visibility state]
  (fn []
    [:div.col-md-12
     [:div.dropdown
      [:a.dropdown-toggle {:data-toggle "dropdown" :type "button" } (case @(cursor state [:visibility])
                                                                      "public" [:i.fa.fa-globe]
                                                                      "private" [:i.fa.fa-lock]
                                                                      "internal" [:i.fa.fa-group]
                                                                      (t :badge/Public)) #_[:i.fa.fa-share-alt] (case @(cursor state [:visibility])
                                                                                                                  "public" (t :badge/Public)
                                                                                                                  "private" (t :badge/Private)
                                                                                                                  "internal" (t :badge/Shared)
                                                                                                                  (t :badge/Public)) [:i.fa.fa-chevron-down]]
      [info "Set your badge visibility" "bottom"]
      [:ul.dropdown-menu
       [:li [:a {:href "#" :on-click #(do
                                        (.preventDefault %)
                                        (update-visibility "public" state)
                                        )} [:i {:class "fa fa-globe" }] [:div.text (t :badge/Public)]]]
       [:li [:a {:href "#" :on-click #(do
                                        (.preventDefault %)
                                        (update-visibility "internal" state)
                                        )} [:i {:class "fa fa-group" }] [:div.text (t :badge/Shared)]]]
       [:li [:a {:href "#" :on-click #(do
                                        (.preventDefault %)
                                        (update-visibility "private" state)
                                        )} [:i {:class "fa fa-lock" }] [:div.text (t :badge/Private)]]]
       ]]
     [:hr.line]]
    ;]
    ))

(defn pending-badge-content [{:keys [id image_file name description visibility assertion_url meta_badge meta_badge_req issuer_content_name issuer_content_url issued_on issued_by_obf verified_by_obf obf_url]}]
  (let [state (atom {:id id

     :keywords? true
     :params {:status new-status}
     :handler (fn []
                  (js/setTimeout (fn [] (swap! state assoc :badge-alert nil)) 2000)
                  (if reload-fn (reload-fn state)))
     :error-handler (fn [{:keys [status status-text]}])}))

(defn update-visibility [visibility badge state]
  (swap! state assoc :badge-alert nil)
  (ajax/POST
    (path-for (str "/obpv1/badge/set_visibility/" (:id badge)))
    {:params {:visibility visibility}
     :handler (fn [data]
                (when (= (:status data) "success")
                  (update-status (:id badge) "accepted" state nil)
                  (swap! state assoc :badge-alert "accepted" :badge-name (:name badge))
                  ))}))

