2020-06-04 02:45:23 +08:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
class BootstrapController < ApplicationController
|
2022-10-20 01:10:06 +08:00
|
|
|
skip_before_action :redirect_to_login_if_required, :check_xhr
|
2021-06-10 21:36:41 +08:00
|
|
|
|
2022-10-20 01:10:06 +08:00
|
|
|
def plugin_css_for_tests
|
|
|
|
urls =
|
|
|
|
Discourse
|
|
|
|
.find_plugin_css_assets(include_disabled: true, desktop_view: true)
|
|
|
|
.map do |target|
|
|
|
|
details = Stylesheet::Manager.new().stylesheet_details(target, "all")
|
|
|
|
details[0][:new_href]
|
|
|
|
end
|
|
|
|
|
|
|
|
stylesheet = <<~CSS
|
|
|
|
/* For use in tests only - `@import`s all plugin stylesheets */
|
|
|
|
#{urls.map { |url| "@import \"#{url}\";" }.join("\n")}
|
|
|
|
CSS
|
|
|
|
|
|
|
|
render plain: stylesheet, content_type: "text/css"
|
|
|
|
end
|
2020-06-04 02:45:23 +08:00
|
|
|
end
|