]> cat aescling's git repositories - mastodon.git/blob - app/controllers/about_controller.rb
Add option to block reports from domain (#8830)
[mastodon.git] / app / controllers / about_controller.rb
1 # frozen_string_literal: true
2
3 class AboutController < ApplicationController
4 before_action :set_body_classes
5 before_action :set_instance_presenter, only: [:show, :more, :terms]
6
7 def show
8 serializable_resource = ActiveModelSerializers::SerializableResource.new(InitialStatePresenter.new(initial_state_params), serializer: InitialStateSerializer)
9 @initial_state_json = serializable_resource.to_json
10 end
11
12 def more
13 render layout: 'public'
14 end
15
16 def terms
17 render layout: 'public'
18 end
19
20 private
21
22 def new_user
23 User.new.tap(&:build_account)
24 end
25
26 helper_method :new_user
27
28 def set_instance_presenter
29 @instance_presenter = InstancePresenter.new
30 end
31
32 def set_body_classes
33 @body_classes = 'with-modals'
34 end
35
36 def initial_state_params
37 {
38 settings: { known_fediverse: Setting.show_known_fediverse_at_about_page },
39 token: current_session&.token,
40 }
41 end
42 end
This page took 0.086525 seconds and 4 git commands to generate.