FEATURE: Add dark mode option for category logos (#18460)

Adds a new upload field for a second dark mode category logo. 
This alternative will be used when the browser is in dark mode (similar to the global site setting for a dark logo).
This commit is contained in:
Jan Cernik
2022-10-07 12:00:44 -03:00
committed by GitHub
parent e391f71c04
commit 08476f17ff
28 changed files with 110 additions and 24 deletions

View File

@ -69,7 +69,7 @@ class Site
# corresponding ActiveRecord callback to clear the categories cache.
Discourse.cache.fetch(categories_cache_key, expires_in: 30.minutes) do
categories = Category
.includes(:uploaded_logo, :uploaded_background, :tags, :tag_groups, category_required_tag_groups: :tag_group)
.includes(:uploaded_logo, :uploaded_logo_dark, :uploaded_background, :tags, :tag_groups, category_required_tag_groups: :tag_group)
.joins('LEFT JOIN topics t on t.id = categories.topic_id')
.select('categories.*, t.slug topic_slug')
.order(:position)