diff --git a/app/assets/javascripts/admin/models/site_customization.js b/app/assets/javascripts/admin/models/site_customization.js index 0e678185c..bc41b4936 100644 --- a/app/assets/javascripts/admin/models/site_customization.js +++ b/app/assets/javascripts/admin/models/site_customization.js @@ -7,7 +7,7 @@ @module Discourse **/ Discourse.SiteCustomization = Discourse.Model.extend({ - trackedProperties: ['enabled', 'name', 'stylesheet', 'header', 'footer', 'mobile_stylesheet', 'mobile_header', 'mobile_footer', 'override_default_style'], + trackedProperties: ['enabled', 'name', 'stylesheet', 'header', 'footer', 'mobile_stylesheet', 'mobile_header', 'mobile_footer'], description: function() { return "" + this.name + (this.enabled ? ' (*)' : ''); @@ -26,7 +26,7 @@ Discourse.SiteCustomization = Discourse.Model.extend({ return changed; - }.property('override_default_style', 'enabled', 'name', 'stylesheet', 'header', 'footer', 'mobile_stylesheet', 'mobile_header', 'mobile_footer', 'originals'), + }.property('enabled', 'name', 'stylesheet', 'header', 'footer', 'mobile_stylesheet', 'mobile_header', 'mobile_footer', 'originals'), startTrackingChanges: function() { var self = this; @@ -51,8 +51,7 @@ Discourse.SiteCustomization = Discourse.Model.extend({ footer: this.footer, mobile_stylesheet: this.mobile_stylesheet, mobile_header: this.mobile_header, - mobile_footer: this.mobile_footer, - override_default_style: this.override_default_style + mobile_footer: this.mobile_footer }; var siteCustomization = this; diff --git a/app/assets/javascripts/admin/templates/customize_css_html.hbs b/app/assets/javascripts/admin/templates/customize_css_html.hbs index 6bf7f0d53..3729955d7 100644 --- a/app/assets/javascripts/admin/templates/customize_css_html.hbs +++ b/app/assets/javascripts/admin/templates/customize_css_html.hbs @@ -35,7 +35,6 @@
- {{i18n 'admin.customize.override_default'}} {{input type="checkbox" checked=selectedItem.override_default_style}} {{i18n 'admin.customize.enabled'}} {{input type="checkbox" checked=selectedItem.enabled}} {{#unless selectedItem.changed}} {{i18n 'admin.customize.preview'}} diff --git a/app/assets/javascripts/admin/templates/logs/_site_customization_change_details.hbs b/app/assets/javascripts/admin/templates/logs/_site_customization_change_details.hbs index eced3892f..1c353f62a 100644 --- a/app/assets/javascripts/admin/templates/logs/_site_customization_change_details.hbs +++ b/app/assets/javascripts/admin/templates/logs/_site_customization_change_details.hbs @@ -17,6 +17,3 @@
{{i18n 'admin.customize.enabled'}}: {{enabled}}
-
- {{i18n 'admin.customize.override_default'}}: {{override_default_style}} -
diff --git a/app/controllers/admin/site_customizations_controller.rb b/app/controllers/admin/site_customizations_controller.rb index 16540daaf..4c3f671da 100644 --- a/app/controllers/admin/site_customizations_controller.rb +++ b/app/controllers/admin/site_customizations_controller.rb @@ -54,7 +54,7 @@ class Admin::SiteCustomizationsController < Admin::AdminController params.require(:site_customization) .permit(:name, :stylesheet, :header, :footer, :mobile_stylesheet, :mobile_header, :mobile_footer, - :position, :enabled, :key, :override_default_style, + :position, :enabled, :key, :stylesheet_baked) end diff --git a/app/models/site_customization.rb b/app/models/site_customization.rb index 47d224b6e..43f7752fc 100644 --- a/app/models/site_customization.rb +++ b/app/models/site_customization.rb @@ -100,12 +100,6 @@ class SiteCustomization < ActiveRecord::Base end end - def self.override_default_style(preview_style) - preview_style ||= enabled_style_key - style = lookup_style(preview_style) - style.override_default_style if style - end - def self.lookup_style(key) return if key.blank? diff --git a/app/services/staff_action_logger.rb b/app/services/staff_action_logger.rb index 9dbe38e17..0c9e6c115 100644 --- a/app/services/staff_action_logger.rb +++ b/app/services/staff_action_logger.rb @@ -79,7 +79,7 @@ class StaffActionLogger })) end - SITE_CUSTOMIZATION_LOGGED_ATTRS = ['stylesheet', 'header', 'position', 'enabled', 'key', 'override_default_style'] + SITE_CUSTOMIZATION_LOGGED_ATTRS = ['stylesheet', 'header', 'position', 'enabled', 'key'] def log_site_customization_change(old_record, site_customization_params, opts={}) raise Discourse::InvalidParameters.new('site_customization_params is nil') unless site_customization_params diff --git a/app/views/common/_discourse_stylesheet.html.erb b/app/views/common/_discourse_stylesheet.html.erb index a249e1b45..3d1f10818 100644 --- a/app/views/common/_discourse_stylesheet.html.erb +++ b/app/views/common/_discourse_stylesheet.html.erb @@ -1,6 +1,4 @@ -<%- unless SiteCustomization.override_default_style(session[:preview_style]) %> - <%= DiscourseStylesheets.stylesheet_link_tag(mobile_view? ? :mobile : :desktop) %> -<%- end %> +<%= DiscourseStylesheets.stylesheet_link_tag(mobile_view? ? :mobile : :desktop) %> <%- if staff? %> <%= stylesheet_link_tag "admin"%> diff --git a/db/migrate/20141222051622_remove_override_default_styles_from_site_customizations.rb b/db/migrate/20141222051622_remove_override_default_styles_from_site_customizations.rb new file mode 100644 index 000000000..c70f570f8 --- /dev/null +++ b/db/migrate/20141222051622_remove_override_default_styles_from_site_customizations.rb @@ -0,0 +1,5 @@ +class RemoveOverrideDefaultStylesFromSiteCustomizations < ActiveRecord::Migration + def change + remove_column :site_customizations, :override_default_style + end +end