                      :tags-selected []
                      :badges-all false
                      :badges-selected []
-                     :current-view-badges []
                      :pdf-option "default"
                      :user-id (:id (session/get :user))
                      :initializing true})]

             (empty? (:badges @state)) (t :badge/Nobadgestoexport))]
          [:div
           [badge-grid-form state]
           [select-all-button state]
           (if (not (nil? (:backpack_id (first (filter #(= (:email %) (:email-selected @state)) (:emails @state))))))
             [:button {:class    "btn btn-primary"
                       :on-click #(export-badges state)
                       :disabled (= 0 (count (:badges-selected @state)))}
              (t :badge/Exportselected)])
           [:button {:class "btn btn-primary"
                     :on-click #(do (.preventDefault %)
                                     (swap! state assoc :pdf-option "default")
                                         (m/modal![export-to-pdf-modal state] {:size :lg}))
                     :disabled (= 0 (count (:badges-selected @state)))}
            (t :badge/Exporttopdf)]
           [badge-grid state]])]))])

(defn init-data [state]

    (conj (mapv #(hash-map :value % :title %) emails)  {:value "all" :title (t :badge/All)})))

(defn badges-for-grid [state]
  (if (= "all" (:email-selected @state))(:badges @state) (filter #(= (:email-selected @state) (:email %)) (:badges @state))))

(defn visibility-options []
  [{:value "all" :title (t :badge/All)}
