mirror of
https://github.com/discourse/discourse.git
synced 2026-03-04 01:15:08 +08:00
Enable theme cards to show dark and light mode screenshots. ### Context Prior to this change, a single screenshot was displayed only. ### Changes * introduce separate fields: `screenshot_light_url` and `screenshot_dark_url` * displays both screenshots (horizontally scrollable) * limits display of screenshots to the files named `light` and `dark` only ### Result https://github.com/user-attachments/assets/4d845f32-9120-49b8-8f05-ba7790ce1629 --------- Co-authored-by: Yuriy Kurant <yuriy@discourse.org>
18 lines
480 B
Ruby
18 lines
480 B
Ruby
# frozen_string_literal: true
|
|
|
|
class ThemeIndexSerializer < BasicThemeSerializer
|
|
attributes :user_selectable,
|
|
:screenshot_dark_url,
|
|
:screenshot_light_url,
|
|
:remote_theme_id,
|
|
:enabled?,
|
|
:supported?,
|
|
:system
|
|
|
|
has_one :color_scheme, serializer: ColorSchemeSerializer, embed: :object
|
|
has_one :remote_theme, serializer: RemoteThemeSerializer, embed: :objects
|
|
|
|
def system
|
|
object.system?
|
|
end
|
|
end
|