mirror of
https://github.com/discourse/discourse.git
synced 2025-02-13 10:13:59 +08:00
![Joffrey JAFFEUX](/assets/img/avatar_default.png)
This plugin is only useful for developers, however, making it core allows us to centralize any component modification in one commit. This integration also adds a new site_setting: `styleguide_admin_only` which allows to enable a styleguide on a live site while restricting visibility to admins only. By default, styleguide is disabled.
15 lines
299 B
Ruby
15 lines
299 B
Ruby
# frozen_string_literal: true
|
|
|
|
module Styleguide
|
|
class StyleguideController < ApplicationController
|
|
requires_plugin Styleguide::PLUGIN_NAME
|
|
skip_before_action :check_xhr
|
|
|
|
def index
|
|
ensure_admin if SiteSetting.styleguide_admin_only
|
|
|
|
render 'default/empty'
|
|
end
|
|
end
|
|
end
|