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
|
||||
|
||||
def index
|
||||
@site = Site.new(guardian)
|
||||
render_serialized(@site, SiteSerializer)
|
||||
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
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
@ -25,7 +25,13 @@ Discourse::Application.routes.draw do
|
|||
|
||||
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"
|
||||
|
||||
resources :forums
|
||||
|
|
Loading…
Reference in New Issue