1 # frozen_string_literal: true
3 class AboutController
< ApplicationController
6 before_action
:require_open_federation!
, only
: [:show, :more]
7 before_action
:set_body_classes, only
: :show
8 before_action
:set_instance_presenter
9 before_action
:set_expires_in, only
: [:show, :more, :terms]
11 skip_before_action
:require_functional!
, only
: [:more, :terms]
16 flash
.now
[:notice] = I18n
.t('about.instance_actor_flash') if params
[:instance_actor]
18 toc_generator
= TOCGenerator
.new(@instance_presenter.site_extended_description
)
20 @contents = toc_generator
.html
21 @table_of_contents = toc_generator
.toc
22 @blocks = DomainBlock
.with_user_facing_limitations
.by_severity
if display_blocks
?
27 helper_method
:display_blocks?
28 helper_method
:display_blocks_rationale?
29 helper_method
:public_fetch_mode?
30 helper_method
:new_user
34 def require_open_federation!
35 not_found
if whitelist_mode
?
39 Setting
.show_domain_blocks
== 'all' || (Setting
.show_domain_blocks
== 'users' && user_signed_in
?)
42 def display_blocks_rationale
?
43 Setting
.show_domain_blocks_rationale
== 'all' || (Setting
.show_domain_blocks_rationale
== 'users' && user_signed_in
?)
47 User
.new
.tap
do |user
|
49 user
.build_invite_request
53 def set_instance_presenter
54 @instance_presenter = InstancePresenter
.new
62 expires_in
0, public
: true