Sha256: b56cdb85a7a8f92382f7fea9b291e76dee4051c03d173f9e5e91323803ba45be

Contents?: true

Size: 1.13 KB

Versions: 13

Compression:

Stored size: 1.13 KB

Contents

module Spree
  module Admin
    class GeneralSettingsController < BaseController
      def show
        @preferences = ['site_name', 'default_seo_title', 'default_meta_keywords',
                        'default_meta_description', 'site_url']
      end

      def edit
        @preferences = [:site_name, :default_seo_title, :default_meta_keywords,
                        :default_meta_description, :site_url, :allow_ssl_in_production,
                        :allow_ssl_in_staging, :allow_ssl_in_development_and_test,
                        :check_for_spree_alerts]
      end

      def update
        params.each do |name, value|
          next unless Spree::Config.has_preference? name
          Spree::Config[name] = value
        end

        redirect_to admin_general_settings_path
      end

      def dismiss_alert
        if request.xhr? and params[:alert_id]
          dismissed = Spree::Config[:dismissed_spree_alerts] || ''
          Spree::Config.set :dismissed_spree_alerts => dismissed.split(',').push(params[:alert_id]).join(',')
          filter_dismissed_alerts
          render :nothing => true
        end
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
spree_core-1.0.7 app/controllers/spree/admin/general_settings_controller.rb
spree_core-1.0.6 app/controllers/spree/admin/general_settings_controller.rb
spree_core-1.1.1 app/controllers/spree/admin/general_settings_controller.rb
spree_core-1.1.0 app/controllers/spree/admin/general_settings_controller.rb
spree_core-1.0.4 app/controllers/spree/admin/general_settings_controller.rb
spree_core-1.1.0.rc2 app/controllers/spree/admin/general_settings_controller.rb
spree_core-1.1.0.rc1 app/controllers/spree/admin/general_settings_controller.rb
spree_core-1.0.3 app/controllers/spree/admin/general_settings_controller.rb
spree_core-1.0.2 app/controllers/spree/admin/general_settings_controller.rb
spree_core-1.0.1 app/controllers/spree/admin/general_settings_controller.rb
spree_core-1.0.0 app/controllers/spree/admin/general_settings_controller.rb
spree_core-1.0.0.rc4 app/controllers/spree/admin/general_settings_controller.rb
spree_core-1.0.0.rc3 app/controllers/spree/admin/general_settings_controller.rb