                                           :class "close evidence-toggle"
                                           :on-click #(do
                                                        (.preventDefault %)
-                                                       (toggle-show-evidence! id data state init-data))} [:i.fa.show-more {:class (if @visibility-atom (str " fa-toggle-off") (str " fa-toggle-on"))
-                                                                                            :title (if @visibility-atom (t :badge/Showevidence) (t :badge/Showevidence))}]]]
+                                                       (init-evidence-form evidence state true)
+                                                       (toggle-show-evidence! id data state init-data))} [:i.fa.show-more {:class (if (= true hidden) (str " fa-toggle-off") (str " fa-toggle-on"))
+                                                                                                                           :title (t :badge/Showevidence)}]]]
                           (when added-by-user?
                             [:div [:div [:button {:type "button"
                                                   :aria-label "OK"

                                            :evidence {:url value
                                                       :name name
                                                       :narrative description
                                                       :mime_type mime_type
                                                       :resource_id id
                                                       :resource_type (case key
                                                                        :page_input "page"
                                                                        :file_input "file")
                                                       :resource_visibility visibility})) }
      (case key
        :page_input [:div.resource  [:i.fa.fa-file-text-o] name]

                    :name (:name evidence)
                    :url (:url evidence)
                    :narrative (:narrative evidence)
                    :properties {:resource_type (get-in evidence [:properties :resource_type]) :hidden (get-in evidence [:properties :hidden])}}]
    (swap! state assoc :evidence evidence)))

(defn toggle-show-evidence! [id data state init-data]
  (let [visibility-atom (cursor state [:evidence :properties :hidden])
        new-value (not @visibility-atom)
        badgeid (:id @state)
        init-settings (first (plugin-fun (session/get :plugins) "modal" "show_settings_dialog"))]
    (ajax/POST
      (path-for (str "/obpv1/badge/toggle_evidence/" id))
      {:params {:show_evidence new-value
                :user_badge_id badgeid}
       :handler (fn [data]
                  ;eset! visibility-atom new-value)
                  (when (= (:status data) "success")
                    (init-settings badgeid state init-data "settings"))
                  )})))

(defn set-page-visibility-to-private [page-id]
