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.

38 lines
802 B

  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: {},
  25. token: current_session&.token,
  26. }
  27. end
  28. end