about summary refs log tree commit diff
path: root/app/controllers/settings/exports
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2019-01-01 13:44:04 +0100
committerGitHub <noreply@github.com>2019-01-01 13:44:04 +0100
commit7fc7437d05bf1441bb694b847f7e65ce37cd74fa (patch)
tree2ecefba5f58a812ab429151841b30e25a331097e /app/controllers/settings/exports
parent1d4215be777afde86208059e3eacf615533bc734 (diff)
Add CSV export for lists and domain blocks (#9677)
Fix #6893
Fix #9268
Diffstat (limited to 'app/controllers/settings/exports')
-rw-r--r--app/controllers/settings/exports/blocked_domains_controller.rb19
-rw-r--r--app/controllers/settings/exports/lists_controller.rb19
2 files changed, 38 insertions, 0 deletions
diff --git a/app/controllers/settings/exports/blocked_domains_controller.rb b/app/controllers/settings/exports/blocked_domains_controller.rb
new file mode 100644
index 000000000..6676ce340
--- /dev/null
+++ b/app/controllers/settings/exports/blocked_domains_controller.rb
@@ -0,0 +1,19 @@
+# frozen_string_literal: true
+
+module Settings
+  module Exports
+    class BlockedDomainsController < ApplicationController
+      include ExportControllerConcern
+
+      def index
+        send_export_file
+      end
+
+      private
+
+      def export_data
+        @export.to_blocked_domains_csv
+      end
+    end
+  end
+end
diff --git a/app/controllers/settings/exports/lists_controller.rb b/app/controllers/settings/exports/lists_controller.rb
new file mode 100644
index 000000000..cf5a9de44
--- /dev/null
+++ b/app/controllers/settings/exports/lists_controller.rb
@@ -0,0 +1,19 @@
+# frozen_string_literal: true
+
+module Settings
+  module Exports
+    class ListsController < ApplicationController
+      include ExportControllerConcern
+
+      def index
+        send_export_file
+      end
+
+      private
+
+      def export_data
+        @export.to_lists_csv
+      end
+    end
+  end
+end