mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
Theming: color scheme editing. Unfinished! Doesn't have any effect on css files yet.
This commit is contained in:
14
db/fixtures/701_color_schemes.rb
Normal file
14
db/fixtures/701_color_schemes.rb
Normal file
@@ -0,0 +1,14 @@
|
||||
ColorScheme.seed do |s|
|
||||
s.id = 1
|
||||
s.name = I18n.t("color_schemes.base_theme_name")
|
||||
s.enabled = false
|
||||
end
|
||||
|
||||
ColorSchemeColor::BASE_COLORS.each_with_index do |color, i|
|
||||
ColorSchemeColor.seed do |c|
|
||||
c.id = i+1
|
||||
c.name = color[0]
|
||||
c.hex = color[1]
|
||||
c.color_scheme_id = 1
|
||||
end
|
||||
end
|
||||
13
db/migrate/20140416202746_create_color_schemes.rb
Normal file
13
db/migrate/20140416202746_create_color_schemes.rb
Normal file
@@ -0,0 +1,13 @@
|
||||
class CreateColorSchemes < ActiveRecord::Migration
|
||||
def change
|
||||
create_table :color_schemes do |t|
|
||||
t.string :name, null: false
|
||||
t.boolean :enabled, null: false, default: false
|
||||
|
||||
t.integer :versioned_id
|
||||
t.integer :version, null: false, default: 1
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
||||
14
db/migrate/20140416202801_create_color_scheme_colors.rb
Normal file
14
db/migrate/20140416202801_create_color_scheme_colors.rb
Normal file
@@ -0,0 +1,14 @@
|
||||
class CreateColorSchemeColors < ActiveRecord::Migration
|
||||
def change
|
||||
create_table :color_scheme_colors do |t|
|
||||
t.string :name, null: false
|
||||
t.string :hex, null: false
|
||||
t.integer :opacity, null: false, default: 100
|
||||
t.integer :color_scheme_id, null: false
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
|
||||
add_index :color_scheme_colors, [:color_scheme_id]
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user