Sha256: cacb390b32c132899c58e37301c84802441a2cd200b6a47e05c8dd96e6e5b415

Contents?: true

Size: 1.09 KB

Versions: 77

Compression:

Stored size: 1.09 KB

Contents

class Admin::SettingsController < Admin::BaseController
  respond_to :html, :js
  
  def index
    @skip_filter = true
    @settings = Setting.order("key")
    
    if Fullstack::Cms.localized?
      @settings = @settings.where(:locale => params[:locale]) 
      @locale = params[:locale]
    end

    @groups = {}
  
    @settings.each {|s|
      @groups[s.group] ||= []
      @groups[s.group] << s
    }
 

    @groups = @groups.to_a
  
    @groups.sort! do |g1, g2|    
      if g1.first.to_s == "global"
        -1
      elsif g2.first.to_s == "global"
        1
      else  
        g1.first.to_s <=> g2.first.to_s
      end
    end
    
  end

  def new
    @setting = Setting.new  
  end
  
  def edit
  end
  
  def create
      @setting = Setting.new(params[:setting])
      
      if @setting.respond_to?(:author)
        @setting.author ||= current_user
      end
      
      @setting.save
      respond_with(@setting)
  end

  def update
    @setting.attributes = params[:setting]
    @setting.save
    respond_with(@setting)
  end

  def destroy
    @setting.destroy
    respond_with(@setting)
  end
end


Version data entries

77 entries across 77 versions & 1 rubygems

Version Path
fullstack-cms-0.4.6 app/controllers/admin/settings_controller.rb
fullstack-cms-0.4.5 app/controllers/admin/settings_controller.rb
fullstack-cms-0.4.4 app/controllers/admin/settings_controller.rb
fullstack-cms-0.3.8.fix app/controllers/admin/settings_controller.rb
fullstack-cms-0.2.32.fix app/controllers/admin/settings_controller.rb
fullstack-cms-0.4.3 app/controllers/admin/settings_controller.rb
fullstack-cms-0.4.2 app/controllers/admin/settings_controller.rb
fullstack-cms-0.4.1 app/controllers/admin/settings_controller.rb
fullstack-cms-0.3.39 app/controllers/admin/settings_controller.rb
fullstack-cms-0.3.38 app/controllers/admin/settings_controller.rb
fullstack-cms-0.3.37 app/controllers/admin/settings_controller.rb
fullstack-cms-0.3.36 app/controllers/admin/settings_controller.rb
fullstack-cms-0.3.35 app/controllers/admin/settings_controller.rb
fullstack-cms-0.3.34 app/controllers/admin/settings_controller.rb
fullstack-cms-0.3.33 app/controllers/admin/settings_controller.rb
fullstack-cms-0.3.32 app/controllers/admin/settings_controller.rb
fullstack-cms-0.3.31 app/controllers/admin/settings_controller.rb
fullstack-cms-0.3.30 app/controllers/admin/settings_controller.rb
fullstack-cms-0.3.29 app/controllers/admin/settings_controller.rb
fullstack-cms-0.3.28 app/controllers/admin/settings_controller.rb