Merge branch 'master' into glitch-soc/merge-upstream

Conflicts:
- app/controllers/directories_controller.rb
- app/controllers/settings/applications_controller.rb
- app/controllers/settings/base_controller.rb
- app/controllers/settings/deletes_controller.rb
- app/controllers/settings/exports_controller.rb
- app/controllers/settings/follower_domains_controller.rb
- app/controllers/settings/imports_controller.rb
- app/controllers/settings/migrations_controller.rb
- app/controllers/settings/notifications_controller.rb
- app/controllers/settings/preferences_controller.rb
- app/controllers/settings/sessions_controller.rb
- app/controllers/settings/two_factor_authentication/confirmations_controller.rb
- app/controllers/settings/two_factor_authentication/recovery_codes_controller.rb
- app/controllers/settings/two_factor_authentications_controller.rb

Conflicts were due to some refactoring already made in glitch-soc
when introducing flavours.
This commit is contained in:
Thibaut Girka
2018-12-15 10:38:54 +01:00
141 changed files with 1238 additions and 402 deletions

View File

@@ -31,7 +31,7 @@ class ActivityPub::CollectionsController < Api::BaseController
when 'featured'
@account.pinned_statuses.count
else
raise ActiveRecord::NotFound
raise ActiveRecord::RecordNotFound
end
end
@@ -42,7 +42,7 @@ class ActivityPub::CollectionsController < Api::BaseController
scope.merge!(@account.pinned_statuses)
end
else
raise ActiveRecord::NotFound
raise ActiveRecord::RecordNotFound
end
end

View File

@@ -2,7 +2,7 @@
module Admin
class AccountsController < BaseController
before_action :set_account, only: [:show, :subscribe, :unsubscribe, :redownload, :remove_avatar, :enable, :disable, :memorialize]
before_action :set_account, only: [:show, :subscribe, :unsubscribe, :redownload, :remove_avatar, :remove_header, :enable, :disable, :memorialize]
before_action :require_remote_account!, only: [:subscribe, :unsubscribe, :redownload]
before_action :require_local_account!, only: [:enable, :disable, :memorialize]
@@ -71,6 +71,17 @@ module Admin
redirect_to admin_account_path(@account.id)
end
def remove_header
authorize @account, :remove_header?
@account.header = nil
@account.save!
log_action :remove_header, @account.user
redirect_to admin_account_path(@account.id)
end
private
def set_account

View File

@@ -28,6 +28,7 @@ module Admin
@pam_enabled = ENV['PAM_ENABLED'] == 'true'
@hidden_service = ENV['ALLOW_ACCESS_TO_HIDDEN_SERVICE'] == 'true'
@trending_hashtags = TrendingTags.get(7)
@profile_directory = Setting.profile_directory
end
private

View File

@@ -28,6 +28,7 @@ module Admin
show_known_fediverse_at_about_page
preview_sensitive_media
custom_css
profile_directory
).freeze
BOOLEAN_SETTINGS = %w(
@@ -39,6 +40,7 @@ module Admin
peers_api_enabled
show_known_fediverse_at_about_page
preview_sensitive_media
profile_directory
).freeze
UPLOAD_SETTINGS = %w(

View File

@@ -18,7 +18,7 @@ module Admin
def unhide
authorize @tag, :unhide?
@tag.account_tag_stat.update!(hidden: true)
@tag.account_tag_stat.update!(hidden: false)
redirect_to admin_tags_path(@filter_params)
end

View File

@@ -1,21 +0,0 @@
# frozen_string_literal: true
module RemoteAccountControllerConcern
extend ActiveSupport::Concern
included do
layout 'public'
before_action :set_account
before_action :check_account_suspension
end
private
def set_account
@account = Account.find_remote!(params[:acct])
end
def check_account_suspension
gone if @account.suspended?
end
end

View File

@@ -3,6 +3,7 @@
class DirectoriesController < ApplicationController
layout 'public'
before_action :check_enabled
before_action :set_instance_presenter
before_action :set_tag, only: :show
before_action :set_tags
@@ -23,6 +24,10 @@ class DirectoriesController < ApplicationController
use_pack 'share'
end
def check_enabled
return not_found unless Setting.profile_directory
end
def set_tag
@tag = Tag.discoverable.find_by!(name: params[:id].downcase)
end

View File

@@ -1,7 +1,6 @@
# frozen_string_literal: true
class Settings::ApplicationsController < Settings::BaseController
before_action :set_application, only: [:show, :update, :destroy, :regenerate]
before_action :prepare_scopes, only: [:create, :update]

View File

@@ -3,7 +3,6 @@
# Intentionally does not inherit from BaseController
class Settings::SessionsController < ApplicationController
before_action :set_session, only: :destroy
before_action :set_body_classes
def destroy
@session.destroy!
@@ -16,8 +15,4 @@ class Settings::SessionsController < ApplicationController
def set_session
@session = current_user.session_activations.find(params[:id])
end
def set_body_classes
@body_classes = 'admin'
end
end