mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: Improve theme error handling UX
- Update UI to improve contrast - Make it clear that the message is only shown to administrators - Add theme name and id to the console output - Parse the error backtrace to identify the theme-id for post-decoration errors - Improve console output to include the theme name / URL - Add `?safe_mode=no_custom` to the admin panel link, so that it will work even if the theme is causing the site to break
This commit is contained in:
@@ -152,7 +152,7 @@ class Theme < ActiveRecord::Base
|
||||
SvgSprite.expire_cache
|
||||
end
|
||||
|
||||
BASE_COMPILER_VERSION = 51
|
||||
BASE_COMPILER_VERSION = 52
|
||||
def self.compiler_version
|
||||
get_set_cache "compiler_version" do
|
||||
dependencies = [
|
||||
@@ -389,7 +389,7 @@ class Theme < ActiveRecord::Base
|
||||
end
|
||||
caches = JavascriptCache.where(theme_id: theme_ids)
|
||||
caches = caches.sort_by { |cache| theme_ids.index(cache.theme_id) }
|
||||
return caches.map { |c| "<script src='#{c.url}'></script>" }.join("\n")
|
||||
return caches.map { |c| "<script src='#{c.url}' data-theme-id='#{c.theme_id}'></script>" }.join("\n")
|
||||
end
|
||||
list_baked_fields(theme_ids, target, name).map { |f| f.value_baked || f.value }.join("\n")
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user