                              (swap! state assoc (keyword all-key) true))}
         (t :core/All)]
        (doall
-        (for [button buttons]
-          (let [value button
-                checked? (boolean (some #(= value %) buttons-checked))]
-            [:button {:class    (str "btn btn-default " value " " (if checked? "btn-active"))
-                      :key      value
-                      :on-click (fn []
-                                  (swap! state assoc (keyword all-key) false)
-                                  (if checked?
-                                    (do
-                                      (if (= (count buttons-checked) 1)
-                                        (swap! state assoc (keyword all-key) true))
-                                      (swap! state assoc (keyword key)
-                                             (remove (fn [x] (= x value)) buttons-checked)))
-                                    (swap! state assoc (keyword key)
-                                           (conj buttons-checked value))))}
-             (t (keyword (str "admin/" value)))])))])]])
+         (for [button buttons]
+           (let [value button
+                 checked? (boolean (some #(= value %) buttons-checked))]
+             [:button {:class    (str "btn btn-default " value " " (if checked? "btn-active"))
+                       :key      value
+                       :on-click (fn []
+                                   (swap! state assoc (keyword all-key) false)
+                                   (if checked?
+                                     (do
+                                       (if (= (count buttons-checked) 1)
+                                         (swap! state assoc (keyword all-key) true))
+                                       (swap! state assoc (keyword key)
+                                              (remove (fn [x] (= x value)) buttons-checked)))
+                                     (swap! state assoc (keyword key)
+                                            (conj buttons-checked value))))}
+              (t (keyword (str "admin/" value)))])))])]])
 
 (defn grid-show-closed-tickets [state]
   (let [show-closed?  (cursor state [:show-closed?])]

            [salava.core.i18n :refer [t]]
            [salava.core.helper :refer [dump]]
            [salava.admin.ui.helper :refer [message-form email-select status-handler]]
            [salava.core.time :refer [date-from-unix-time]]))

(defn text-shorter [text length]
  (let [sorted-text (subs text 0 (min (count text) length))

                 :on-click #(do
                              (.preventDefault %)
                              (ajax/POST
                                (path-for (str "/obpv1/admin/close_ticket/" id))
                                {:response-format :json
                                 :keywords? true
                                 :params {:new-status (if open? "closed" "open")}
                                 :handler (fn [data]
                                            (if open?
                                              (init-data state)
                                              (get-closed-tickets state))
                                            )
                                 :error-handler (fn [{:keys [status status-text]}])}))}
        (if open? (t :admin/Done) (t :admin/Restore))]]]]))

(defn ticket-visible? [element state]
  (if (or (> (count
               (intersection
                 (into #{} (:types-selected @state))
                 #{(:report_type element)}))
             0)
          (= (:types-all @state)
             true))
