Class: SiteController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- SiteController
- Defined in:
- app/controllers/site_controller.rb
Constant Summary
Constants inherited from ApplicationController
ApplicationController::CHALLENGE_KEY, ApplicationController::HONEYPOT_KEY, ApplicationController::LEGACY_NO_THEMES, ApplicationController::LEGACY_NO_UNOFFICIAL_PLUGINS, ApplicationController::NO_PLUGINS, ApplicationController::NO_THEMES, ApplicationController::NO_UNOFFICIAL_PLUGINS, ApplicationController::SAFE_MODE
Constants included from CanonicalURL::ControllerExtensions
CanonicalURL::ControllerExtensions::ALLOWED_CANONICAL_PARAMS
Instance Attribute Summary
Attributes inherited from ApplicationController
Instance Method Summary collapse
- #banner ⇒ Object
- #basic_info ⇒ Object
- #custom_html ⇒ Object
- #emoji ⇒ Object
- #settings ⇒ Object
- #site ⇒ Object
- #statistics ⇒ Object
Methods inherited from ApplicationController
#application_layout, #can_cache_content?, #clear_notifications, #conditionally_allow_site_embedding, #current_homepage, #discourse_expires_in, #dont_cache_page, #ember_cli_required?, #fetch_user_from_params, #guardian, #handle_permalink, #handle_theme, #handle_unverified_request, #has_escaped_fragment?, #immutable_for, #login_method, #no_cookies, #perform_refresh_session, #post_ids_including_replies, #preload_json, #rate_limit_second_factor!, #redirect_with_client_support, #render_json_dump, #render_serialized, requires_plugin, #rescue_discourse_actions, #resolve_safe_mode, #secure_session, #serialize_data, #set_current_user_for_logs, #set_layout, #set_mobile_view, #set_mp_snapshot_fields, #show_browser_update?, #store_preloaded, #use_crawler_layout?, #with_resolved_locale
Methods included from VaryHeader
Methods included from ThemeResolver
Methods included from ReadOnlyMixin
#add_readonly_header, #allowed_in_staff_writes_only_mode?, #block_if_readonly_mode, #check_readonly_mode, #get_or_check_readonly_mode, #get_or_check_staff_writes_only_mode, included, #staff_writes_only_mode?
Methods included from Hijack
Methods included from GlobalPath
#cdn_path, #cdn_relative_path, #full_cdn_url, #path, #upload_cdn_path
Methods included from JsonError
Methods included from CanonicalURL::ControllerExtensions
#canonical_url, #default_canonical, included
Methods included from CurrentUser
#clear_current_user, #current_user, has_auth_cookie?, #is_api?, #is_user_api?, #log_off_user, #log_on_user, lookup_from_env, #refresh_session
Instance Method Details
#banner ⇒ Object
22 23 24 |
# File 'app/controllers/site_controller.rb', line 22 def render json: end |
#basic_info ⇒ Object
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'app/controllers/site_controller.rb', line 30 def basic_info results = { logo_url: UrlHelper.absolute(SiteSetting.site_logo_url), logo_small_url: UrlHelper.absolute(SiteSetting.site_logo_small_url), apple_touch_icon_url: UrlHelper.absolute(SiteSetting.site_apple_touch_icon_url), favicon_url: UrlHelper.absolute(SiteSetting.site_favicon_url), title: SiteSetting.title, description: SiteSetting.site_description, header_primary_color: ColorScheme.hex_for_name("header_primary") || "333333", header_background_color: ColorScheme.hex_for_name("header_background") || "ffffff", login_required: SiteSetting.login_required, locale: SiteSetting.default_locale, include_in_discourse_discover: SiteSetting.include_in_discourse_discover, } if mobile_logo_url = SiteSetting.site_mobile_logo_url.presence results[:mobile_logo_url] = UrlHelper.absolute(mobile_logo_url) end # this info is always available cause it can be scraped from a 404 page render json: results end |
#custom_html ⇒ Object
18 19 20 |
# File 'app/controllers/site_controller.rb', line 18 def custom_html render json: custom_html_json end |
#emoji ⇒ Object
26 27 28 |
# File 'app/controllers/site_controller.rb', line 26 def emoji render json: custom_emoji end |
#settings ⇒ Object
14 15 16 |
# File 'app/controllers/site_controller.rb', line 14 def settings render json: SiteSetting.client_settings_json end |
#site ⇒ Object
10 11 12 |
# File 'app/controllers/site_controller.rb', line 10 def site render json: Site.json_for(guardian) end |
#statistics ⇒ Object
53 54 55 56 |
# File 'app/controllers/site_controller.rb', line 53 def statistics return redirect_to path("/") unless SiteSetting.share_anonymized_statistics? render json: About.fetch_cached_stats end |