You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
804 B

  1. # frozen_string_literal: true
  2. class PublicTimelinesController < ApplicationController
  3. before_action :set_pack
  4. layout 'public'
  5. before_action :check_enabled
  6. before_action :set_body_classes
  7. before_action :set_instance_presenter
  8. def show
  9. @initial_state_json = ActiveModelSerializers::SerializableResource.new(
  10. InitialStatePresenter.new(settings: { known_fediverse: Setting.show_known_fediverse_at_about_page }, token: current_session&.token),
  11. serializer: InitialStateSerializer
  12. ).to_json
  13. end
  14. private
  15. def check_enabled
  16. not_found unless Setting.timeline_preview
  17. end
  18. def set_body_classes
  19. @body_classes = 'with-modals'
  20. end
  21. def set_instance_presenter
  22. @instance_presenter = InstancePresenter.new
  23. end
  24. def set_pack
  25. use_pack 'about'
  26. end
  27. end