Merge pull request #1264 from ThibG/glitch-soc/merge-upstream

Merge upstream changes
main
ThibG 2020-01-20 19:20:40 +01:00 committed by GitHub
commit a8c109baca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
85 changed files with 1199 additions and 858 deletions

View File

@ -116,13 +116,6 @@ jobs:
environment: *ruby_environment environment: *ruby_environment
<<: *install_ruby_dependencies <<: *install_ruby_dependencies
install-ruby2.4:
<<: *defaults
docker:
- image: circleci/ruby:2.4-buster-node
environment: *ruby_environment
<<: *install_ruby_dependencies
build: build:
<<: *defaults <<: *defaults
steps: steps:
@ -187,17 +180,6 @@ jobs:
- image: circleci/redis:5-alpine - image: circleci/redis:5-alpine
<<: *test_steps <<: *test_steps
test-ruby2.4:
<<: *defaults
docker:
- image: circleci/ruby:2.4-buster-node
environment: *ruby_environment
- image: circleci/postgres:10.6-alpine
environment:
POSTGRES_USER: root
- image: circleci/redis:5-alpine
<<: *test_steps
test-webui: test-webui:
<<: *defaults <<: *defaults
docker: docker:
@ -232,10 +214,6 @@ workflows:
requires: requires:
- install - install
- install-ruby2.7 - install-ruby2.7
- install-ruby2.4:
requires:
- install
- install-ruby2.7
- build: - build:
requires: requires:
- install-ruby2.7 - install-ruby2.7
@ -254,10 +232,6 @@ workflows:
requires: requires:
- install-ruby2.5 - install-ruby2.5
- build - build
- test-ruby2.4:
requires:
- install-ruby2.4
- build
- test-webui: - test-webui:
requires: requires:
- install - install

11
Gemfile
View File

@ -60,7 +60,7 @@ gem 'htmlentities', '~> 4.3'
gem 'http', '~> 4.3' gem 'http', '~> 4.3'
gem 'http_accept_language', '~> 2.1' gem 'http_accept_language', '~> 2.1'
gem 'http_parser.rb', '~> 0.6', git: 'https://github.com/tmm1/http_parser.rb', ref: '54b17ba8c7d8d20a16dfc65d1775241833219cf2', submodules: true gem 'http_parser.rb', '~> 0.6', git: 'https://github.com/tmm1/http_parser.rb', ref: '54b17ba8c7d8d20a16dfc65d1775241833219cf2', submodules: true
gem 'httplog', '~> 1.3' gem 'httplog', '~> 1.4'
gem 'idn-ruby', require: 'idn' gem 'idn-ruby', require: 'idn'
gem 'kaminari', '~> 1.1' gem 'kaminari', '~> 1.1'
gem 'link_header', '~> 0.0' gem 'link_header', '~> 0.0'
@ -69,7 +69,7 @@ gem 'nilsimsa', git: 'https://github.com/witgo/nilsimsa', ref: 'fd184883048b922b
gem 'nokogiri', '~> 1.10' gem 'nokogiri', '~> 1.10'
gem 'nsa', '~> 0.2' gem 'nsa', '~> 0.2'
gem 'oj', '~> 3.10' gem 'oj', '~> 3.10'
gem 'ox', '~> 2.11' gem 'ox', '~> 2.12'
gem 'parslet' gem 'parslet'
gem 'parallel', '~> 1.19' gem 'parallel', '~> 1.19'
gem 'posix-spawn', git: 'https://github.com/rtomayko/posix-spawn', ref: '58465d2e213991f8afb13b984854a49fcdcc980c' gem 'posix-spawn', git: 'https://github.com/rtomayko/posix-spawn', ref: '58465d2e213991f8afb13b984854a49fcdcc980c'
@ -100,7 +100,7 @@ gem 'tzinfo-data', '~> 1.2019'
gem 'webpacker', '~> 4.2' gem 'webpacker', '~> 4.2'
gem 'webpush' gem 'webpush'
gem 'json-ld', git: 'https://github.com/ruby-rdf/json-ld.git', ref: 'e742697a0906e74e8bb777ef98137bc3955d981d' gem 'json-ld'
gem 'json-ld-preloaded', '~> 3.0' gem 'json-ld-preloaded', '~> 3.0'
gem 'rdf-normalize', '~> 0.4' gem 'rdf-normalize', '~> 0.4'
@ -127,7 +127,7 @@ group :test do
gem 'rails-controller-testing', '~> 1.0' gem 'rails-controller-testing', '~> 1.0'
gem 'rspec-sidekiq', '~> 3.0' gem 'rspec-sidekiq', '~> 3.0'
gem 'simplecov', '~> 0.17', require: false gem 'simplecov', '~> 0.17', require: false
gem 'webmock', '~> 3.7' gem 'webmock', '~> 3.8'
gem 'parallel_tests', '~> 2.30' gem 'parallel_tests', '~> 2.30'
end end
@ -140,7 +140,7 @@ group :development do
gem 'letter_opener', '~> 1.7' gem 'letter_opener', '~> 1.7'
gem 'letter_opener_web', '~> 1.3' gem 'letter_opener_web', '~> 1.3'
gem 'memory_profiler' gem 'memory_profiler'
gem 'rubocop', '~> 0.78', require: false gem 'rubocop', '~> 0.79', require: false
gem 'rubocop-rails', '~> 2.4', require: false gem 'rubocop-rails', '~> 2.4', require: false
gem 'brakeman', '~> 4.7', require: false gem 'brakeman', '~> 4.7', require: false
gem 'bundler-audit', '~> 0.6', require: false gem 'bundler-audit', '~> 0.6', require: false
@ -150,7 +150,6 @@ group :development do
gem 'capistrano-rbenv', '~> 2.1' gem 'capistrano-rbenv', '~> 2.1'
gem 'capistrano-yarn', '~> 2.0' gem 'capistrano-yarn', '~> 2.0'
gem 'derailed_benchmarks'
gem 'stackprof' gem 'stackprof'
end end

View File

@ -13,19 +13,6 @@ GIT
specs: specs:
posix-spawn (0.3.13) posix-spawn (0.3.13)
GIT
remote: https://github.com/ruby-rdf/json-ld.git
revision: e742697a0906e74e8bb777ef98137bc3955d981d
ref: e742697a0906e74e8bb777ef98137bc3955d981d
specs:
json-ld (3.0.2)
htmlentities (~> 4.3)
json-canonicalization (~> 0.1)
link_header (~> 0.0, >= 0.0.8)
multi_json (~> 1.13)
rack (>= 1.6, < 3.0)
rdf (~> 3.0, >= 3.0.8)
GIT GIT
remote: https://github.com/tmm1/http_parser.rb remote: https://github.com/tmm1/http_parser.rb
revision: 54b17ba8c7d8d20a16dfc65d1775241833219cf2 revision: 54b17ba8c7d8d20a16dfc65d1775241833219cf2
@ -93,7 +80,7 @@ GEM
tzinfo (~> 1.1) tzinfo (~> 1.1)
addressable (2.7.0) addressable (2.7.0)
public_suffix (>= 2.0.2, < 5.0) public_suffix (>= 2.0.2, < 5.0)
airbrussh (1.3.4) airbrussh (1.4.0)
sshkit (>= 1.6.1, != 1.7.0) sshkit (>= 1.6.1, != 1.7.0)
annotate (3.0.3) annotate (3.0.3)
activerecord (>= 3.2, < 7.0) activerecord (>= 3.2, < 7.0)
@ -121,7 +108,6 @@ GEM
aws-sigv4 (1.1.0) aws-sigv4 (1.1.0)
aws-eventstream (~> 1.0, >= 1.0.2) aws-eventstream (~> 1.0, >= 1.0.2)
bcrypt (3.1.12) bcrypt (3.1.12)
benchmark-ips (2.7.2)
better_errors (2.5.1) better_errors (2.5.1)
coderay (>= 1.0.0) coderay (>= 1.0.0)
erubi (>= 1.0.0) erubi (>= 1.0.0)
@ -133,7 +119,7 @@ GEM
bootsnap (1.4.5) bootsnap (1.4.5)
msgpack (~> 1.0) msgpack (~> 1.0)
brakeman (4.7.2) brakeman (4.7.2)
browser (2.7.1) browser (3.0.3)
builder (3.2.4) builder (3.2.4)
bullet (6.1.0) bullet (6.1.0)
activesupport (>= 3.0.0) activesupport (>= 3.0.0)
@ -153,7 +139,7 @@ GEM
capistrano-rails (1.4.0) capistrano-rails (1.4.0)
capistrano (~> 3.1) capistrano (~> 3.1)
capistrano-bundler (~> 1.1) capistrano-bundler (~> 1.1)
capistrano-rbenv (2.1.4) capistrano-rbenv (2.1.6)
capistrano (~> 3.1) capistrano (~> 3.1)
sshkit (~> 1.3) sshkit (~> 1.3)
capistrano-yarn (2.0.2) capistrano-yarn (2.0.2)
@ -184,19 +170,10 @@ GEM
connection_pool (2.2.2) connection_pool (2.2.2)
crack (0.4.3) crack (0.4.3)
safe_yaml (~> 1.0.0) safe_yaml (~> 1.0.0)
crass (1.0.5) crass (1.0.6)
css_parser (1.7.1) css_parser (1.7.1)
addressable addressable
debug_inspector (0.0.3) debug_inspector (0.0.3)
derailed_benchmarks (1.4.3)
benchmark-ips (~> 2)
get_process_mem (~> 0)
heapy (~> 0)
memory_profiler (~> 0)
rack (>= 1)
rake (> 10, < 14)
ruby-statistics (>= 2.1)
thor (~> 0.19)
devise (4.7.1) devise (4.7.1)
bcrypt (~> 3.0) bcrypt (~> 3.0)
orm_adapter (~> 0.1) orm_adapter (~> 0.1)
@ -241,8 +218,8 @@ GEM
tzinfo tzinfo
excon (0.71.0) excon (0.71.0)
fabrication (2.21.0) fabrication (2.21.0)
faker (2.10.0) faker (2.10.1)
i18n (>= 1.6, < 1.8) i18n (>= 1.6, < 2)
faraday (1.0.0) faraday (1.0.0)
multipart-post (>= 1.2, < 3) multipart-post (>= 1.2, < 3)
fast_blank (1.0.0) fast_blank (1.0.0)
@ -270,8 +247,6 @@ GEM
fuubar (2.5.0) fuubar (2.5.0)
rspec-core (~> 3.0) rspec-core (~> 3.0)
ruby-progressbar (~> 1.4) ruby-progressbar (~> 1.4)
get_process_mem (0.2.5)
ffi (~> 1.0)
globalid (0.4.2) globalid (0.4.2)
activesupport (>= 4.2.0) activesupport (>= 4.2.0)
goldfinger (2.1.1) goldfinger (2.1.1)
@ -292,8 +267,7 @@ GEM
concurrent-ruby (~> 1.0) concurrent-ruby (~> 1.0)
hashdiff (1.0.0) hashdiff (1.0.0)
hashie (3.6.0) hashie (3.6.0)
heapy (0.1.4) highline (2.0.3)
highline (2.0.1)
hiredis (0.6.3) hiredis (0.6.3)
hkdf (0.3.0) hkdf (0.3.0)
html2text (0.2.1) html2text (0.2.1)
@ -310,12 +284,12 @@ GEM
http-parser (1.2.1) http-parser (1.2.1)
ffi-compiler (>= 1.0, < 2.0) ffi-compiler (>= 1.0, < 2.0)
http_accept_language (2.1.1) http_accept_language (2.1.1)
httplog (1.3.3) httplog (1.4.0)
rack (>= 1.0) rack (>= 1.0)
rainbow (>= 2.0.0) rainbow (>= 2.0.0)
i18n (1.7.0) i18n (1.8.2)
concurrent-ruby (~> 1.0) concurrent-ruby (~> 1.0)
i18n-tasks (0.9.29) i18n-tasks (0.9.30)
activesupport (>= 4.0.2) activesupport (>= 4.0.2)
ast (>= 2.1.0) ast (>= 2.1.0)
erubi erubi
@ -331,7 +305,14 @@ GEM
jaro_winkler (1.5.4) jaro_winkler (1.5.4)
jmespath (1.4.0) jmespath (1.4.0)
json (2.3.0) json (2.3.0)
json-canonicalization (0.1.0) json-canonicalization (0.2.0)
json-ld (3.1.0)
htmlentities (~> 4.3)
json-canonicalization (~> 0.1)
link_header (~> 0.0, >= 0.0.8)
multi_json (~> 1.14)
rack (~> 2.0)
rdf (~> 3.1)
json-ld-preloaded (3.0.6) json-ld-preloaded (3.0.6)
json-ld (~> 3.0) json-ld (~> 3.0)
multi_json (~> 1.12) multi_json (~> 1.12)
@ -386,7 +367,7 @@ GEM
mimemagic (0.3.3) mimemagic (0.3.3)
mini_mime (1.0.2) mini_mime (1.0.2)
mini_portile2 (2.4.0) mini_portile2 (2.4.0)
minitest (5.13.0) minitest (5.14.0)
msgpack (1.3.1) msgpack (1.3.1)
multi_json (1.14.1) multi_json (1.14.1)
multipart-post (2.1.1) multipart-post (2.1.1)
@ -405,7 +386,7 @@ GEM
concurrent-ruby (~> 1.0, >= 1.0.2) concurrent-ruby (~> 1.0, >= 1.0.2)
sidekiq (>= 3.5) sidekiq (>= 3.5)
statsd-ruby (~> 1.4, >= 1.4.0) statsd-ruby (~> 1.4, >= 1.4.0)
oj (3.10.0) oj (3.10.1)
omniauth (1.9.0) omniauth (1.9.0)
hashie (>= 3.4.6, < 3.7.0) hashie (>= 3.4.6, < 3.7.0)
rack (>= 1.6.2, < 3) rack (>= 1.6.2, < 3)
@ -417,7 +398,7 @@ GEM
omniauth (~> 1.3, >= 1.3.2) omniauth (~> 1.3, >= 1.3.2)
ruby-saml (~> 1.7) ruby-saml (~> 1.7)
orm_adapter (0.5.0) orm_adapter (0.5.0)
ox (2.11.0) ox (2.12.1)
paperclip (6.0.0) paperclip (6.0.0)
activemodel (>= 4.2.0) activemodel (>= 4.2.0)
activesupport (>= 4.2.0) activesupport (>= 4.2.0)
@ -428,7 +409,7 @@ GEM
av (~> 0.9.0) av (~> 0.9.0)
paperclip (>= 2.5.2) paperclip (>= 2.5.2)
parallel (1.19.1) parallel (1.19.1)
parallel_tests (2.30.0) parallel_tests (2.30.1)
parallel parallel
parser (2.7.0.2) parser (2.7.0.2)
ast (~> 2.4.0) ast (~> 2.4.0)
@ -436,7 +417,7 @@ GEM
pastel (0.7.3) pastel (0.7.3)
equatable (~> 0.6) equatable (~> 0.6)
tty-color (~> 0.5) tty-color (~> 0.5)
pg (1.2.1) pg (1.2.2)
pghero (2.4.1) pghero (2.4.1)
activerecord (>= 5) activerecord (>= 5)
pkg-config (1.4.0) pkg-config (1.4.0)
@ -508,7 +489,7 @@ GEM
thor (>= 0.19.0, < 2.0) thor (>= 0.19.0, < 2.0)
rainbow (3.0.0) rainbow (3.0.0)
rake (13.0.1) rake (13.0.1)
rdf (3.1.0) rdf (3.1.1)
hamster (~> 3.0) hamster (~> 3.0)
link_header (~> 0.0, >= 0.0.8) link_header (~> 0.0, >= 0.0.8)
rdf-normalize (0.4.0) rdf-normalize (0.4.0)
@ -565,10 +546,10 @@ GEM
rspec-core (~> 3.0, >= 3.0.0) rspec-core (~> 3.0, >= 3.0.0)
sidekiq (>= 2.4.0) sidekiq (>= 2.4.0)
rspec-support (3.9.0) rspec-support (3.9.0)
rubocop (0.78.0) rubocop (0.79.0)
jaro_winkler (~> 1.5.1) jaro_winkler (~> 1.5.1)
parallel (~> 1.10) parallel (~> 1.10)
parser (>= 2.6) parser (>= 2.7.0.1)
rainbow (>= 2.2.2, < 4.0) rainbow (>= 2.2.2, < 4.0)
ruby-progressbar (~> 1.7) ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 1.7) unicode-display_width (>= 1.4.0, < 1.7)
@ -578,7 +559,6 @@ GEM
ruby-progressbar (1.10.1) ruby-progressbar (1.10.1)
ruby-saml (1.9.0) ruby-saml (1.9.0)
nokogiri (>= 1.5.10) nokogiri (>= 1.5.10)
ruby-statistics (2.1.1)
rufus-scheduler (3.5.2) rufus-scheduler (3.5.2)
fugit (~> 1.1, >= 1.1.5) fugit (~> 1.1, >= 1.1.5)
safe_yaml (1.0.5) safe_yaml (1.0.5)
@ -660,11 +640,11 @@ GEM
unf (0.1.4) unf (0.1.4)
unf_ext unf_ext
unf_ext (0.0.7.6) unf_ext (0.0.7.6)
unicode-display_width (1.6.0) unicode-display_width (1.6.1)
uniform_notifier (1.13.0) uniform_notifier (1.13.0)
warden (1.2.8) warden (1.2.8)
rack (>= 2.0.6) rack (>= 2.0.6)
webmock (3.7.6) webmock (3.8.0)
addressable (>= 2.3.6) addressable (>= 2.3.6)
crack (>= 0.3.2) crack (>= 0.3.2)
hashdiff (>= 0.4.0, < 2.0.0) hashdiff (>= 0.4.0, < 2.0.0)
@ -710,7 +690,6 @@ DEPENDENCIES
climate_control (~> 0.2) climate_control (~> 0.2)
concurrent-ruby concurrent-ruby
connection_pool connection_pool
derailed_benchmarks
devise (~> 4.7) devise (~> 4.7)
devise-two-factor (~> 3.1) devise-two-factor (~> 3.1)
devise_pam_authenticatable2 (~> 9.2) devise_pam_authenticatable2 (~> 9.2)
@ -734,11 +713,11 @@ DEPENDENCIES
http (~> 4.3) http (~> 4.3)
http_accept_language (~> 2.1) http_accept_language (~> 2.1)
http_parser.rb (~> 0.6)! http_parser.rb (~> 0.6)!
httplog (~> 1.3) httplog (~> 1.4)
i18n-tasks (~> 0.9) i18n-tasks (~> 0.9)
idn-ruby idn-ruby
iso-639 iso-639
json-ld! json-ld
json-ld-preloaded (~> 3.0) json-ld-preloaded (~> 3.0)
kaminari (~> 1.1) kaminari (~> 1.1)
letter_opener (~> 1.7) letter_opener (~> 1.7)
@ -758,7 +737,7 @@ DEPENDENCIES
omniauth (~> 1.9) omniauth (~> 1.9)
omniauth-cas (~> 1.1) omniauth-cas (~> 1.1)
omniauth-saml (~> 1.10) omniauth-saml (~> 1.10)
ox (~> 2.11) ox (~> 2.12)
paperclip (~> 6.0) paperclip (~> 6.0)
paperclip-av-transcoder (~> 0.6) paperclip-av-transcoder (~> 0.6)
parallel (~> 1.19) parallel (~> 1.19)
@ -788,7 +767,7 @@ DEPENDENCIES
rqrcode (~> 1.1) rqrcode (~> 1.1)
rspec-rails (~> 3.9) rspec-rails (~> 3.9)
rspec-sidekiq (~> 3.0) rspec-sidekiq (~> 3.0)
rubocop (~> 0.78) rubocop (~> 0.79)
rubocop-rails (~> 2.4) rubocop-rails (~> 2.4)
ruby-progressbar (~> 1.10) ruby-progressbar (~> 1.10)
sanitize (~> 5.1) sanitize (~> 5.1)
@ -811,6 +790,6 @@ DEPENDENCIES
tty-prompt (~> 0.20) tty-prompt (~> 0.20)
twitter-text (~> 1.14) twitter-text (~> 1.14)
tzinfo-data (~> 1.2019) tzinfo-data (~> 1.2019)
webmock (~> 3.7) webmock (~> 3.8)
webpacker (~> 4.2) webpacker (~> 4.2)
webpush webpush

View File

@ -109,21 +109,7 @@ module Admin
end end
def filter_params def filter_params
params.permit( params.slice(*AccountFilter::KEYS).permit(*AccountFilter::KEYS)
:local,
:remote,
:by_domain,
:active,
:pending,
:disabled,
:silenced,
:suspended,
:username,
:display_name,
:email,
:ip,
:staff
)
end end
end end
end end

View File

@ -48,7 +48,7 @@ module Admin
end end
def filter_params def filter_params
params.slice(:local, :remote, :by_domain, :shortcode, :page).permit(:local, :remote, :by_domain, :shortcode, :page) params.slice(:page, *CustomEmojiFilter::KEYS).permit(:page, *CustomEmojiFilter::KEYS)
end end
def action_from_button def action_from_button

View File

@ -62,7 +62,7 @@ module Admin
end end
def filter_params def filter_params
params.permit(:limited, :by_domain) params.slice(*InstanceFilter::KEYS).permit(*InstanceFilter::KEYS)
end end
end end
end end

View File

@ -47,7 +47,7 @@ module Admin
end end
def filter_params def filter_params
params.permit(:available, :expired) params.slice(*InviteFilter::KEYS).permit(*InviteFilter::KEYS)
end end
end end
end end

View File

@ -52,12 +52,7 @@ module Admin
end end
def filter_params def filter_params
params.permit( params.slice(*ReportFilter::KEYS).permit(*ReportFilter::KEYS)
:account_id,
:resolved,
:target_account_id,
:by_target_domain
)
end end
def set_report def set_report

View File

@ -73,7 +73,7 @@ module Admin
end end
def filter_params def filter_params
params.slice(:directory, :reviewed, :unreviewed, :pending_review, :page, :popular, :active, :name).permit(:directory, :reviewed, :unreviewed, :pending_review, :page, :popular, :active, :name) params.slice(:page, *TagFilter::KEYS).permit(:page, *TagFilter::KEYS)
end end
def tag_params def tag_params

View File

@ -3,6 +3,8 @@
class Api::OEmbedController < Api::BaseController class Api::OEmbedController < Api::BaseController
respond_to :json respond_to :json
skip_before_action :require_authenticated_user!
def show def show
@status = status_finder.status @status = status_finder.status
render json: @status, serializer: OEmbedSerializer, width: maxwidth_or_default, height: maxheight_or_default render json: @status, serializer: OEmbedSerializer, width: maxwidth_or_default, height: maxheight_or_default

View File

@ -86,7 +86,7 @@ class RelationshipsController < ApplicationController
end end
def current_params def current_params
params.slice(:page, :status, :relationship, :by_domain, :activity, :order).permit(:page, :status, :relationship, :by_domain, :activity, :order) params.slice(:page, *RelationshipFilter::KEYS).permit(:page, *RelationshipFilter::KEYS)
end end
def action_from_button def action_from_button

View File

@ -1,15 +1,15 @@
# frozen_string_literal: true # frozen_string_literal: true
module Admin::FilterHelper module Admin::FilterHelper
ACCOUNT_FILTERS = %i(local remote by_domain active pending silenced suspended username display_name email ip staff).freeze FILTERS = [
REPORT_FILTERS = %i(resolved account_id target_account_id by_target_domain).freeze AccountFilter::KEYS,
INVITE_FILTER = %i(available expired).freeze CustomEmojiFilter::KEYS,
CUSTOM_EMOJI_FILTERS = %i(local remote by_domain shortcode).freeze ReportFilter::KEYS,
TAGS_FILTERS = %i(directory reviewed unreviewed pending_review popular active name).freeze TagFilter::KEYS,
INSTANCES_FILTERS = %i(limited by_domain).freeze InstanceFilter::KEYS,
FOLLOWERS_FILTERS = %i(relationship status by_domain activity order).freeze InviteFilter::KEYS,
RelationshipFilter::KEYS,
FILTERS = ACCOUNT_FILTERS + REPORT_FILTERS + INVITE_FILTER + CUSTOM_EMOJI_FILTERS + TAGS_FILTERS + INSTANCES_FILTERS + FOLLOWERS_FILTERS ].flatten.freeze
def filter_link_to(text, link_to_params, link_class_params = link_to_params) def filter_link_to(text, link_to_params, link_class_params = link_to_params)
new_url = filtered_url_for(link_to_params) new_url = filtered_url_for(link_to_params)

View File

@ -32,6 +32,7 @@ module SettingsHelper
hy: 'Հայերեն', hy: 'Հայերեն',
id: 'Bahasa Indonesia', id: 'Bahasa Indonesia',
io: 'Ido', io: 'Ido',
is: 'Íslenska',
it: 'Italiano', it: 'Italiano',
ja: '日本語', ja: '日本語',
ka: 'ქართული', ka: 'ქართული',

View File

@ -43,6 +43,7 @@ class Item extends React.PureComponent {
onClick: PropTypes.func.isRequired, onClick: PropTypes.func.isRequired,
displayWidth: PropTypes.number, displayWidth: PropTypes.number,
visible: PropTypes.bool.isRequired, visible: PropTypes.bool.isRequired,
autoplay: PropTypes.bool,
}; };
static defaultProps = { static defaultProps = {
@ -68,9 +69,13 @@ class Item extends React.PureComponent {
} }
} }
getAutoPlay() {
return this.props.autoplay || autoPlayGif;
}
hoverToPlay () { hoverToPlay () {
const { attachment } = this.props; const { attachment } = this.props;
return !autoPlayGif && attachment.get('type') === 'gifv'; return !this.getAutoPlay() && attachment.get('type') === 'gifv';
} }
handleClick = (e) => { handleClick = (e) => {
@ -222,7 +227,7 @@ class Item extends React.PureComponent {
</a> </a>
); );
} else if (attachment.get('type') === 'gifv') { } else if (attachment.get('type') === 'gifv') {
const autoPlay = !isIOS() && autoPlayGif; const autoPlay = !isIOS() && this.getAutoPlay();
thumbnail = ( thumbnail = (
<div className={classNames('media-gallery__gifv', { autoplay: autoPlay })}> <div className={classNames('media-gallery__gifv', { autoplay: autoPlay })}>
@ -271,6 +276,7 @@ class MediaGallery extends React.PureComponent {
defaultWidth: PropTypes.number, defaultWidth: PropTypes.number,
cacheWidth: PropTypes.func, cacheWidth: PropTypes.func,
visible: PropTypes.bool, visible: PropTypes.bool,
autoplay: PropTypes.bool,
onToggleVisibility: PropTypes.func, onToggleVisibility: PropTypes.func,
}; };
@ -328,7 +334,7 @@ class MediaGallery extends React.PureComponent {
} }
render () { render () {
const { media, intl, sensitive, letterbox, fullwidth, defaultWidth } = this.props; const { media, intl, sensitive, letterbox, fullwidth, defaultWidth, autoplay } = this.props;
const { visible } = this.state; const { visible } = this.state;
const size = media.take(4).size; const size = media.take(4).size;
const uncached = media.every(attachment => attachment.get('type') === 'unknown'); const uncached = media.every(attachment => attachment.get('type') === 'unknown');
@ -350,9 +356,9 @@ class MediaGallery extends React.PureComponent {
} }
if (this.isStandaloneEligible()) { if (this.isStandaloneEligible()) {
children = <Item standalone onClick={this.handleClick} attachment={media.get(0)} displayWidth={width} visible={visible} />; children = <Item standalone autoplay={autoplay} onClick={this.handleClick} attachment={media.get(0)} displayWidth={width} visible={visible} />;
} else { } else {
children = media.take(4).map((attachment, i) => <Item key={attachment.get('id')} onClick={this.handleClick} attachment={attachment} index={i} size={size} letterbox={letterbox} displayWidth={width} visible={visible || uncached} />); children = media.take(4).map((attachment, i) => <Item key={attachment.get('id')} autoplay={autoplay} onClick={this.handleClick} attachment={attachment} index={i} size={size} letterbox={letterbox} displayWidth={width} visible={visible || uncached} />);
} }
if (uncached) { if (uncached) {

View File

@ -0,0 +1,7 @@
import inherited from 'mastodon/locales/ast.json';
const messages = {
// No translations available.
};
export default Object.assign({}, inherited, messages);

View File

@ -0,0 +1,7 @@
import inherited from 'mastodon/locales/bn.json';
const messages = {
// No translations available.
};
export default Object.assign({}, inherited, messages);

View File

@ -0,0 +1,7 @@
import inherited from 'mastodon/locales/br.json';
const messages = {
// No translations available.
};
export default Object.assign({}, inherited, messages);

View File

@ -0,0 +1,7 @@
import inherited from 'mastodon/locales/co.json';
const messages = {
// No translations available.
};
export default Object.assign({}, inherited, messages);

View File

@ -0,0 +1,7 @@
import inherited from 'mastodon/locales/cs.json';
const messages = {
// No translations available.
};
export default Object.assign({}, inherited, messages);

View File

@ -0,0 +1,7 @@
import inherited from 'mastodon/locales/cy.json';
const messages = {
// No translations available.
};
export default Object.assign({}, inherited, messages);

View File

@ -0,0 +1,7 @@
import inherited from 'mastodon/locales/da.json';
const messages = {
// No translations available.
};
export default Object.assign({}, inherited, messages);

View File

@ -0,0 +1,7 @@
import inherited from 'mastodon/locales/el.json';
const messages = {
// No translations available.
};
export default Object.assign({}, inherited, messages);

View File

@ -0,0 +1,7 @@
import inherited from 'mastodon/locales/es-AR.json';
const messages = {
// No translations available.
};
export default Object.assign({}, inherited, messages);

View File

@ -0,0 +1,7 @@
import inherited from 'mastodon/locales/et.json';
const messages = {
// No translations available.
};
export default Object.assign({}, inherited, messages);

View File

@ -0,0 +1,7 @@
import inherited from 'mastodon/locales/eu.json';
const messages = {
// No translations available.
};
export default Object.assign({}, inherited, messages);

View File

@ -0,0 +1,7 @@
import inherited from 'mastodon/locales/ga.json';
const messages = {
// No translations available.
};
export default Object.assign({}, inherited, messages);

View File

@ -0,0 +1,7 @@
import inherited from 'mastodon/locales/gl.json';
const messages = {
// No translations available.
};
export default Object.assign({}, inherited, messages);

View File

@ -0,0 +1,7 @@
import inherited from 'mastodon/locales/hi.json';
const messages = {
// No translations available.
};
export default Object.assign({}, inherited, messages);

View File

@ -0,0 +1,7 @@
import inherited from 'mastodon/locales/hy.json';
const messages = {
// No translations available.
};
export default Object.assign({}, inherited, messages);

View File

@ -0,0 +1,7 @@
import inherited from 'mastodon/locales/is.json';
const messages = {
// No translations available.
};
export default Object.assign({}, inherited, messages);

View File

@ -0,0 +1,7 @@
import inherited from 'mastodon/locales/ka.json';
const messages = {
// No translations available.
};
export default Object.assign({}, inherited, messages);

View File

@ -0,0 +1,7 @@
import inherited from 'mastodon/locales/kab.json';
const messages = {
// No translations available.
};
export default Object.assign({}, inherited, messages);

View File

@ -0,0 +1,7 @@
import inherited from 'mastodon/locales/kk.json';
const messages = {
// No translations available.
};
export default Object.assign({}, inherited, messages);

View File

@ -0,0 +1,7 @@
import inherited from 'mastodon/locales/kn.json';
const messages = {
// No translations available.
};
export default Object.assign({}, inherited, messages);

View File

@ -0,0 +1,7 @@
import inherited from 'mastodon/locales/lt.json';
const messages = {
// No translations available.
};
export default Object.assign({}, inherited, messages);

View File

@ -0,0 +1,7 @@
import inherited from 'mastodon/locales/lv.json';
const messages = {
// No translations available.
};
export default Object.assign({}, inherited, messages);

View File

@ -0,0 +1,7 @@
import inherited from 'mastodon/locales/mk.json';
const messages = {
// No translations available.
};
export default Object.assign({}, inherited, messages);

View File

@ -0,0 +1,7 @@
import inherited from 'mastodon/locales/ml.json';
const messages = {
// No translations available.
};
export default Object.assign({}, inherited, messages);

View File

@ -0,0 +1,7 @@
import inherited from 'mastodon/locales/mr.json';
const messages = {
// No translations available.
};
export default Object.assign({}, inherited, messages);

View File

@ -0,0 +1,7 @@
import inherited from 'mastodon/locales/ms.json';
const messages = {
// No translations available.
};
export default Object.assign({}, inherited, messages);

View File

@ -0,0 +1,7 @@
import inherited from 'mastodon/locales/nn.json';
const messages = {
// No translations available.
};
export default Object.assign({}, inherited, messages);

View File

@ -0,0 +1,7 @@
import inherited from 'mastodon/locales/ro.json';
const messages = {
// No translations available.
};
export default Object.assign({}, inherited, messages);

View File

@ -0,0 +1,7 @@
import inherited from 'mastodon/locales/sk.json';
const messages = {
// No translations available.
};
export default Object.assign({}, inherited, messages);

View File

@ -0,0 +1,7 @@
import inherited from 'mastodon/locales/sl.json';
const messages = {
// No translations available.
};
export default Object.assign({}, inherited, messages);

View File

@ -0,0 +1,7 @@
import inherited from 'mastodon/locales/sq.json';
const messages = {
// No translations available.
};
export default Object.assign({}, inherited, messages);

View File

@ -0,0 +1,7 @@
import inherited from 'mastodon/locales/sr-Latn.json';
const messages = {
// No translations available.
};
export default Object.assign({}, inherited, messages);

View File

@ -0,0 +1,7 @@
import inherited from 'mastodon/locales/sr.json';
const messages = {
// No translations available.
};
export default Object.assign({}, inherited, messages);

View File

@ -0,0 +1,7 @@
import inherited from 'mastodon/locales/ta.json';
const messages = {
// No translations available.
};
export default Object.assign({}, inherited, messages);

View File

@ -0,0 +1,7 @@
import inherited from 'mastodon/locales/te.json';
const messages = {
// No translations available.
};
export default Object.assign({}, inherited, messages);

View File

@ -0,0 +1,7 @@
import inherited from 'mastodon/locales/ur.json';
const messages = {
// No translations available.
};
export default Object.assign({}, inherited, messages);

View File

@ -0,0 +1,7 @@
import inherited from 'mastodon/locales/vi.json';
const messages = {
// No translations available.
};
export default Object.assign({}, inherited, messages);

View File

@ -97,15 +97,6 @@ function main() {
delegate(document, '.custom-emoji', 'mouseover', getEmojiAnimationHandler('data-original')); delegate(document, '.custom-emoji', 'mouseover', getEmojiAnimationHandler('data-original'));
delegate(document, '.custom-emoji', 'mouseout', getEmojiAnimationHandler('data-static')); delegate(document, '.custom-emoji', 'mouseout', getEmojiAnimationHandler('data-static'));
delegate(document, '.blocks-table button.icon-button', 'click', function(e) {
e.preventDefault();
const classList = this.firstElementChild.classList;
classList.toggle('fa-chevron-down');
classList.toggle('fa-chevron-up');
this.parentElement.parentElement.nextElementSibling.classList.toggle('hidden');
});
}); });
delegate(document, '.sidebar__toggle__icon', 'click', () => { delegate(document, '.sidebar__toggle__icon', 'click', () => {

View File

@ -23,6 +23,7 @@ class Item extends React.PureComponent {
onClick: PropTypes.func.isRequired, onClick: PropTypes.func.isRequired,
displayWidth: PropTypes.number, displayWidth: PropTypes.number,
visible: PropTypes.bool.isRequired, visible: PropTypes.bool.isRequired,
autoplay: PropTypes.bool,
}; };
static defaultProps = { static defaultProps = {
@ -48,9 +49,13 @@ class Item extends React.PureComponent {
} }
} }
getAutoPlay() {
return this.props.autoplay || autoPlayGif;
}
hoverToPlay () { hoverToPlay () {
const { attachment } = this.props; const { attachment } = this.props;
return !autoPlayGif && attachment.get('type') === 'gifv'; return !this.getAutoPlay() && attachment.get('type') === 'gifv';
} }
handleClick = (e) => { handleClick = (e) => {
@ -201,7 +206,7 @@ class Item extends React.PureComponent {
</a> </a>
); );
} else if (attachment.get('type') === 'gifv') { } else if (attachment.get('type') === 'gifv') {
const autoPlay = !isIOS() && autoPlayGif; const autoPlay = !isIOS() && this.getAutoPlay();
thumbnail = ( thumbnail = (
<div className={classNames('media-gallery__gifv', { autoplay: autoPlay })}> <div className={classNames('media-gallery__gifv', { autoplay: autoPlay })}>
@ -248,6 +253,7 @@ class MediaGallery extends React.PureComponent {
defaultWidth: PropTypes.number, defaultWidth: PropTypes.number,
cacheWidth: PropTypes.func, cacheWidth: PropTypes.func,
visible: PropTypes.bool, visible: PropTypes.bool,
autoplay: PropTypes.bool,
onToggleVisibility: PropTypes.func, onToggleVisibility: PropTypes.func,
}; };
@ -297,7 +303,7 @@ class MediaGallery extends React.PureComponent {
} }
render () { render () {
const { media, intl, sensitive, height, defaultWidth, standalone } = this.props; const { media, intl, sensitive, height, defaultWidth, standalone, autoplay } = this.props;
const { visible } = this.state; const { visible } = this.state;
const width = this.state.width || defaultWidth; const width = this.state.width || defaultWidth;
@ -320,9 +326,9 @@ class MediaGallery extends React.PureComponent {
const uncached = media.every(attachment => attachment.get('type') === 'unknown'); const uncached = media.every(attachment => attachment.get('type') === 'unknown');
if (standalone && this.isFullSizeEligible()) { if (standalone && this.isFullSizeEligible()) {
children = <Item standalone onClick={this.handleClick} attachment={media.get(0)} displayWidth={width} visible={visible} />; children = <Item standalone autoplay={autoplay} onClick={this.handleClick} attachment={media.get(0)} displayWidth={width} visible={visible} />;
} else { } else {
children = media.take(4).map((attachment, i) => <Item key={attachment.get('id')} onClick={this.handleClick} attachment={attachment} index={i} size={size} displayWidth={width} visible={visible || uncached} />); children = media.take(4).map((attachment, i) => <Item key={attachment.get('id')} autoplay={autoplay} onClick={this.handleClick} attachment={attachment} index={i} size={size} displayWidth={width} visible={visible || uncached} />);
} }
if (uncached) { if (uncached) {

View File

@ -296,7 +296,7 @@ export default class ScrollableList extends PureComponent {
</div> </div>
</div> </div>
); );
} else if (isLoading || childrenCount > 0 || hasMore || !emptyMessage) { } else if (isLoading || childrenCount > 0 || numPending > 0 || hasMore || !emptyMessage) {
scrollableArea = ( scrollableArea = (
<div className={classNames('scrollable', { fullscreen })} ref={this.setRef} onMouseMove={this.handleMouseMove}> <div className={classNames('scrollable', { fullscreen })} ref={this.setRef} onMouseMove={this.handleMouseMove}>
<div role='feed' className='item-list'> <div role='feed' className='item-list'>

View File

@ -101,15 +101,6 @@ function main() {
delegate(document, '.custom-emoji', 'mouseover', getEmojiAnimationHandler('data-original')); delegate(document, '.custom-emoji', 'mouseover', getEmojiAnimationHandler('data-original'));
delegate(document, '.custom-emoji', 'mouseout', getEmojiAnimationHandler('data-static')); delegate(document, '.custom-emoji', 'mouseout', getEmojiAnimationHandler('data-static'));
delegate(document, '.blocks-table button.icon-button', 'click', function(e) {
e.preventDefault();
const classList = this.firstElementChild.classList;
classList.toggle('fa-chevron-down');
classList.toggle('fa-chevron-up');
this.parentElement.parentElement.nextElementSibling.classList.toggle('hidden');
});
}); });
delegate(document, '.sidebar__toggle__icon', 'click', () => { delegate(document, '.sidebar__toggle__icon', 'click', () => {

View File

@ -143,7 +143,7 @@ class SpamCheck
end end
def trusted? def trusted?
@account.trust_level > Account::TRUST_LEVELS[:untrusted] @account.trust_level > Account::TRUST_LEVELS[:untrusted] || (@account.local? && @account.user_staff?)
end end
def no_unsolicited_mentions? def no_unsolicited_mentions?

View File

@ -1,6 +1,21 @@
# frozen_string_literal: true # frozen_string_literal: true
class AccountFilter class AccountFilter
KEYS = %i(
local
remote
by_domain
active
pending
silenced
suspended
username
display_name
email
ip
staff
).freeze
attr_reader :params attr_reader :params
def initialize(params) def initialize(params)
@ -50,7 +65,7 @@ class AccountFilter
when 'email' when 'email'
accounts_with_users.merge User.matches_email(value) accounts_with_users.merge User.matches_email(value)
when 'ip' when 'ip'
valid_ip?(value) ? accounts_with_users.where('users.current_sign_in_ip <<= ?', value) : Account.none valid_ip?(value) ? accounts_with_users.merge(User.matches_ip(value)) : Account.none
when 'staff' when 'staff'
accounts_with_users.merge User.staff accounts_with_users.merge User.staff
else else

View File

@ -1,6 +1,13 @@
# frozen_string_literal: true # frozen_string_literal: true
class CustomEmojiFilter class CustomEmojiFilter
KEYS = %i(
local
remote
by_domain
shortcode
).freeze
attr_reader :params attr_reader :params
def initialize(params) def initialize(params)

View File

@ -1,6 +1,11 @@
# frozen_string_literal: true # frozen_string_literal: true
class InstanceFilter class InstanceFilter
KEYS = %i(
limited
by_domain
).freeze
attr_reader :params attr_reader :params
def initialize(params) def initialize(params)

View File

@ -1,6 +1,11 @@
# frozen_string_literal: true # frozen_string_literal: true
class InviteFilter class InviteFilter
KEYS = %i(
available
expired
).freeze
attr_reader :params attr_reader :params
def initialize(params) def initialize(params)

View File

@ -0,0 +1,11 @@
# frozen_string_literal: true
class RelationshipFilter
KEYS = %i(
relationship
status
by_domain
activity
order
).freeze
end

View File

@ -1,6 +1,13 @@
# frozen_string_literal: true # frozen_string_literal: true
class ReportFilter class ReportFilter
KEYS = %i(
resolved
account_id
target_account_id
by_target_domain
).freeze
attr_reader :params attr_reader :params
def initialize(params) def initialize(params)

View File

@ -1,6 +1,16 @@
# frozen_string_literal: true # frozen_string_literal: true
class TagFilter class TagFilter
KEYS = %i(
directory
reviewed
unreviewed
pending_review
popular
active
name
).freeze
attr_reader :params attr_reader :params
def initialize(params) def initialize(params)

View File

@ -93,6 +93,7 @@ class User < ApplicationRecord
scope :inactive, -> { where(arel_table[:current_sign_in_at].lt(ACTIVE_DURATION.ago)) } scope :inactive, -> { where(arel_table[:current_sign_in_at].lt(ACTIVE_DURATION.ago)) }
scope :active, -> { confirmed.where(arel_table[:current_sign_in_at].gteq(ACTIVE_DURATION.ago)).joins(:account).where(accounts: { suspended_at: nil }) } scope :active, -> { confirmed.where(arel_table[:current_sign_in_at].gteq(ACTIVE_DURATION.ago)).joins(:account).where(accounts: { suspended_at: nil }) }
scope :matches_email, ->(value) { where(arel_table[:email].matches("#{value}%")) } scope :matches_email, ->(value) { where(arel_table[:email].matches("#{value}%")) }
scope :matches_ip, ->(value) { left_joins(:session_activations).where('users.current_sign_in_ip <<= ?', value).or(left_joins(:session_activations).where('users.last_sign_in_ip <<= ?', value)).or(left_joins(:session_activations).where('session_activations.ip <<= ?', value)) }
scope :emailable, -> { confirmed.enabled.joins(:account).merge(Account.searchable) } scope :emailable, -> { confirmed.enabled.joins(:account).merge(Account.searchable) }
before_validation :sanitize_languages before_validation :sanitize_languages
@ -290,6 +291,21 @@ class User < ApplicationRecord
setting_display_media == 'hide_all' setting_display_media == 'hide_all'
end end
def recent_ips
@recent_ips ||= begin
arr = []
session_activations.each do |session_activation|
arr << [session_activation.updated_at, session_activation.ip]
end
arr << [current_sign_in_at, current_sign_in_ip] if current_sign_in_ip.present?
arr << [last_sign_in_at, last_sign_in_ip] if last_sign_in_ip.present?
arr.sort_by(&:first).uniq(&:last).reverse!
end
end
protected protected
def send_devise_notification(notification, *args) def send_devise_notification(notification, *args)

View File

@ -22,7 +22,7 @@
= form_tag admin_accounts_url, method: 'GET', class: 'simple_form' do = form_tag admin_accounts_url, method: 'GET', class: 'simple_form' do
.fields-group .fields-group
- Admin::FilterHelper::ACCOUNT_FILTERS.each do |key| - AccountFilter::KEYS.each do |key|
- if params[key].present? - if params[key].present?
= hidden_field_tag key, params[key] = hidden_field_tag key, params[key]

View File

@ -139,12 +139,12 @@
%time.formatted{ datetime: @account.created_at.iso8601, title: l(@account.created_at) }= l @account.created_at %time.formatted{ datetime: @account.created_at.iso8601, title: l(@account.created_at) }= l @account.created_at
%td %td
%tr - @account.user.recent_ips.each_with_index do |(_, ip), i|
%th= t('admin.accounts.most_recent_ip') %tr
%td= @account.user_current_sign_in_ip - if i.zero?
%td %th{ rowspan: @account.user.recent_ips.size }= t('admin.accounts.most_recent_ip')
- if @account.user_current_sign_in_ip %td= ip
= table_link_to 'search', t('admin.accounts.search_same_ip'), admin_accounts_path(ip: @account.user_current_sign_in_ip) %td= table_link_to 'search', t('admin.accounts.search_same_ip'), admin_accounts_path(ip: ip)
%tr %tr
%th= t('admin.accounts.most_recent_activity') %th= t('admin.accounts.most_recent_activity')

View File

@ -22,7 +22,7 @@
= form_tag admin_custom_emojis_url, method: 'GET', class: 'simple_form' do = form_tag admin_custom_emojis_url, method: 'GET', class: 'simple_form' do
.fields-group .fields-group
- Admin::FilterHelper::CUSTOM_EMOJI_FILTERS.each do |key| - CustomEmojiFilter::KEYS.each do |key|
= hidden_field_tag key, params[key] if params[key].present? = hidden_field_tag key, params[key] if params[key].present?
- %i(shortcode by_domain).each do |key| - %i(shortcode by_domain).each do |key|
@ -36,7 +36,7 @@
= form_for(@form, url: batch_admin_custom_emojis_path) do |f| = form_for(@form, url: batch_admin_custom_emojis_path) do |f|
= hidden_field_tag :page, params[:page] || 1 = hidden_field_tag :page, params[:page] || 1
- Admin::FilterHelper::CUSTOM_EMOJI_FILTERS.each do |key| - CustomEmojiFilter::KEYS.each do |key|
= hidden_field_tag key, params[key] if params[key].present? = hidden_field_tag key, params[key] if params[key].present?
.batch-table .batch-table

View File

@ -4,7 +4,7 @@
- content_for :heading_actions do - content_for :heading_actions do
= link_to t('admin.email_domain_blocks.add_new'), new_admin_email_domain_block_path, class: 'button' = link_to t('admin.email_domain_blocks.add_new'), new_admin_email_domain_block_path, class: 'button'
- if @email_domain_blocks.count == 0 - if @email_domain_blocks.empty?
%div.muted-hint.center-text=t 'admin.email_domain_blocks.empty' %div.muted-hint.center-text=t 'admin.email_domain_blocks.empty'
- else - else
.table-wrapper .table-wrapper

View File

@ -19,9 +19,8 @@
- unless whitelist_mode? - unless whitelist_mode?
= form_tag admin_instances_url, method: 'GET', class: 'simple_form' do = form_tag admin_instances_url, method: 'GET', class: 'simple_form' do
.fields-group .fields-group
- Admin::FilterHelper::INSTANCES_FILTERS.each do |key| - InstanceFilter::KEYS.each do |key|
- if params[key].present? = hidden_field_tag key, params[key] if params[key].present?
= hidden_field_tag key, params[key]
- %i(by_domain).each do |key| - %i(by_domain).each do |key|
.input.string.optional .input.string.optional

View File

@ -14,9 +14,12 @@
- unless status.proper.media_attachments.empty? - unless status.proper.media_attachments.empty?
- if status.proper.media_attachments.first.video? - if status.proper.media_attachments.first.video?
- video = status.proper.media_attachments.first - video = status.proper.media_attachments.first
= react_component :video, src: video.file.url(:original), preview: video.file.url(:small), sensitive: !current_account&.user&.show_all_media? && status.proper.sensitive? || current_account&.user&.hide_all_media?, width: 610, height: 343, inline: true, alt: video.description = react_component :video, src: video.file.url(:original), preview: video.file.url(:small), blurhash: video.blurhash, sensitive: status.proper.sensitive?, visible: false, width: 610, height: 343, inline: true, alt: video.description
- elsif status.proper.media_attachments.first.audio?
- audio = status.proper.media_attachments.first
= react_component :audio, src: audio.file.url(:original), height: 110, alt: audio.description, duration: audio.file.meta.dig(:original, :duration)
- else - else
= react_component :media_gallery, height: 343, sensitive: !current_account&.user&.show_all_media? && status.proper.sensitive? || current_account&.user&.hide_all_media?, 'autoPlayGif': current_account&.user&.setting_auto_play_gif, media: status.proper.media_attachments.map { |a| ActiveModelSerializers::SerializableResource.new(a, serializer: REST::MediaAttachmentSerializer).as_json } = react_component :media_gallery, height: 343, sensitive: status.proper.sensitive?, visible: false, media: status.proper.media_attachments.map { |a| ActiveModelSerializers::SerializableResource.new(a, serializer: REST::MediaAttachmentSerializer).as_json }
.detailed-status__meta .detailed-status__meta
= link_to ActivityPub::TagManager.instance.url_for(status), class: 'detailed-status__datetime', target: stream_link_target, rel: 'noopener noreferrer' do = link_to ActivityPub::TagManager.instance.url_for(status), class: 'detailed-status__datetime', target: stream_link_target, rel: 'noopener noreferrer' do

View File

@ -10,9 +10,8 @@
= form_tag admin_reports_url, method: 'GET', class: 'simple_form' do = form_tag admin_reports_url, method: 'GET', class: 'simple_form' do
.fields-group .fields-group
- Admin::FilterHelper::REPORT_FILTERS.each do |key| - ReportFilter::KEYS.each do |key|
- if params[key].present? = hidden_field_tag key, params[key] if params[key].present?
= hidden_field_tag key, params[key]
- %i(by_target_domain).each do |key| - %i(by_target_domain).each do |key|
.input.string.optional .input.string.optional

View File

@ -25,7 +25,7 @@
= form_tag admin_tags_url, method: 'GET', class: 'simple_form' do = form_tag admin_tags_url, method: 'GET', class: 'simple_form' do
.fields-group .fields-group
- Admin::FilterHelper::TAGS_FILTERS.each do |key| - TagFilter::KEYS.each do |key|
= hidden_field_tag key, params[key] if params[key].present? = hidden_field_tag key, params[key] if params[key].present?
- %i(name).each do |key| - %i(name).each do |key|
@ -40,9 +40,8 @@
= form_for(@form, url: batch_admin_tags_path) do |f| = form_for(@form, url: batch_admin_tags_path) do |f|
= hidden_field_tag :page, params[:page] || 1 = hidden_field_tag :page, params[:page] || 1
= hidden_field_tag :name, params[:name] if params[:name].present?
- Admin::FilterHelper::TAGS_FILTERS.each do |key| - TagFilter::KEYS.each do |key|
= hidden_field_tag key, params[key] if params[key].present? = hidden_field_tag key, params[key] if params[key].present?
.batch-table.optional .batch-table.optional

View File

@ -4,7 +4,7 @@
- content_for :heading_actions do - content_for :heading_actions do
= link_to t('filters.new.title'), new_filter_path, class: 'button' = link_to t('filters.new.title'), new_filter_path, class: 'button'
- if @filters.count == 0 - if @filters.empty?
%div.muted-hint.center-text= t 'filters.index.empty' %div.muted-hint.center-text= t 'filters.index.empty'
- else - else
.table-wrapper .table-wrapper

View File

@ -1,3 +1,6 @@
- content_for :header_tags do
= render_initial_state
- content_for :content do - content_for :content do
.admin-wrapper .admin-wrapper
.sidebar-wrapper .sidebar-wrapper

View File

@ -10,6 +10,7 @@
- if storage_host? - if storage_host?
%link{ rel: 'dns-prefetch', href: storage_host }/ %link{ rel: 'dns-prefetch', href: storage_host }/
= render_initial_state
= javascript_pack_tag "locales", integrity: true, crossorigin: 'anonymous' = javascript_pack_tag "locales", integrity: true, crossorigin: 'anonymous'
- if @theme - if @theme
- if @theme[:supported_locales].include? I18n.locale.to_s - if @theme[:supported_locales].include? I18n.locale.to_s
@ -21,3 +22,6 @@
%body.embed %body.embed
= yield = yield
%div{ style: 'display: none'}
= render file: Rails.root.join('app', 'javascript', 'images', 'logo_transparent.svg')

View File

@ -30,10 +30,9 @@
= form_for(@form, url: relationships_path, method: :patch) do |f| = form_for(@form, url: relationships_path, method: :patch) do |f|
= hidden_field_tag :page, params[:page] || 1 = hidden_field_tag :page, params[:page] || 1
= hidden_field_tag :relationship, params[:relationship]
= hidden_field_tag :status, params[:status] - RelationshipFilter::KEYS.each do |key|
= hidden_field_tag :activity, params[:activity] = hidden_field_tag key, params[key] if params[key].present?
= hidden_field_tag :order, params[:order]
.batch-table .batch-table
.batch-table__toolbar .batch-table__toolbar

View File

@ -4,7 +4,7 @@
- content_for :heading_actions do - content_for :heading_actions do
= link_to t('doorkeeper.applications.index.new'), new_settings_application_path, class: 'button' = link_to t('doorkeeper.applications.index.new'), new_settings_application_path, class: 'button'
- if @applications.count == 0 - if @applications.empty?
%div.muted-hint.center-text=t 'doorkeeper.applications.index.empty' %div.muted-hint.center-text=t 'doorkeeper.applications.index.empty'
- else - else
.table-wrapper .table-wrapper

View File

@ -29,14 +29,14 @@
- if !status.media_attachments.empty? - if !status.media_attachments.empty?
- if status.media_attachments.first.video? - if status.media_attachments.first.video?
- video = status.media_attachments.first - video = status.media_attachments.first
= react_component :video, src: video.file.url(:original), preview: video.file.url(:small), blurhash: video.blurhash, sensitive: !current_account&.user&.show_all_media? && status.sensitive? || current_account&.user&.hide_all_media?, width: 670, height: 380, detailed: true, inline: true, alt: video.description do = react_component :video, src: video.file.url(:original), preview: video.file.url(:small), blurhash: video.blurhash, sensitive: status.sensitive?, width: 670, height: 380, detailed: true, inline: true, alt: video.description do
= render partial: 'statuses/attachment_list', locals: { attachments: status.media_attachments } = render partial: 'statuses/attachment_list', locals: { attachments: status.media_attachments }
- elsif status.media_attachments.first.audio? - elsif status.media_attachments.first.audio?
- audio = status.media_attachments.first - audio = status.media_attachments.first
= react_component :audio, src: audio.file.url(:original), height: 130, alt: audio.description, preload: true, duration: audio.file.meta.dig(:original, :duration) do = react_component :audio, src: audio.file.url(:original), height: 130, alt: audio.description, preload: true, duration: audio.file.meta.dig(:original, :duration) do
= render partial: 'statuses/attachment_list', locals: { attachments: status.media_attachments } = render partial: 'statuses/attachment_list', locals: { attachments: status.media_attachments }
- else - else
= react_component :media_gallery, height: 380, sensitive: !current_account&.user&.show_all_media? && status.sensitive? || current_account&.user&.hide_all_media?, standalone: true, 'autoPlayGif': current_account&.user&.setting_auto_play_gif || autoplay, 'reduceMotion': current_account&.user&.setting_reduce_motion, media: status.media_attachments.map { |a| ActiveModelSerializers::SerializableResource.new(a, serializer: REST::MediaAttachmentSerializer).as_json } do = react_component :media_gallery, height: 380, sensitive: status.sensitive?, standalone: true, autoplay: autoplay, media: status.media_attachments.map { |a| ActiveModelSerializers::SerializableResource.new(a, serializer: REST::MediaAttachmentSerializer).as_json } do
= render partial: 'statuses/attachment_list', locals: { attachments: status.media_attachments } = render partial: 'statuses/attachment_list', locals: { attachments: status.media_attachments }
- elsif status.preview_card - elsif status.preview_card
= react_component :card, 'maxDescription': 160, card: ActiveModelSerializers::SerializableResource.new(status.preview_card, serializer: REST::PreviewCardSerializer).as_json = react_component :card, 'maxDescription': 160, card: ActiveModelSerializers::SerializableResource.new(status.preview_card, serializer: REST::PreviewCardSerializer).as_json

View File

@ -33,14 +33,14 @@
- if !status.media_attachments.empty? - if !status.media_attachments.empty?
- if status.media_attachments.first.video? - if status.media_attachments.first.video?
- video = status.media_attachments.first - video = status.media_attachments.first
= react_component :video, src: video.file.url(:original), preview: video.file.url(:small), blurhash: video.blurhash, sensitive: !current_account&.user&.show_all_media? && status.sensitive? || current_account&.user&.hide_all_media?, width: 610, height: 343, inline: true, alt: video.description do = react_component :video, src: video.file.url(:original), preview: video.file.url(:small), blurhash: video.blurhash, sensitive: status.sensitive?, width: 610, height: 343, inline: true, alt: video.description do
= render partial: 'statuses/attachment_list', locals: { attachments: status.media_attachments } = render partial: 'statuses/attachment_list', locals: { attachments: status.media_attachments }
- elsif status.media_attachments.first.audio? - elsif status.media_attachments.first.audio?
- audio = status.media_attachments.first - audio = status.media_attachments.first
= react_component :audio, src: audio.file.url(:original), height: 110, alt: audio.description, duration: audio.file.meta.dig(:original, :duration) do = react_component :audio, src: audio.file.url(:original), height: 110, alt: audio.description, duration: audio.file.meta.dig(:original, :duration) do
= render partial: 'statuses/attachment_list', locals: { attachments: status.media_attachments } = render partial: 'statuses/attachment_list', locals: { attachments: status.media_attachments }
- else - else
= react_component :media_gallery, height: 343, sensitive: !current_account&.user&.show_all_media? && status.sensitive? || current_account&.user&.hide_all_media?, 'autoPlayGif': current_account&.user&.setting_auto_play_gif || autoplay, media: status.media_attachments.map { |a| ActiveModelSerializers::SerializableResource.new(a, serializer: REST::MediaAttachmentSerializer).as_json } do = react_component :media_gallery, height: 343, sensitive: status.sensitive?, autoplay: autoplay, media: status.media_attachments.map { |a| ActiveModelSerializers::SerializableResource.new(a, serializer: REST::MediaAttachmentSerializer).as_json } do
= render partial: 'statuses/attachment_list', locals: { attachments: status.media_attachments } = render partial: 'statuses/attachment_list', locals: { attachments: status.media_attachments }
- elsif status.preview_card - elsif status.preview_card
= react_component :card, 'maxDescription': 160, card: ActiveModelSerializers::SerializableResource.new(status.preview_card, serializer: REST::PreviewCardSerializer).as_json = react_component :card, 'maxDescription': 160, card: ActiveModelSerializers::SerializableResource.new(status.preview_card, serializer: REST::PreviewCardSerializer).as_json

View File

@ -70,6 +70,7 @@ module Mastodon
:hy, :hy,
:id, :id,
:io, :io,
:is,
:it, :it,
:ja, :ja,
:ka, :ka,

View File

@ -38,6 +38,7 @@ en:
application: Application application: Application
callback_url: Callback URL callback_url: Callback URL
delete: Delete delete: Delete
empty: You have no applications.
name: Name name: Name
new: New application new: New application
scopes: Scopes scopes: Scopes

View File

@ -163,14 +163,14 @@ en:
text: Why do you want to join? text: Why do you want to join?
notification_emails: notification_emails:
digest: Send digest e-mails digest: Send digest e-mails
favourite: Send e-mail when someone favourites your status favourite: Someone favourited your status
follow: Send e-mail when someone follows you follow: Someone followed you
follow_request: Send e-mail when someone requests to follow you follow_request: Someone requested to follow you
mention: Send e-mail when someone mentions you mention: Someone mentioned you
pending_account: Send e-mail when a new account needs review pending_account: New account needs review
reblog: Send e-mail when someone boosts your status reblog: Someone boosted your status
report: Send e-mail when a new report is submitted report: New report is submitted
trending_tag: Send e-mail when an unreviewed hashtag is trending trending_tag: An unreviewed hashtag is trending
tag: tag:
listable: Allow this hashtag to appear in searches and on the profile directory listable: Allow this hashtag to appear in searches and on the profile directory
name: Hashtag name: Hashtag

View File

@ -233,7 +233,7 @@ Rails.application.routes.draw do
end end
end end
resource :role do resource :role, only: [] do
member do member do
post :promote post :promote
post :demote post :demote

View File

@ -60,21 +60,21 @@
}, },
"private": true, "private": true,
"dependencies": { "dependencies": {
"@babel/core": "^7.7.7", "@babel/core": "^7.8.3",
"@babel/plugin-proposal-class-properties": "^7.7.4", "@babel/plugin-proposal-class-properties": "^7.8.3",
"@babel/plugin-proposal-decorators": "^7.7.4", "@babel/plugin-proposal-decorators": "^7.8.3",
"@babel/plugin-transform-react-inline-elements": "^7.7.4", "@babel/plugin-transform-react-inline-elements": "^7.8.0",
"@babel/plugin-transform-runtime": "^7.7.6", "@babel/plugin-transform-runtime": "^7.7.6",
"@babel/preset-env": "^7.7.7", "@babel/preset-env": "^7.8.3",
"@babel/preset-react": "^7.7.4", "@babel/preset-react": "^7.8.3",
"@babel/runtime": "^7.7.7", "@babel/runtime": "^7.8.3",
"@gamestdio/websocket": "^0.3.2", "@gamestdio/websocket": "^0.3.2",
"@clusterws/cws": "^0.17.3", "@clusterws/cws": "^0.17.3",
"array-includes": "^3.1.1", "array-includes": "^3.1.1",
"atrament": "^0.2.3", "atrament": "^0.2.3",
"arrow-key-navigation": "^1.1.0", "arrow-key-navigation": "^1.1.0",
"autoprefixer": "^9.7.3", "autoprefixer": "^9.7.4",
"axios": "^0.19.0", "axios": "^0.19.1",
"babel-loader": "^8.0.6", "babel-loader": "^8.0.6",
"babel-plugin-lodash": "^3.3.4", "babel-plugin-lodash": "^3.3.4",
"babel-plugin-preval": "^4.0.0", "babel-plugin-preval": "^4.0.0",
@ -83,10 +83,10 @@
"babel-runtime": "^6.26.0", "babel-runtime": "^6.26.0",
"blurhash": "^1.1.3", "blurhash": "^1.1.3",
"classnames": "^2.2.5", "classnames": "^2.2.5",
"compression-webpack-plugin": "^3.0.1", "compression-webpack-plugin": "^3.1.0",
"copy-webpack-plugin": "^5.1.1", "copy-webpack-plugin": "^5.1.1",
"cross-env": "^6.0.3", "cross-env": "^6.0.3",
"css-loader": "^3.4.1", "css-loader": "^3.4.2",
"cssnano": "^4.1.10", "cssnano": "^4.1.10",
"detect-passive-events": "^1.0.2", "detect-passive-events": "^1.0.2",
"dotenv": "^8.2.0", "dotenv": "^8.2.0",
@ -142,7 +142,7 @@
"react-router-scroll-4": "^1.0.0-beta.1", "react-router-scroll-4": "^1.0.0-beta.1",
"react-select": "^3.0.8", "react-select": "^3.0.8",
"react-sparklines": "^1.7.0", "react-sparklines": "^1.7.0",
"react-swipeable-views": "^0.13.3", "react-swipeable-views": "^0.13.4",
"react-textarea-autosize": "^7.1.2", "react-textarea-autosize": "^7.1.2",
"react-toggle": "^4.1.1", "react-toggle": "^4.1.1",
"redis": "^2.7.1", "redis": "^2.7.1",
@ -154,15 +154,15 @@
"reselect": "^4.0.0", "reselect": "^4.0.0",
"rimraf": "^3.0.0", "rimraf": "^3.0.0",
"sass": "^1.24.2", "sass": "^1.24.2",
"sass-loader": "^8.0.0", "sass-loader": "^8.0.2",
"stringz": "^2.0.0", "stringz": "^2.0.0",
"substring-trie": "^1.0.2", "substring-trie": "^1.0.2",
"terser-webpack-plugin": "^2.3.1", "terser-webpack-plugin": "^2.3.2",
"tesseract.js": "^2.0.0-alpha.16", "tesseract.js": "^2.0.0-alpha.16",
"throng": "^4.0.0", "throng": "^4.0.0",
"tiny-queue": "^0.2.1", "tiny-queue": "^0.2.1",
"uuid": "^3.3.3", "uuid": "^3.3.3",
"wavesurfer.js": "^3.3.0", "wavesurfer.js": "^3.3.1",
"webpack": "^4.41.5", "webpack": "^4.41.5",
"webpack-assets-manifest": "^3.1.1", "webpack-assets-manifest": "^3.1.1",
"webpack-bundle-analyzer": "^3.6.0", "webpack-bundle-analyzer": "^3.6.0",
@ -176,7 +176,7 @@
"enzyme": "^3.11.0", "enzyme": "^3.11.0",
"enzyme-adapter-react-16": "^1.15.2", "enzyme-adapter-react-16": "^1.15.2",
"eslint": "^6.8.0", "eslint": "^6.8.0",
"eslint-plugin-import": "~2.19.1", "eslint-plugin-import": "~2.20.0",
"eslint-plugin-jsx-a11y": "~6.2.3", "eslint-plugin-jsx-a11y": "~6.2.3",
"eslint-plugin-promise": "~4.2.1", "eslint-plugin-promise": "~4.2.1",
"eslint-plugin-react": "~7.17.0", "eslint-plugin-react": "~7.17.0",

1368
yarn.lock

File diff suppressed because it is too large Load Diff