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.

39 lines
911 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. respond_to do |format|
  10. format.html do
  11. @initial_state_json = ActiveModelSerializers::SerializableResource.new(
  12. InitialStatePresenter.new(settings: { known_fediverse: Setting.show_known_fediverse_at_about_page }, token: current_session&.token),
  13. serializer: InitialStateSerializer
  14. ).to_json
  15. end
  16. end
  17. end
  18. private
  19. def check_enabled
  20. raise ActiveRecord::RecordNotFound unless Setting.timeline_preview
  21. end
  22. def set_body_classes
  23. @body_classes = 'with-modals'
  24. end
  25. def set_instance_presenter
  26. @instance_presenter = InstancePresenter.new
  27. end
  28. def set_pack
  29. use_pack 'about'
  30. end
  31. end