Merge pull request #3253 from riking/site-json

FEATURE: All preload data available under /site/
This commit is contained in:
Sam 2015-03-05 15:59:23 +11:00
commit ad30c9ed92
2 changed files with 25 additions and 4 deletions

View File

@ -2,9 +2,24 @@ require_dependency 'site_serializer'
class SiteController < ApplicationController class SiteController < ApplicationController
def index def site
@site = Site.new(guardian) render json: Site.json_for(guardian)
render_serialized(@site, SiteSerializer) 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
end end
end end

View File

@ -25,7 +25,13 @@ Discourse::Application.routes.draw do
resources :about resources :about
get "site" => "site#index" get "site" => "site#site"
namespace :site do
get "settings"
get "custom_html"
get "banner"
get "emoji"
end
get "site_customizations/:key" => "site_customizations#show" get "site_customizations/:key" => "site_customizations#show"
resources :forums resources :forums