# frozen_string_literal: true
class AboutController < ApplicationController
- before_action :set_body_classes
+ before_action :set_pack
+ layout 'public'
+
before_action :set_instance_presenter, only: [:show, :more, :terms]
def show
helper_method :new_user
- use_pack action_name == 'show' ? 'about' : 'common'
+ def set_pack
++ use_pack 'common'
+ end
+
def set_instance_presenter
@instance_presenter = InstancePresenter.new
end
respond_to do |format|
format.html do
- serializable_resource = ActiveModelSerializers::SerializableResource.new(InitialStatePresenter.new(initial_state_params), serializer: InitialStateSerializer)
- @initial_state_json = serializable_resource.to_json
+ use_pack 'about'
+ @initial_state_json = ActiveModelSerializers::SerializableResource.new(
+ InitialStatePresenter.new(settings: {}, token: current_session&.token),
+ serializer: InitialStateSerializer
+ ).to_json
end
format.rss do
-- content_for :header_tags do
- = javascript_pack_tag 'public', integrity: true, crossorigin: 'anonymous'
-
- content_for :content do
.public-layout
- .container
- %nav.header
- .nav-left
- = link_to root_url, class: 'brand' do
- = image_tag asset_pack_path('logo_full.svg'), alt: 'Mastodon'
+ - unless @hide_navbar
+ .container
+ %nav.header
+ .nav-left
+ = link_to root_url, class: 'brand' do
+ = image_tag asset_pack_path('logo_full.svg'), alt: 'Mastodon'
- - if Setting.profile_directory
- = link_to t('directories.directory'), explore_path, class: 'nav-link optional'
- = link_to t('about.about_this'), about_more_path, class: 'nav-link optional'
- = link_to t('about.apps'), 'https://joinmastodon.org/apps', class: 'nav-link optional'
- .nav-center
- .nav-right
- - if user_signed_in?
- = link_to t('settings.back'), root_url, class: 'nav-link nav-button webapp-btn'
- - else
- = link_to t('auth.login'), new_user_session_path, class: 'webapp-btn nav-link nav-button'
- = link_to t('auth.register'), open_registrations? ? new_user_registration_path : 'https://joinmastodon.org/#getting-started', class: 'webapp-btn nav-link nav-button'
+ - if Setting.profile_directory
+ = link_to t('directories.directory'), explore_path, class: 'nav-link optional'
+ = link_to t('about.about_this'), about_more_path, class: 'nav-link optional'
+ = link_to t('about.apps'), 'https://joinmastodon.org/apps', class: 'nav-link optional'
+ .nav-center
+ .nav-right
+ - if user_signed_in?
+ = link_to t('settings.back'), root_url, class: 'nav-link nav-button webapp-btn'
+ - else
+ = link_to t('auth.login'), new_user_session_path, class: 'webapp-btn nav-link nav-button'
+ = link_to t('auth.register'), open_registrations? ? new_user_registration_path : 'https://joinmastodon.org/#getting-started', class: 'webapp-btn nav-link nav-button'
.container= yield
end
it 'has valid open graph tags' do
- instance_presenter = double(:instance_presenter,
- site_title: 'something',
- site_short_description: 'something',
- site_description: 'something',
- version_number: '1.0',
- source_url: 'https://github.com/tootsuite/mastodon',
- open_registrations: false,
- thumbnail: nil,
- hero: nil,
- mascot: nil,
- user_count: 0,
- status_count: 0,
- commit_hash: commit_hash,
- contact_account: nil,
- closed_registrations_message: 'yes')
+ instance_presenter = double(
+ :instance_presenter,
+ site_title: 'something',
+ site_short_description: 'something',
+ site_description: 'something',
+ version_number: '1.0',
+ source_url: 'https://github.com/tootsuite/mastodon',
+ open_registrations: false,
+ thumbnail: nil,
+ hero: nil,
+ mascot: nil,
+ user_count: 420,
+ status_count: 69,
+ active_user_count: 420,
++ commit_hash: commit_hash,
+ contact_account: nil,
+ sample_accounts: []
+ )
+
assign(:instance_presenter, instance_presenter)
render