From 62cd0974142c4b1162205859c3bef7dfd3aa7710 Mon Sep 17 00:00:00 2001 From: Marcin Mikołajczak Date: Sun, 19 Aug 2018 17:05:36 +0200 Subject: i18n: Update Polish translation (#8290) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marcin Mikołajczak --- config/locales/pl.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'config') diff --git a/config/locales/pl.yml b/config/locales/pl.yml index 09e9e87f7..168975363 100644 --- a/config/locales/pl.yml +++ b/config/locales/pl.yml @@ -6,6 +6,7 @@ pl: about_this: O tej instancji administered_by: 'Administrowana przez:' api: API + apps: Aplikacje closed_registrations: Rejestracja na tej instancji jest obecnie zamknięta. Możesz jednak zarejestrować się na innej instancji, uzyskując dostęp do tej samej sieci. contact: Kontakt contact_missing: Nie ustawiono @@ -281,6 +282,7 @@ pl: search: Szukaj title: Znane instancje invites: + deactivate_all: Unieważnij wszystkie filter: all: Wszystkie available: Dostępne @@ -662,11 +664,14 @@ pl: publishing: Publikowanie web: Sieć remote_follow: - acct: Podaj swój adres (nazwa@domena), z którego chcesz śledzić + acct: Podaj swój adres (nazwa@domena), z którego chcesz wykonać działanie missing_resource: Nie udało się znaleźć adresu przekierowania z Twojej domeny no_account_html: Nie masz konta? Możesz zarejestrować się tutaj proceed: Śledź prompt: 'Zamierzasz śledzić:' + remote_interaction: + proceed: Przejdź do interakcji + prompt: 'Chcesz dokonać interakcji z tym wpisem:' remote_unfollow: error: Błąd title: Tytuł @@ -754,6 +759,7 @@ pl: private: Nie możesz przypiąć niepublicznego wpisu reblog: Nie możesz przypiąć podbicia wpisu show_more: Pokaż więcej + sign_in_to_participate: Zaloguj się, aby udzielić się w tej konwersacji title: '%{name}: "%{quote}"' visibilities: private: Tylko dla śledzących -- cgit From 1d1e0171ec52806ff42e2cafa67b1c68afe1f7bb Mon Sep 17 00:00:00 2001 From: Oskari Noppa Date: Sun, 19 Aug 2018 20:16:40 +0300 Subject: Fix a variable for a Finnish translation (#8299) --- config/locales/fi.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'config') diff --git a/config/locales/fi.yml b/config/locales/fi.yml index 7fa2bc8de..96339e35e 100644 --- a/config/locales/fi.yml +++ b/config/locales/fi.yml @@ -725,7 +725,7 @@ fi: tip_local_timeline: Paikallinen aikajana näyttää instanssin %{instance} käyttäjien julkaisut. He ovat naapureitasi! tip_mobile_webapp: Jos voit lisätä Mastodonin mobiiliselaimen kautta aloitusnäytöllesi, voit vastaanottaa push-ilmoituksia. Toiminta vastaa monin tavoin tavanomaista sovellusta! tips: Vinkkejä - title: Tervetuloa mukaan, %name}! + title: Tervetuloa mukaan, %{name}! users: invalid_email: Virheellinen sähköpostiosoite invalid_otp_token: Virheellinen kaksivaiheisen todentamisen koodi -- cgit From b34d6238cbd2be08e5df90b1dd99f266948fab8b Mon Sep 17 00:00:00 2001 From: ThibG Date: Mon, 20 Aug 2018 18:46:04 +0200 Subject: Add API endpoint to list featured accounts (fixes #8315) (#8317) --- app/controllers/api/v1/endorsements_controller.rb | 72 +++++++++++++++++++++++ app/models/account_pin.rb | 1 + config/routes.rb | 15 ++--- 3 files changed, 81 insertions(+), 7 deletions(-) create mode 100644 app/controllers/api/v1/endorsements_controller.rb (limited to 'config') diff --git a/app/controllers/api/v1/endorsements_controller.rb b/app/controllers/api/v1/endorsements_controller.rb new file mode 100644 index 000000000..0f04b488f --- /dev/null +++ b/app/controllers/api/v1/endorsements_controller.rb @@ -0,0 +1,72 @@ +# frozen_string_literal: true + +class Api::V1::EndorsementsController < Api::BaseController + before_action -> { doorkeeper_authorize! :read, :'read:accounts' } + before_action :require_user! + after_action :insert_pagination_headers + + respond_to :json + + def index + @accounts = load_accounts + render json: @accounts, each_serializer: REST::AccountSerializer + end + + private + + def load_accounts + if unlimited? + endorsed_accounts.all + else + endorsed_accounts.paginate_by_max_id( + limit_param(DEFAULT_ACCOUNTS_LIMIT), + params[:max_id], + params[:since_id] + ) + end + end + + def endorsed_accounts + current_account.endorsed_accounts + end + + def insert_pagination_headers + set_pagination_headers(next_path, prev_path) + end + + def next_path + return if unlimited? + + if records_continue? + api_v1_endorsements_url pagination_params(max_id: pagination_max_id) + end + end + + def prev_path + return if unlimited? + + unless @accounts.empty? + api_v1_endorsements_url pagination_params(since_id: pagination_since_id) + end + end + + def pagination_max_id + @accounts.last.id + end + + def pagination_since_id + @accounts.first.id + end + + def records_continue? + @accounts.size == limit_param(DEFAULT_ACCOUNTS_LIMIT) + end + + def pagination_params(core_params) + params.slice(:limit).permit(:limit).merge(core_params) + end + + def unlimited? + params[:limit] == '0' + end +end diff --git a/app/models/account_pin.rb b/app/models/account_pin.rb index 9a21c3405..b51d3d4cd 100644 --- a/app/models/account_pin.rb +++ b/app/models/account_pin.rb @@ -11,6 +11,7 @@ # class AccountPin < ApplicationRecord + include Paginable include RelationshipCacheable belongs_to :account diff --git a/config/routes.rb b/config/routes.rb index a8716aae5..da7cb8061 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -261,13 +261,14 @@ Rails.application.routes.draw do get '/search', to: 'search#index', as: :search - resources :follows, only: [:create] - resources :media, only: [:create, :update] - resources :blocks, only: [:index] - resources :mutes, only: [:index] - resources :favourites, only: [:index] - resources :reports, only: [:index, :create] - resources :filters, only: [:index, :create, :show, :update, :destroy] + resources :follows, only: [:create] + resources :media, only: [:create, :update] + resources :blocks, only: [:index] + resources :mutes, only: [:index] + resources :favourites, only: [:index] + resources :reports, only: [:index, :create] + resources :filters, only: [:index, :create, :show, :update, :destroy] + resources :endorsements, only: [:index] namespace :apps do get :verify_credentials, to: 'credentials#show' -- cgit From f06fa099625e928e5858ea81a20be1eddf6c6fbb Mon Sep 17 00:00:00 2001 From: ThibG Date: Tue, 21 Aug 2018 17:53:01 +0200 Subject: Revert to using Paperclip's filesystem storage, and fix dangling records in remove_remote (#8339) * Fix uncaching worker * Revert to using Paperclip's filesystem backend instead of fog-local fog-local has lots of concurrency issues, causing failure to delete files, dangling file records, and spurious errors UncacheMediaWorker --- Gemfile | 1 - Gemfile.lock | 3 --- app/workers/maintenance/uncache_media_worker.rb | 2 +- config/initializers/paperclip.rb | 12 ++++-------- 4 files changed, 5 insertions(+), 13 deletions(-) (limited to 'config') diff --git a/Gemfile b/Gemfile index 31c3c8086..516d397a2 100644 --- a/Gemfile +++ b/Gemfile @@ -16,7 +16,6 @@ gem 'dotenv-rails', '~> 2.2', '< 2.3' gem 'aws-sdk-s3', '~> 1.9', require: false gem 'fog-core', '~> 1.45' -gem 'fog-local', '~> 0.5', require: false gem 'fog-openstack', '~> 0.1', require: false gem 'paperclip', '~> 6.0' gem 'paperclip-av-transcoder', '~> 0.6' diff --git a/Gemfile.lock b/Gemfile.lock index fbffc0c2d..ea0e3f0cd 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -220,8 +220,6 @@ GEM fog-json (1.0.2) fog-core (~> 1.0) multi_json (~> 1.10) - fog-local (0.5.0) - fog-core (>= 1.27, < 3.0) fog-openstack (0.1.25) fog-core (~> 1.40) fog-json (>= 1.0) @@ -679,7 +677,6 @@ DEPENDENCIES fast_blank (~> 1.0) fastimage fog-core (~> 1.45) - fog-local (~> 0.5) fog-openstack (~> 0.1) fuubar (~> 2.2) goldfinger (~> 2.1) diff --git a/app/workers/maintenance/uncache_media_worker.rb b/app/workers/maintenance/uncache_media_worker.rb index f6a51a1b8..2d1a670a7 100644 --- a/app/workers/maintenance/uncache_media_worker.rb +++ b/app/workers/maintenance/uncache_media_worker.rb @@ -8,7 +8,7 @@ class Maintenance::UncacheMediaWorker def perform(media_attachment_id) media = MediaAttachment.find(media_attachment_id) - return unless media.file.exists? + return if media.file.blank? media.file.destroy media.save diff --git a/config/initializers/paperclip.rb b/config/initializers/paperclip.rb index c134bc5b8..59ab9b9a1 100644 --- a/config/initializers/paperclip.rb +++ b/config/initializers/paperclip.rb @@ -74,14 +74,10 @@ elsif ENV['SWIFT_ENABLED'] == 'true' fog_public: true ) else - require 'fog/local' - Paperclip::Attachment.default_options.merge!( - fog_credentials: { - provider: 'Local', - local_root: ENV.fetch('PAPERCLIP_ROOT_PATH') { Rails.root.join('public', 'system') }, - }, - fog_directory: '', - fog_host: ENV.fetch('PAPERCLIP_ROOT_URL') { '/system' } + storage: :filesystem, + use_timestamp: true, + path: (ENV['PAPERCLIP_ROOT_PATH'] || ':rails_root/public/system') + '/:class/:attachment/:id_partition/:style/:filename', + url: (ENV['PAPERCLIP_ROOT_URL'] || '/system') + '/:class/:attachment/:id_partition/:style/:filename', ) end -- cgit