2014-02-16 19:26:25 -06:00
|
|
|
require_dependency 'site_serializer'
|
|
|
|
|
|
|
|
class SiteController < ApplicationController
|
2016-02-13 12:29:53 -06:00
|
|
|
layout false
|
|
|
|
skip_before_filter :preload_json, :check_xhr
|
2016-08-12 02:10:08 -05:00
|
|
|
skip_before_filter :redirect_to_login_if_required, only: ['basic_info']
|
2015-05-20 02:12:16 -05:00
|
|
|
|
2015-03-04 22:49:03 -06:00
|
|
|
def site
|
|
|
|
render json: Site.json_for(guardian)
|
|
|
|
end
|
|
|
|
|
|
|
|
def settings
|
|
|
|
render json: SiteSetting.client_settings_json
|
|
|
|
end
|
|
|
|
|
|
|
|
def custom_html
|
|
|
|
render json: custom_html_json
|
|
|
|
end
|
|
|
|
|
|
|
|
def banner
|
|
|
|
render json: banner_json
|
|
|
|
end
|
|
|
|
|
|
|
|
def emoji
|
|
|
|
render json: custom_emoji
|
2014-02-16 19:26:25 -06:00
|
|
|
end
|
2016-08-12 02:10:08 -05:00
|
|
|
|
|
|
|
def basic_info
|
|
|
|
results = {
|
|
|
|
logo_url: UrlHelper.absolute(SiteSetting.logo_url),
|
|
|
|
logo_small_url: UrlHelper.absolute(SiteSetting.logo_small_url),
|
|
|
|
apple_touch_icon_url: UrlHelper.absolute(SiteSetting.apple_touch_icon_url),
|
|
|
|
favicon_url: UrlHelper.absolute(SiteSetting.favicon_url),
|
|
|
|
title: SiteSetting.title,
|
|
|
|
description: SiteSetting.site_description
|
|
|
|
}
|
|
|
|
|
|
|
|
if SiteSetting.mobile_logo_url.present?
|
|
|
|
results[:mobile_logo_url] = SiteSetting.mobile_logo_url
|
|
|
|
end
|
|
|
|
|
|
|
|
# this info is always available cause it can be scraped from a 404 page
|
|
|
|
render json: results
|
|
|
|
end
|
2014-02-21 11:31:54 -06:00
|
|
|
end
|