1
0
Fork 0
forked from gitea/nas

Remove code for rendering public and hashtag timelines outside the web UI (#19257)

This commit is contained in:
Eugen Rochko 2022-10-04 20:13:46 +02:00 committed by GitHub
parent e2b561e3a5
commit 02ba9cfa35
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
21 changed files with 13 additions and 446 deletions

View file

@ -1,32 +0,0 @@
# frozen_string_literal: true
class DirectoriesController < ApplicationController
layout 'public'
before_action :authenticate_user!, if: :whitelist_mode?
before_action :require_enabled!
before_action :set_instance_presenter
before_action :set_accounts
skip_before_action :require_functional!, unless: :whitelist_mode?
def index
render :index
end
private
def require_enabled!
return not_found unless Setting.profile_directory
end
def set_accounts
@accounts = Account.local.discoverable.by_recent_status.page(params[:page]).per(20).tap do |query|
query.merge!(Account.not_excluded_by_account(current_account)) if current_account
end
end
def set_instance_presenter
@instance_presenter = InstancePresenter.new
end
end

View file

@ -1,26 +0,0 @@
# frozen_string_literal: true
class PublicTimelinesController < ApplicationController
layout 'public'
before_action :authenticate_user!, if: :whitelist_mode?
before_action :require_enabled!
before_action :set_body_classes
before_action :set_instance_presenter
def show; end
private
def require_enabled!
not_found unless Setting.timeline_preview
end
def set_body_classes
@body_classes = 'with-modals'
end
def set_instance_presenter
@instance_presenter = InstancePresenter.new
end
end

View file

@ -21,7 +21,7 @@ class TagsController < ApplicationController
def show
respond_to do |format|
format.html do
expires_in 0, public: true
redirect_to web_path("tags/#{@tag.name}")
end
format.rss do