mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FEATURE: Uploaded images to categories are shown when browsing
This commit is contained in:
@@ -45,6 +45,21 @@ class DiscourseSassImporter < Sass::Importers::Filesystem
|
||||
end
|
||||
|
||||
def find(name, options)
|
||||
|
||||
if name == "category_backgrounds"
|
||||
contents = ""
|
||||
Category.where('background_url IS NOT NULL').each do |c|
|
||||
if c.background_url.present?
|
||||
contents << "#main-outlet.category-#{c.id} { background-image: url(#{c.background_url}) }\n"
|
||||
end
|
||||
end
|
||||
return Sass::Engine.new(contents, options.merge(
|
||||
filename: "#{name}.scss",
|
||||
importer: self,
|
||||
syntax: :scss
|
||||
))
|
||||
end
|
||||
|
||||
if special_imports.has_key? name
|
||||
if name == "theme_variables"
|
||||
contents = ""
|
||||
|
||||
@@ -107,7 +107,8 @@ class DiscourseStylesheets
|
||||
def digest
|
||||
@digest ||= begin
|
||||
theme = (cs = ColorScheme.enabled) ? "#{cs.id}-#{cs.version}" : 0
|
||||
Digest::SHA1.hexdigest("#{RailsMultisite::ConnectionManagement.current_db}-#{theme}-#{DiscourseStylesheets.last_file_updated}")
|
||||
category_updated = Category.last_updated_at
|
||||
Digest::SHA1.hexdigest("#{RailsMultisite::ConnectionManagement.current_db}-#{theme}-#{DiscourseStylesheets.last_file_updated}-#{category_updated}")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user