mirror of
https://github.com/discourse/discourse.git
synced 2024-12-15 09:53:42 +08:00
7a3c541077
It was a dropdown to provide choices of color schemes, and only one scheme could be shown. With this commit, multiple color scheme previews can be displayed on one page at the same time, making admins choose color schemes more easily. Theme preview windows are shrinked. Imported default color schemes. Co-Authored-By: Misaka 0x4e21 <misaka4e21@gmail.com>
20 lines
767 B
Ruby
20 lines
767 B
Ruby
# we can not guess what to do if customization already started, so skip it
|
|
if !Theme.exists?
|
|
STDERR.puts "> Seeding dark and light themes"
|
|
|
|
name = I18n.t("color_schemes.dark_theme_name")
|
|
dark_scheme = ColorScheme.find_by(base_scheme_id: "Dark")
|
|
dark_scheme ||= ColorScheme.create_from_base(name: name, via_wizard: true, base_scheme_id: "Dark")
|
|
|
|
name = I18n.t('color_schemes.dark_theme_name')
|
|
_dark_theme = Theme.create(name: name, user_id: -1,
|
|
color_scheme_id: dark_scheme.id,
|
|
user_selectable: true)
|
|
|
|
name = I18n.t('color_schemes.default_theme_name')
|
|
default_theme = Theme.create(name: name, user_id: -1,
|
|
user_selectable: true)
|
|
|
|
default_theme.set_default!
|
|
end
|