From: Thibaut Girka Date: Sat, 4 Jan 2020 21:54:06 +0000 (+0100) Subject: Merge branch 'master' into glitch-soc/merge-upstream X-Git-Url: https://git.xn--scling-oua.cat.family/?a=commitdiff_plain;h=01eaeab56df4da4c697b1096f40a400cc9e2b8e8;p=mastodon.git Merge branch 'master' into glitch-soc/merge-upstream Conflicts: - `app/controllers/application_controller.rb`: Conflict due to theming system. - `app/controllers/oauth/authorizations_controller.rb`: Conflict due to theming system. --- 01eaeab56df4da4c697b1096f40a400cc9e2b8e8 diff --cc Gemfile index bb4e65fdc,b6e845342..a0ad8e464 --- a/Gemfile +++ b/Gemfile @@@ -50,9 -50,8 +50,9 @@@ gem 'fast_blank', '~> 1.0 gem 'fastimage' gem 'goldfinger', '~> 2.1' gem 'hiredis', '~> 0.6' - gem 'redis-namespace', '~> 1.5' + gem 'redis-namespace', '~> 1.7' gem 'health_check', git: 'https://github.com/ianheggie/health_check', ref: '0b799ead604f900ed50685e9b2d469cd2befba5b' +gem 'html2text' gem 'htmlentities', '~> 4.3' gem 'http', '~> 3.3' gem 'http_accept_language', '~> 2.1' diff --cc Gemfile.lock index cfa4201fd,2e86eda19..fec95d27f --- a/Gemfile.lock +++ b/Gemfile.lock @@@ -776,9 -772,8 +776,9 @@@ DEPENDENCIE rails-i18n (~> 5.1) rails-settings-cached (~> 0.6) rdf-normalize (~> 0.3) + redcarpet (~> 3.4) redis (~> 4.1) - redis-namespace (~> 1.5) + redis-namespace (~> 1.7) redis-rails (~> 5.0) rqrcode (~> 0.10) rspec-rails (~> 3.9) diff --cc app/controllers/application_controller.rb index f1a4f0d02,0cfa2b386..c882d40ab --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@@ -211,7 -137,9 +212,12 @@@ class ApplicationController < ActionCon end def respond_with_error(code) - use_pack 'error' - render "errors/#{code}", layout: 'error', status: code, formats: [:html] + respond_to do |format| - format.any { render "errors/#{code}", layout: 'error', status: code, formats: [:html] } ++ format.any do ++ use_pack 'error' ++ render "errors/#{code}", layout: 'error', status: code, formats: [:html] ++ end + format.json { render json: { error: Rack::Utils::HTTP_STATUS_CODES[code] }, status: code } + end end end diff --cc app/controllers/filters_controller.rb index f1e110d87,63d9d9cd3..76be03e53 --- a/app/controllers/filters_controller.rb +++ b/app/controllers/filters_controller.rb @@@ -1,13 -1,11 +1,12 @@@ # frozen_string_literal: true class FiltersController < ApplicationController - include Authorization - layout 'admin' + before_action :authenticate_user! before_action :set_filters, only: :index before_action :set_filter, only: [:edit, :update, :destroy] + before_action :set_pack before_action :set_body_classes def index diff --cc app/controllers/oauth/authorizations_controller.rb index f6f5d1ecc,bb5d639ce..137346ed0 --- a/app/controllers/oauth/authorizations_controller.rb +++ b/app/controllers/oauth/authorizations_controller.rb @@@ -5,7 -5,7 +5,8 @@@ class Oauth::AuthorizationsController before_action :store_current_location before_action :authenticate_resource_owner! + before_action :set_pack + before_action :set_cache_headers include Localized diff --cc app/controllers/settings/base_controller.rb index 8c394a6d3,3c404cfff..b97603af6 --- a/app/controllers/settings/base_controller.rb +++ b/app/controllers/settings/base_controller.rb @@@ -1,8 -1,8 +1,9 @@@ # frozen_string_literal: true class Settings::BaseController < ApplicationController + before_action :set_pack before_action :set_body_classes + before_action :set_cache_headers private diff --cc app/views/settings/preferences/appearance/show.html.haml index f1e3d2e97,d2b05513e..f460cebba --- a/app/views/settings/preferences/appearance/show.html.haml +++ b/app/views/settings/preferences/appearance/show.html.haml @@@ -2,9 -2,16 +2,13 @@@ = t('settings.appearance') = simple_form_for current_user, url: settings_preferences_appearance_path, html: { method: :put } do |f| - .fields-row - .fields-group.fields-row__column.fields-row__column-6 - = f.input :locale, collection: I18n.available_locales, wrapper: :with_label, include_blank: false, label_method: lambda { |locale| human_locale(locale) }, selected: I18n.locale, hint: false - .fields-group.fields-row__column.fields-row__column-6 - = f.input :setting_theme, collection: Themes.instance.names, label_method: lambda { |theme| I18n.t("themes.#{theme}", default: theme) }, wrapper: :with_label, include_blank: false, hint: false + .fields-group + = f.input :locale, collection: I18n.available_locales, wrapper: :with_label, include_blank: false, label_method: lambda { |locale| human_locale(locale) }, selected: I18n.locale, hint: false + - unless I18n.locale == :en + .flash-message{ style: "text-align: unset; color: unset" } + #{t 'appearance.localization.body'} #{content_tag(:a, t('appearance.localization.guide_link_text'), href: t('appearance.localization.guide_link'), target: "_blank", rel: "noopener", style: "text-decoration: underline")} + %h4= t 'appearance.advanced_web_interface' %p.hint= t 'appearance.advanced_web_interface_hint' diff --cc package.json index 9e0c44550,02bbba2a6..71cab74ab --- a/package.json +++ b/package.json @@@ -69,9 -68,8 +69,9 @@@ "@babel/preset-react": "^7.7.4", "@babel/runtime": "^7.7.7", "@gamestdio/websocket": "^0.3.2", - "@clusterws/cws": "^0.16.0", + "@clusterws/cws": "^0.16.1", "array-includes": "^3.1.1", + "atrament": "^0.2.3", "arrow-key-navigation": "^1.1.0", "autoprefixer": "^9.7.3", "axios": "^0.19.0",