about summary refs log tree commit diff
path: root/app
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2022-08-28 04:00:39 +0200
committerGitHub <noreply@github.com>2022-08-28 04:00:39 +0200
commit546672e292dc3218e996048464c4c52e5d00f766 (patch)
treeb3d0e0b00baf0b62cd092a144b9c43b7550f5987 /app
parentc57907737a35d05d4bb936acd662df6ce725456f (diff)
Change "Allow trends without prior review" setting to include statuses (#17977)
* Change "Allow trends without prior review" setting to include posts

* Fix i18n-tasks
Diffstat (limited to 'app')
-rw-r--r--app/javascript/styles/mastodon/accounts.scss9
-rw-r--r--app/javascript/styles/mastodon/forms.scss3
-rw-r--r--app/models/account.rb4
-rw-r--r--app/views/admin/settings/edit.html.haml2
4 files changed, 15 insertions, 3 deletions
diff --git a/app/javascript/styles/mastodon/accounts.scss b/app/javascript/styles/mastodon/accounts.scss
index 54b65bfc8..c007eb4b5 100644
--- a/app/javascript/styles/mastodon/accounts.scss
+++ b/app/javascript/styles/mastodon/accounts.scss
@@ -202,7 +202,8 @@
 }
 
 .account-role,
-.simple_form .recommended {
+.simple_form .recommended,
+.simple_form .not_recommended {
   display: inline-block;
   padding: 4px 6px;
   cursor: default;
@@ -227,6 +228,12 @@
   }
 }
 
+.simple_form .not_recommended {
+  color: lighten($error-red, 12%);
+  background-color: rgba(lighten($error-red, 12%), 0.1);
+  border-color: rgba(lighten($error-red, 12%), 0.5);
+}
+
 .account__header__fields {
   max-width: 100vw;
   padding: 0;
diff --git a/app/javascript/styles/mastodon/forms.scss b/app/javascript/styles/mastodon/forms.scss
index 990903859..a6419821f 100644
--- a/app/javascript/styles/mastodon/forms.scss
+++ b/app/javascript/styles/mastodon/forms.scss
@@ -102,7 +102,8 @@ code {
         }
       }
 
-      .recommended {
+      .recommended,
+      .not_recommended {
         position: absolute;
         margin: 0 4px;
         margin-top: -2px;
diff --git a/app/models/account.rb b/app/models/account.rb
index d25afeb89..1be7b4d12 100644
--- a/app/models/account.rb
+++ b/app/models/account.rb
@@ -258,6 +258,10 @@ class Account < ApplicationRecord
     update!(memorial: true)
   end
 
+  def trendable
+    boolean_with_default('trendable', Setting.trendable_by_default)
+  end
+
   def sign?
     true
   end
diff --git a/app/views/admin/settings/edit.html.haml b/app/views/admin/settings/edit.html.haml
index d7896bbc0..64687b7a6 100644
--- a/app/views/admin/settings/edit.html.haml
+++ b/app/views/admin/settings/edit.html.haml
@@ -81,7 +81,7 @@
       = f.input :trends, as: :boolean, wrapper: :with_label, label: t('admin.settings.trends.title'), hint: t('admin.settings.trends.desc_html')
 
     .fields-group
-      = f.input :trendable_by_default, as: :boolean, wrapper: :with_label, label: t('admin.settings.trendable_by_default.title'), hint: t('admin.settings.trendable_by_default.desc_html')
+      = f.input :trendable_by_default, as: :boolean, wrapper: :with_label, label: t('admin.settings.trendable_by_default.title'), hint: t('admin.settings.trendable_by_default.desc_html'), recommended: :not_recommended
 
     .fields-group
       = f.input :noindex, as: :boolean, wrapper: :with_label, label: t('admin.settings.default_noindex.title'), hint: t('admin.settings.default_noindex.desc_html')