From e5282e4ec0e9dab62dde9481284b0cfd30690fb9 Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Sun, 9 Apr 2017 08:47:25 -0400 Subject: Clean up about page (#1282) * Add InstancePresenter to expose site details * Clean up about controller, use instance presenter --- app/controllers/about_controller.rb | 29 ++++++++++++----------------- 1 file changed, 12 insertions(+), 17 deletions(-) (limited to 'app/controllers/about_controller.rb') diff --git a/app/controllers/about_controller.rb b/app/controllers/about_controller.rb index 7fd43489f..04e7ddacf 100644 --- a/app/controllers/about_controller.rb +++ b/app/controllers/about_controller.rb @@ -2,30 +2,25 @@ class AboutController < ApplicationController before_action :set_body_classes + before_action :set_instance_presenter, only: [:show, :more] - def index - @description = Setting.site_description - @open_registrations = Setting.open_registrations - @closed_registrations_message = Setting.closed_registrations_message + def show; end - @user = User.new - @user.build_account - end - - def more - @description = Setting.site_description - @extended_description = Setting.site_extended_description - @contact_account = Account.find_local(Setting.site_contact_username) - @contact_email = Setting.site_contact_email - @user_count = Rails.cache.fetch('user_count') { User.count } - @status_count = Rails.cache.fetch('local_status_count') { Status.local.count } - @domain_count = Rails.cache.fetch('distinct_domain_count') { Account.distinct.count(:domain) } - end + def more; end def terms; end private + def new_user + User.new.tap(&:build_account) + end + helper_method :new_user + + def set_instance_presenter + @instance_presenter = InstancePresenter.new + end + def set_body_classes @body_classes = 'about-body' end -- cgit