mirror of
https://github.com/discourse/discourse.git
synced 2025-05-23 16:22:20 +08:00
FEATURE: Calculate sprite-sheet based on currently active themes (#6973)
Previously there was only one sprite sheet, which always included icons from all themes even if they were disabled
This commit is contained in:
@ -10,12 +10,13 @@ class SvgSpriteController < ApplicationController
|
||||
no_cookies
|
||||
|
||||
RailsMultisite::ConnectionManagement.with_hostname(params[:hostname]) do
|
||||
theme_ids = params[:theme_ids].split(",").map(&:to_i)
|
||||
|
||||
if SvgSprite.version != params[:version]
|
||||
return redirect_to path(SvgSprite.path)
|
||||
if SvgSprite.version(theme_ids) != params[:version]
|
||||
return redirect_to path(SvgSprite.path(theme_ids))
|
||||
end
|
||||
|
||||
svg_sprite = "window.__svg_sprite = #{SvgSprite.bundle.inspect};"
|
||||
svg_sprite = "window.__svg_sprite = #{SvgSprite.bundle(theme_ids).inspect};"
|
||||
|
||||
response.headers["Last-Modified"] = 10.years.ago.httpdate
|
||||
response.headers["Content-Length"] = svg_sprite.bytesize.to_s
|
||||
|
Reference in New Issue
Block a user