logo

mastofe

My custom branche(s) on git.pleroma.social/pleroma/mastofe git clone https://hacktivis.me/git/mastofe.git

about_controller.rb (863B)


  1. # frozen_string_literal: true
  2. class AboutController < ApplicationController
  3. before_action :set_body_classes
  4. before_action :set_instance_presenter, only: [:show, :more, :terms]
  5. def show
  6. serializable_resource = ActiveModelSerializers::SerializableResource.new(InitialStatePresenter.new(initial_state_params), serializer: InitialStateSerializer)
  7. @initial_state_json = serializable_resource.to_json
  8. end
  9. def more; end
  10. def terms; end
  11. private
  12. def new_user
  13. User.new.tap(&:build_account)
  14. end
  15. helper_method :new_user
  16. def set_instance_presenter
  17. @instance_presenter = InstancePresenter.new
  18. end
  19. def set_body_classes
  20. @body_classes = 'about-body'
  21. end
  22. def initial_state_params
  23. {
  24. settings: { known_fediverse: Setting.show_known_fediverse_at_about_page },
  25. token: current_session&.token,
  26. }
  27. end
  28. end