diff options
author | Fire Demon <firedemon@creature.cafe> | 2020-06-28 06:19:52 -0500 |
---|---|---|
committer | Fire Demon <firedemon@creature.cafe> | 2020-08-30 05:41:03 -0500 |
commit | 25689e5b3992ac1759f7a7f09fe54f7caf1176ae (patch) | |
tree | 5d207657bad4ecf26ca25dfe29956e1e0ebb4543 /app | |
parent | 0f26894b065fcb40606bee1faaacd4cdaf8b3cd5 (diff) |
[Privacy] Let admins exclude private domains from the public allowlist
Diffstat (limited to 'app')
-rw-r--r-- | app/controllers/about_controller.rb | 2 | ||||
-rw-r--r-- | app/controllers/admin/domain_allows_controller.rb | 2 | ||||
-rw-r--r-- | app/models/domain_allow.rb | 1 | ||||
-rw-r--r-- | app/models/status.rb | 1 | ||||
-rw-r--r-- | app/views/admin/domain_allows/new.html.haml | 1 |
5 files changed, 4 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 |