 (defn save-badge-evidence [data state init-data]
   (let [{:keys [id name narrative url resource_visibility properties]} (:evidence @state)
         {:keys [resource_type mime_type resource_id]} properties
-        badge-id (:id data)
-        ;init-settings (first (plugin-fun (session/get :plugins) "modal" "show_settings_dialog"))
-        ]
+        badge-id (:id data)]
     (swap! state assoc :evidence {:message nil})
     (if (and (not (blank? narrative)) (blank? name))
       (swap! state assoc :evidence {:message [:div.alert.alert-warning [:p (t :badge/Emptynamefield)]]

(defn evidence-list [data state init-data]
  (let [evidence-name-atom (cursor state [:evidence :name])
        evidence-narrative-atom (cursor state [:evidence :narrative])
        ]
    (reduce (fn [r evidence]
              (let [{:keys [narrative description name id url mtime ctime properties]} evidence
                    {:keys [resource_id resource_type mime_type hidden]} properties

(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)]
    (ajax/POST
      (path-for (str "/obpv1/badge/toggle_evidence/" id))
      {:params {:show_evidence new-value
                :user_badge_id (int badgeid)}
       :handler #(init-settings badgeid state init-data)})))

(defn set-page-visibility-to-private [page-id]
  (ajax/POST
