From 97e5f739f785948f8fec0c4e555ef07da0baff67 Mon Sep 17 00:00:00 2001 From: mayaeh Date: Sun, 17 Mar 2019 11:12:47 +0900 Subject: Fix returned translations. (#10298) Add Japanese translations for the admission-based registrations. --- .../mastodon/locales/defaultMessages.json | 39 +++++++--------------- app/javascript/mastodon/locales/en.json | 5 +-- app/javascript/mastodon/locales/ja.json | 2 -- 3 files changed, 15 insertions(+), 31 deletions(-) (limited to 'app') diff --git a/app/javascript/mastodon/locales/defaultMessages.json b/app/javascript/mastodon/locales/defaultMessages.json index 344b88838..908232401 100644 --- a/app/javascript/mastodon/locales/defaultMessages.json +++ b/app/javascript/mastodon/locales/defaultMessages.json @@ -131,15 +131,6 @@ ], "path": "app/javascript/mastodon/components/domain.json" }, - { - "descriptors": [ - { - "defaultMessage": "It crashed!", - "id": "error_boundary.it_crashed" - } - ], - "path": "app/javascript/mastodon/components/error_boundary.json" - }, { "descriptors": [ { @@ -1870,6 +1861,10 @@ { "defaultMessage": "Boosts:", "id": "notifications.column_settings.reblog" + }, + { + "defaultMessage": "Poll results:", + "id": "notifications.column_settings.poll" } ], "path": "app/javascript/mastodon/features/notifications/components/column_settings.json" @@ -1888,6 +1883,10 @@ "defaultMessage": "Boosts", "id": "notifications.filter.boosts" }, + { + "defaultMessage": "Poll results", + "id": "notifications.filter.polls" + }, { "defaultMessage": "Follows", "id": "notifications.filter.follows" @@ -1912,6 +1911,10 @@ { "defaultMessage": "{name} boosted your status", "id": "notification.reblog" + }, + { + "defaultMessage": "A poll you have voted in has ended", + "id": "notification.poll" } ], "path": "app/javascript/mastodon/features/notifications/components/notification.json" @@ -1973,24 +1976,6 @@ ], "path": "app/javascript/mastodon/features/reblogs/index.json" }, - { - "descriptors": [ - { - "defaultMessage": "A look inside...", - "id": "standalone.public_title" - } - ], - "path": "app/javascript/mastodon/features/standalone/community_timeline/index.json" - }, - { - "descriptors": [ - { - "defaultMessage": "A look inside...", - "id": "standalone.public_title" - } - ], - "path": "app/javascript/mastodon/features/standalone/public_timeline/index.json" - }, { "descriptors": [ { diff --git a/app/javascript/mastodon/locales/en.json b/app/javascript/mastodon/locales/en.json index 929a4d0e0..ab52cb0ee 100644 --- a/app/javascript/mastodon/locales/en.json +++ b/app/javascript/mastodon/locales/en.json @@ -133,7 +133,6 @@ "empty_column.mutes": "You haven't muted any users yet.", "empty_column.notifications": "You don't have any notifications yet. Interact with others to start the conversation.", "empty_column.public": "There is nothing here! Write something publicly, or manually follow users from other servers to fill it up", - "error_boundary.it_crashed": "It crashed!", "follow_request.authorize": "Authorize", "follow_request.reject": "Reject", "getting_started.developers": "Developers", @@ -248,6 +247,7 @@ "notification.favourite": "{name} favourited your status", "notification.follow": "{name} followed you", "notification.mention": "{name} mentioned you", + "notification.poll": "A poll you have voted in has ended", "notification.reblog": "{name} boosted your status", "notifications.clear": "Clear notifications", "notifications.clear_confirmation": "Are you sure you want to permanently clear all your notifications?", @@ -258,6 +258,7 @@ "notifications.column_settings.filter_bar.show": "Show", "notifications.column_settings.follow": "New followers:", "notifications.column_settings.mention": "Mentions:", + "notifications.column_settings.poll": "Poll results:", "notifications.column_settings.push": "Push notifications", "notifications.column_settings.reblog": "Boosts:", "notifications.column_settings.show": "Show in column", @@ -267,6 +268,7 @@ "notifications.filter.favourites": "Favourites", "notifications.filter.follows": "Follows", "notifications.filter.mentions": "Mentions", + "notifications.filter.polls": "Poll results", "notifications.group": "{count} notifications", "poll.closed": "Closed", "poll.refresh": "Refresh", @@ -308,7 +310,6 @@ "search_results.hashtags": "Hashtags", "search_results.statuses": "Toots", "search_results.total": "{count, number} {count, plural, one {result} other {results}}", - "standalone.public_title": "A look inside...", "status.admin_account": "Open moderation interface for @{name}", "status.admin_status": "Open this status in the moderation interface", "status.block": "Block @{name}", diff --git a/app/javascript/mastodon/locales/ja.json b/app/javascript/mastodon/locales/ja.json index 7c204646d..117ec6332 100644 --- a/app/javascript/mastodon/locales/ja.json +++ b/app/javascript/mastodon/locales/ja.json @@ -133,7 +133,6 @@ "empty_column.mutes": "まだ誰もミュートしていません。", "empty_column.notifications": "まだ通知がありません。他の人とふれ合って会話を始めましょう。", "empty_column.public": "ここにはまだ何もありません! 公開で何かを投稿したり、他のサーバーのユーザーをフォローしたりしていっぱいにしましょう", - "error_boundary.it_crashed": "It crashed!", "follow_request.authorize": "許可", "follow_request.reject": "拒否", "getting_started.developers": "開発", @@ -308,7 +307,6 @@ "search_results.hashtags": "ハッシュタグ", "search_results.statuses": "トゥート", "search_results.total": "{count, number}件の結果", - "standalone.public_title": "A look inside...", "status.admin_account": "@{name} のモデレーション画面を開く", "status.admin_status": "このトゥートをモデレーション画面で開く", "status.block": "@{name}さんをブロック", -- cgit From 7477db7268f2a4c158e5f7683493a728d632f7e2 Mon Sep 17 00:00:00 2001 From: ThibG Date: Sun, 17 Mar 2019 03:13:29 +0100 Subject: Save quick filter settings when selecting a different filter (#10296) The active filter is stored in the web app's settings, but no save is explicitly triggered, meaning that it is only saved when a different setting is changed. --- app/javascript/mastodon/actions/notifications.js | 2 ++ 1 file changed, 2 insertions(+) (limited to 'app') diff --git a/app/javascript/mastodon/actions/notifications.js b/app/javascript/mastodon/actions/notifications.js index 61fef19e9..b0861fc6b 100644 --- a/app/javascript/mastodon/actions/notifications.js +++ b/app/javascript/mastodon/actions/notifications.js @@ -7,6 +7,7 @@ import { importFetchedStatus, importFetchedStatuses, } from './importer'; +import { saveSettings } from './settings'; import { defineMessages } from 'react-intl'; import { List as ImmutableList } from 'immutable'; import { unescapeHTML } from '../utils/html'; @@ -187,5 +188,6 @@ export function setFilter (filterType) { value: filterType, }); dispatch(expandNotifications()); + dispatch(saveSettings()); }; }; -- cgit From 5e38ef87a7b8bac59ffa0d98464086ab8a60a2e1 Mon Sep 17 00:00:00 2001 From: ThibG Date: Sun, 17 Mar 2019 14:54:09 +0100 Subject: Fix reblogs privacy (#10302) * Fix reblogs privacy * Fix Announce processing specs --- app/models/status.rb | 2 +- spec/lib/activitypub/activity/announce_spec.rb | 1 + spec/services/reblog_service_spec.rb | 21 +++++++++++++++++++++ 3 files changed, 23 insertions(+), 1 deletion(-) (limited to 'app') diff --git a/app/models/status.rb b/app/models/status.rb index 571167943..b9479c76b 100644 --- a/app/models/status.rb +++ b/app/models/status.rb @@ -453,8 +453,8 @@ class Status < ApplicationRecord end def set_visibility + self.visibility = reblog.visibility if reblog? && visibility.nil? self.visibility = (account.locked? ? :private : :public) if visibility.nil? - self.visibility = reblog.visibility if reblog? self.sensitive = false if sensitive.nil? end diff --git a/spec/lib/activitypub/activity/announce_spec.rb b/spec/lib/activitypub/activity/announce_spec.rb index aa58d9e23..926083a4f 100644 --- a/spec/lib/activitypub/activity/announce_spec.rb +++ b/spec/lib/activitypub/activity/announce_spec.rb @@ -12,6 +12,7 @@ RSpec.describe ActivityPub::Activity::Announce do type: 'Announce', actor: 'https://example.com/actor', object: object_json, + to: 'http://example.com/followers', }.with_indifferent_access end diff --git a/spec/services/reblog_service_spec.rb b/spec/services/reblog_service_spec.rb index 2755da772..9e66c6643 100644 --- a/spec/services/reblog_service_spec.rb +++ b/spec/services/reblog_service_spec.rb @@ -3,6 +3,27 @@ require 'rails_helper' RSpec.describe ReblogService, type: :service do let(:alice) { Fabricate(:account, username: 'alice') } + context 'creates a reblog with appropriate visibility' do + let(:bob) { Fabricate(:account, username: 'bob') } + let(:visibility) { :public } + let(:reblog_visibility) { :public } + let(:status) { Fabricate(:status, account: bob, visibility: visibility) } + + subject { ReblogService.new } + + before do + subject.call(alice, status, visibility: reblog_visibility) + end + + describe 'boosting privately' do + let(:reblog_visibility) { :private } + + it 'reblogs privately' do + expect(status.reblogs.first.visibility).to eq 'private' + end + end + end + context 'OStatus' do let(:bob) { Fabricate(:account, username: 'bob', domain: 'example.com', salmon_url: 'http://salmon.example.com') } let(:status) { Fabricate(:status, account: bob, uri: 'tag:example.com;something:something') } -- cgit From a20354a20b9dffada0e8d6170ebc2ff13c79baea Mon Sep 17 00:00:00 2001 From: ThibG Date: Sun, 17 Mar 2019 15:34:56 +0100 Subject: Set and store report URIs (#10303) Fixes #10271 --- app/lib/activitypub/activity/flag.rb | 7 ++++++- app/models/report.rb | 11 +++++++++++ app/serializers/activitypub/flag_serializer.rb | 1 - app/services/report_service.rb | 3 ++- db/migrate/20190317135723_add_uri_to_reports.rb | 5 +++++ db/schema.rb | 3 ++- spec/lib/activitypub/activity/flag_spec.rb | 23 +++++++++++++++++++++-- spec/services/report_service_spec.rb | 5 +++++ 8 files changed, 52 insertions(+), 6 deletions(-) create mode 100644 db/migrate/20190317135723_add_uri_to_reports.rb (limited to 'app') diff --git a/app/lib/activitypub/activity/flag.rb b/app/lib/activitypub/activity/flag.rb index 0d10d6c3c..f73b93058 100644 --- a/app/lib/activitypub/activity/flag.rb +++ b/app/lib/activitypub/activity/flag.rb @@ -14,7 +14,8 @@ class ActivityPub::Activity::Flag < ActivityPub::Activity @account, target_account, status_ids: target_statuses.nil? ? [] : target_statuses.map(&:id), - comment: @json['content'] || '' + comment: @json['content'] || '', + uri: report_uri ) end end @@ -28,4 +29,8 @@ class ActivityPub::Activity::Flag < ActivityPub::Activity def object_uris @object_uris ||= Array(@object.is_a?(Array) ? @object.map { |item| value_or_id(item) } : value_or_id(@object)) end + + def report_uri + @json['id'] unless @json['id'].nil? || invalid_origin?(@json['id']) + end end diff --git a/app/models/report.rb b/app/models/report.rb index 2804020f5..86c303798 100644 --- a/app/models/report.rb +++ b/app/models/report.rb @@ -13,6 +13,7 @@ # action_taken_by_account_id :bigint(8) # target_account_id :bigint(8) not null # assigned_account_id :bigint(8) +# uri :string # class Report < ApplicationRecord @@ -28,6 +29,12 @@ class Report < ApplicationRecord validates :comment, length: { maximum: 1000 } + def local? + false # Force uri_for to use uri attribute + end + + before_validation :set_uri, only: :create + def object_type :flag end @@ -89,4 +96,8 @@ class Report < ApplicationRecord Admin::ActionLog.from("(#{sql}) AS admin_action_logs") end + + def set_uri + self.uri = ActivityPub::TagManager.instance.generate_uri_for(self) if uri.nil? && account.local? + end end diff --git a/app/serializers/activitypub/flag_serializer.rb b/app/serializers/activitypub/flag_serializer.rb index 53e8f726d..1e7a46dd9 100644 --- a/app/serializers/activitypub/flag_serializer.rb +++ b/app/serializers/activitypub/flag_serializer.rb @@ -5,7 +5,6 @@ class ActivityPub::FlagSerializer < ActiveModel::Serializer attribute :virtual_object, key: :object def id - # This is nil for now ActivityPub::TagManager.instance.uri_for(object) end diff --git a/app/services/report_service.rb b/app/services/report_service.rb index 1bcc1c0d5..73bd6694f 100644 --- a/app/services/report_service.rb +++ b/app/services/report_service.rb @@ -21,7 +21,8 @@ class ReportService < BaseService @report = @source_account.reports.create!( target_account: @target_account, status_ids: @status_ids, - comment: @comment + comment: @comment, + uri: @options[:uri] ) end diff --git a/db/migrate/20190317135723_add_uri_to_reports.rb b/db/migrate/20190317135723_add_uri_to_reports.rb new file mode 100644 index 000000000..47c0f2a21 --- /dev/null +++ b/db/migrate/20190317135723_add_uri_to_reports.rb @@ -0,0 +1,5 @@ +class AddUriToReports < ActiveRecord::Migration[5.2] + def change + add_column :reports, :uri, :string + end +end diff --git a/db/schema.rb b/db/schema.rb index 23ec08238..790e347c3 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 2019_03_14_181829) do +ActiveRecord::Schema.define(version: 2019_03_17_135723) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -525,6 +525,7 @@ ActiveRecord::Schema.define(version: 2019_03_14_181829) do t.bigint "action_taken_by_account_id" t.bigint "target_account_id", null: false t.bigint "assigned_account_id" + t.string "uri" t.index ["account_id"], name: "index_reports_on_account_id" t.index ["target_account_id"], name: "index_reports_on_target_account_id" end diff --git a/spec/lib/activitypub/activity/flag_spec.rb b/spec/lib/activitypub/activity/flag_spec.rb index 3f082a813..ec7359f2f 100644 --- a/spec/lib/activitypub/activity/flag_spec.rb +++ b/spec/lib/activitypub/activity/flag_spec.rb @@ -1,14 +1,15 @@ require 'rails_helper' RSpec.describe ActivityPub::Activity::Flag do - let(:sender) { Fabricate(:account, domain: 'example.com') } + let(:sender) { Fabricate(:account, domain: 'example.com', uri: 'http://example.com/account') } let(:flagged) { Fabricate(:account) } let(:status) { Fabricate(:status, account: flagged, uri: 'foobar') } + let(:flag_id) { nil } let(:json) do { '@context': 'https://www.w3.org/ns/activitystreams', - id: nil, + id: flag_id, type: 'Flag', content: 'Boo!!', actor: ActivityPub::TagManager.instance.uri_for(sender), @@ -34,4 +35,22 @@ RSpec.describe ActivityPub::Activity::Flag do expect(report.status_ids).to eq [status.id] end end + + describe '#perform with a defined uri' do + subject { described_class.new(json, sender) } + let (:flag_id) { 'http://example.com/reports/1' } + + before do + subject.perform + end + + it 'creates a report' do + report = Report.find_by(account: sender, target_account: flagged) + + expect(report).to_not be_nil + expect(report.comment).to eq 'Boo!!' + expect(report.status_ids).to eq [status.id] + expect(report.uri).to eq flag_id + end + end end diff --git a/spec/services/report_service_spec.rb b/spec/services/report_service_spec.rb index e8b094c89..454e4d896 100644 --- a/spec/services/report_service_spec.rb +++ b/spec/services/report_service_spec.rb @@ -21,6 +21,11 @@ RSpec.describe ReportService, type: :service do subject.call(source_account, remote_account, forward: false) expect(a_request(:post, 'http://example.com/inbox')).to_not have_been_made end + + it 'has an uri' do + report = subject.call(source_account, remote_account, forward: true) + expect(report.uri).to_not be_nil + end end context 'when other reports already exist for the same target' do -- cgit From c3d1594576227fcbc45d1da97f474acbd23d831b Mon Sep 17 00:00:00 2001 From: Ben Lubar Date: Sun, 17 Mar 2019 09:39:25 -0500 Subject: Reduce server load caused by anonymous viewing. (#9059) Do not start a session if the current user is not logged in for public-facing pages. Mark pages that don't care about sessions as publicly cacheable. Keep the max age as 0 so proxies and browsers will still try to retrieve an updated version but can still fall back to the stale version if the site is down or too slow. Fixes #9035. --- app/controllers/accounts_controller.rb | 8 +++++++- app/controllers/application_controller.rb | 5 +++++ app/controllers/follower_accounts_controller.rb | 2 ++ app/controllers/statuses_controller.rb | 4 +++- 4 files changed, 17 insertions(+), 2 deletions(-) (limited to 'app') diff --git a/app/controllers/accounts_controller.rb b/app/controllers/accounts_controller.rb index a3410c1ef..abc68d2a4 100644 --- a/app/controllers/accounts_controller.rb +++ b/app/controllers/accounts_controller.rb @@ -10,6 +10,8 @@ class AccountsController < ApplicationController def show respond_to do |format| format.html do + mark_cacheable! unless user_signed_in? + @body_classes = 'with-modals' @pinned_statuses = [] @endorsed_accounts = @account.endorsed_accounts.to_a.sample(4) @@ -30,17 +32,21 @@ class AccountsController < ApplicationController end format.atom do + mark_cacheable! + @entries = @account.stream_entries.where(hidden: false).with_includes.paginate_by_max_id(PAGE_SIZE, params[:max_id], params[:since_id]) render xml: OStatus::AtomSerializer.render(OStatus::AtomSerializer.new.feed(@account, @entries.reject { |entry| entry.status.nil? })) end format.rss do + mark_cacheable! + @statuses = cache_collection(default_statuses.without_reblogs.without_replies.limit(PAGE_SIZE), Status) render xml: RSS::AccountSerializer.render(@account, @statuses) end format.json do - skip_session! + mark_cacheable! render_cached_json(['activitypub', 'actor', @account], content_type: 'application/activity+json') do ActiveModelSerializers::SerializableResource.new(@account, serializer: ActivityPub::ActorSerializer, adapter: ActivityPub::Adapter) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index b54e7b008..990aff857 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -151,6 +151,11 @@ class ApplicationController < ActionController::Base response.headers['Vary'] = 'Accept' end + def mark_cacheable! + skip_session! + expires_in 0, public: true + end + def skip_session! request.session_options[:skip] = true end diff --git a/app/controllers/follower_accounts_controller.rb b/app/controllers/follower_accounts_controller.rb index 99cb3676f..aea42bd63 100644 --- a/app/controllers/follower_accounts_controller.rb +++ b/app/controllers/follower_accounts_controller.rb @@ -6,6 +6,8 @@ class FollowerAccountsController < ApplicationController def index respond_to do |format| format.html do + mark_cacheable! unless user_signed_in? + next if @account.user_hides_network? follows diff --git a/app/controllers/statuses_controller.rb b/app/controllers/statuses_controller.rb index 3686bd9fd..fc44d5fb1 100644 --- a/app/controllers/statuses_controller.rb +++ b/app/controllers/statuses_controller.rb @@ -27,6 +27,8 @@ class StatusesController < ApplicationController def show respond_to do |format| format.html do + mark_cacheable! unless user_signed_in? + @body_classes = 'with-modals' set_ancestors @@ -36,7 +38,7 @@ class StatusesController < ApplicationController end format.json do - skip_session! unless @stream_entry.hidden? + mark_cacheable! unless @stream_entry.hidden? render_cached_json(['activitypub', 'note', @status], content_type: 'application/activity+json', public: !@stream_entry.hidden?) do ActiveModelSerializers::SerializableResource.new(@status, serializer: ActivityPub::NoteSerializer, adapter: ActivityPub::Adapter) -- cgit From 7130d6e51291b08df59f9580c7d6e1c1d97e7dad Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Sun, 17 Mar 2019 22:36:54 +0100 Subject: Fix relationship manager on narrow screens (#10293) At the cost of functionality --- app/javascript/styles/mastodon/tables.scss | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'app') diff --git a/app/javascript/styles/mastodon/tables.scss b/app/javascript/styles/mastodon/tables.scss index d3a0ea03d..11ac6dfeb 100644 --- a/app/javascript/styles/mastodon/tables.scss +++ b/app/javascript/styles/mastodon/tables.scss @@ -149,6 +149,10 @@ a.table-action-link { margin-top: 0; } } + + @media screen and (max-width: $no-gap-breakpoint) { + display: none; + } } &__actions, @@ -170,6 +174,10 @@ a.table-action-link { text-align: right; padding-right: 16px - 5px; } + + @media screen and (max-width: $no-gap-breakpoint) { + display: none; + } } &__row { @@ -177,6 +185,12 @@ a.table-action-link { border-top: 0; background: darken($ui-base-color, 4%); + @media screen and (max-width: $no-gap-breakpoint) { + &:first-child { + border-top: 1px solid darken($ui-base-color, 8%); + } + } + &:hover { background: darken($ui-base-color, 2%); } @@ -215,5 +229,15 @@ a.table-action-link { border: 1px solid darken($ui-base-color, 8%); border-top: 0; box-shadow: none; + + @media screen and (max-width: $no-gap-breakpoint) { + border-top: 1px solid darken($ui-base-color, 8%); + } + } + + @media screen and (max-width: 870px) { + .accounts-table tbody td.optional { + display: none; + } } } -- cgit From b8e4c85e69443abb141e666b36606056e86e116c Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Mon, 18 Mar 2019 03:53:17 +0100 Subject: Add dormant filter to relationship manager, rename other filters (#10308) Rename "abandoned" to "moved", and "active" to "primary" --- app/controllers/relationships_controller.rb | 19 ++++++++++++------- app/helpers/admin/filter_helper.rb | 2 +- app/views/relationships/show.html.haml | 11 +++++++++-- config/locales/en.yml | 6 ++++-- 4 files changed, 26 insertions(+), 12 deletions(-) (limited to 'app') diff --git a/app/controllers/relationships_controller.rb b/app/controllers/relationships_controller.rb index e6dd65e44..84cb178a6 100644 --- a/app/controllers/relationships_controller.rb +++ b/app/controllers/relationships_controller.rb @@ -31,17 +31,18 @@ class RelationshipsController < ApplicationController def relationships_scope scope = begin if following_relationship? - current_account.following.includes(:account_stat) + current_account.following.joins(:account_stat) else - current_account.followers.includes(:account_stat) + current_account.followers.joins(:account_stat) end end scope.merge!(Follow.recent) scope.merge!(mutual_relationship_scope) if mutual_relationship? - scope.merge!(abandoned_account_scope) if params[:status] == 'abandoned' - scope.merge!(active_account_scope) if params[:status] == 'active' + scope.merge!(moved_account_scope) if params[:status] == 'moved' + scope.merge!(primary_account_scope) if params[:status] == 'primary' scope.merge!(by_domain_scope) if params[:by_domain].present? + scope.merge!(dormant_account_scope) if params[:activity] == 'dormant' scope end @@ -50,14 +51,18 @@ class RelationshipsController < ApplicationController Account.where(id: current_account.following) end - def abandoned_account_scope + def moved_account_scope Account.where.not(moved_to_account_id: nil) end - def active_account_scope + def primary_account_scope Account.where(moved_to_account_id: nil) end + def dormant_account_scope + AccountStat.where(last_status_at: nil).or(AccountStat.where(AccountStat.arel_table[:last_status_at].lt(1.month.ago))) + end + def by_domain_scope Account.where(domain: params[:by_domain]) end @@ -79,7 +84,7 @@ class RelationshipsController < ApplicationController end def current_params - params.slice(:page, :status, :relationship, :by_domain).permit(:page, :status, :relationship, :by_domain) + params.slice(:page, :status, :relationship, :by_domain, :activity).permit(:page, :status, :relationship, :by_domain, :activity) end def action_from_button diff --git a/app/helpers/admin/filter_helper.rb b/app/helpers/admin/filter_helper.rb index 09a356296..4fd36ef42 100644 --- a/app/helpers/admin/filter_helper.rb +++ b/app/helpers/admin/filter_helper.rb @@ -7,7 +7,7 @@ module Admin::FilterHelper CUSTOM_EMOJI_FILTERS = %i(local remote by_domain shortcode).freeze TAGS_FILTERS = %i(hidden).freeze INSTANCES_FILTERS = %i(limited by_domain).freeze - FOLLOWERS_FILTERS = %i(relationship status by_domain).freeze + FOLLOWERS_FILTERS = %i(relationship status by_domain activity).freeze FILTERS = ACCOUNT_FILTERS + REPORT_FILTERS + INVITE_FILTER + CUSTOM_EMOJI_FILTERS + TAGS_FILTERS + INSTANCES_FILTERS + FOLLOWERS_FILTERS diff --git a/app/views/relationships/show.html.haml b/app/views/relationships/show.html.haml index 33a43f1a8..63745119a 100644 --- a/app/views/relationships/show.html.haml +++ b/app/views/relationships/show.html.haml @@ -16,13 +16,20 @@ %strong= t 'relationships.status' %ul %li= filter_link_to t('generic.all'), status: nil - %li= filter_link_to t('relationships.active'), status: 'active' - %li= filter_link_to t('relationships.abandoned'), status: 'abandoned' + %li= filter_link_to t('relationships.primary'), status: 'primary' + %li= filter_link_to t('relationships.moved'), status: 'moved' + + .filter-subset + %strong= t 'relationships.activity' + %ul + %li= filter_link_to t('generic.all'), activity: nil + %li= filter_link_to t('relationships.dormant'), activity: 'dormant' = form_for(@form, url: relationships_path, method: :patch) do |f| = hidden_field_tag :page, params[:page] || 1 = hidden_field_tag :relationship, params[:relationship] = hidden_field_tag :status, params[:status] + = hidden_field_tag :activity, params[:activity] .batch-table .batch-table__toolbar diff --git a/config/locales/en.yml b/config/locales/en.yml index 4f9104eea..9f1081fb8 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -751,9 +751,11 @@ en: publishing: Publishing web: Web relationships: - abandoned: Abandoned - active: Active + activity: Account activity + dormant: Dormant + moved: Moved mutual: Mutual + primary: Primary relationship: Relationship remove_selected_domains: Remove all followers from the selected domains remove_selected_followers: Remove selected followers -- cgit