about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--app/controllers/about_controller.rb2
-rw-r--r--app/controllers/admin/domain_allows_controller.rb2
-rw-r--r--app/models/domain_allow.rb1
-rw-r--r--app/models/status.rb1
-rw-r--r--app/views/admin/domain_allows/new.html.haml1
-rw-r--r--config/locales/en.yml1
-rw-r--r--db/migrate/20200628105849_add_hidden_to_domain_allows.rb7
-rw-r--r--db/schema.rb1
8 files changed, 13 insertions, 3 deletions
diff --git a/app/controllers/about_controller.rb b/app/controllers/about_controller.rb
index 218dcb99e..1f8f9ff58 100644
--- a/app/controllers/about_controller.rb
+++ b/app/controllers/about_controller.rb
@@ -21,7 +21,7 @@ class AboutController < ApplicationController
     @contents          = toc_generator.html
     @table_of_contents = toc_generator.toc
     @blocks            = DomainBlock.with_user_facing_limitations.by_severity if display_blocks?
-    @allows            = DomainAllow.all if display_allows?
+    @allows            = DomainAllow.where(hidden: false) if display_allows?
   end
 
   def terms; end
diff --git a/app/controllers/admin/domain_allows_controller.rb b/app/controllers/admin/domain_allows_controller.rb
index 31be1978b..95d9a31fb 100644
--- a/app/controllers/admin/domain_allows_controller.rb
+++ b/app/controllers/admin/domain_allows_controller.rb
@@ -35,6 +35,6 @@ class Admin::DomainAllowsController < Admin::BaseController
   end
 
   def resource_params
-    params.require(:domain_allow).permit(:domain)
+    params.require(:domain_allow).permit(:domain, :hidden)
   end
 end
diff --git a/app/models/domain_allow.rb b/app/models/domain_allow.rb
index 5fe0e3a29..734284e59 100644
--- a/app/models/domain_allow.rb
+++ b/app/models/domain_allow.rb
@@ -8,6 +8,7 @@
 #  domain     :string           default(""), not null
 #  created_at :datetime         not null
 #  updated_at :datetime         not null
+#  hidden     :boolean          default(FALSE)
 #
 
 class DomainAllow < ApplicationRecord
diff --git a/app/models/status.rb b/app/models/status.rb
index 594ae98c0..e4d94186e 100644
--- a/app/models/status.rb
+++ b/app/models/status.rb
@@ -22,7 +22,6 @@
 #  application_id         :bigint(8)
 #  in_reply_to_account_id :bigint(8)
 #  local_only             :boolean
-#  full_status_text       :text             default(""), not null
 #  poll_id                :bigint(8)
 #  content_type           :string
 #  deleted_at             :datetime
diff --git a/app/views/admin/domain_allows/new.html.haml b/app/views/admin/domain_allows/new.html.haml
index 85ab7e464..0540765d7 100644
--- a/app/views/admin/domain_allows/new.html.haml
+++ b/app/views/admin/domain_allows/new.html.haml
@@ -6,6 +6,7 @@
 
   .fields-group
     = f.input :domain, wrapper: :with_label, label: t('admin.domain_blocks.domain'), required: true
+    = f.input :hidden, wrapper: :with_label, label: t('admin.domain_allows.hidden')
 
   .actions
     = f.button :button, t('admin.domain_allows.add_new'), type: :submit
diff --git a/config/locales/en.yml b/config/locales/en.yml
index e9884ec3c..1073b51d9 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -358,6 +358,7 @@ en:
       created_msg: Domain has been successfully allowed for federation
       destroyed_msg: Domain has been disallowed from federation
       undo: Disallow federation with domain
+      hidden: Exclude from public server list
     domain_blocks:
       add_new: Add new domain block
       created_msg: Domain block is now being processed
diff --git a/db/migrate/20200628105849_add_hidden_to_domain_allows.rb b/db/migrate/20200628105849_add_hidden_to_domain_allows.rb
new file mode 100644
index 000000000..8fd4b79cc
--- /dev/null
+++ b/db/migrate/20200628105849_add_hidden_to_domain_allows.rb
@@ -0,0 +1,7 @@
+class AddHiddenToDomainAllows < ActiveRecord::Migration[5.2]
+  def change
+    safety_assured do
+      add_column :domain_allows, :hidden, :boolean, default: false, allow_null: false
+    end
+  end
+end
diff --git a/db/schema.rb b/db/schema.rb
index 37cd34136..d2767752a 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -339,6 +339,7 @@ ActiveRecord::Schema.define(version: 2020_06_28_133322) do
     t.string "domain", default: "", null: false
     t.datetime "created_at", null: false
     t.datetime "updated_at", null: false
+    t.boolean "hidden", default: false
     t.index ["domain"], name: "index_domain_allows_on_domain", unique: true
   end