Merge pull request #3253 from riking/site-json
FEATURE: All preload data available under /site/
This commit is contained in:
commit
ad30c9ed92
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue