Theming: a UI to choose some base colors that are applied to all the site css. CSS compiled outside of asset pipeline.

This commit is contained in:
Neil Lalonde
2014-05-14 10:18:12 -04:00
parent c97de2c449
commit c4d3aa3d47
46 changed files with 596 additions and 310 deletions
+3 -3
View File
@@ -16,7 +16,7 @@ class ColorSchemeRevisor
def revise
ColorScheme.transaction do
if @params[:enabled]
ColorScheme.update_all enabled: false
ColorScheme.where('id != ?', @color_scheme.id).update_all enabled: false
end
@color_scheme.name = @params[:name]
@@ -25,7 +25,7 @@ class ColorSchemeRevisor
if @params[:colors]
new_version = @params[:colors].any? do |c|
(existing = @color_scheme.colors_by_name[c[:name]]).nil? or existing.hex != c[:hex] or existing.opacity != c[:opacity]
(existing = @color_scheme.colors_by_name[c[:name]]).nil? or existing.hex != c[:hex]
end
end
@@ -47,7 +47,7 @@ class ColorSchemeRevisor
end
end
@color_scheme.save!
@color_scheme.save
@color_scheme.clear_colors_cache
end
@color_scheme