Sha256: 4591da12685ab5a2775b331be646a27238cbd3063e7d76ade1a09c51c56ea827

Contents?: true

Size: 977 Bytes

Versions: 13

Compression:

Stored size: 977 Bytes

Contents

class Admin::Disguise::ThemesController < ApplicationController
  unloadable

  before_filter :get_theme

  def edit
    @current_theme, @themes = Theme.available_themes(@theme)
    @domain_themes = {}
    DomainTheme.all.each{ |d| @domain_themes[d.name] = @domain_themes[d.name].blank? ? [d] : @domain_themes[d.name] << d }
    if @themes.empty?
      respond_to do |format|
        format.html { render :template => 'admin/themes/no_themes' }
      end
    else
      respond_to do |format|
        format.html { render :template => 'admin/themes/edit' }
      end
    end
  end

  def update
    @theme.update_attributes!(params[:theme])
    respond_to do |format|
      if @theme.name.blank?
        flash[:notice] = t('disguise.theme_removed')
      else
        flash[:notice] = t('disguise.theme_updated')
      end
      format.html { redirect_to edit_admin_theme_path }
    end
  end

  private
    def get_theme
      @theme = Theme.first || Theme.create
    end

end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
disguise-3.0.2 app/controllers/admin/disguise/themes_controller.rb
disguise-3.0.1 app/controllers/admin/disguise/themes_controller.rb
disguise-3.0.0 app/controllers/admin/disguise/themes_controller.rb
disguise-2.0.0 app/controllers/admin/disguise/themes_controller.rb
disguise-0.4.0 app/controllers/admin/disguise/themes_controller.rb
disguise-0.3.12 app/controllers/admin/disguise/themes_controller.rb
disguise-0.3.11 app/controllers/admin/disguise/themes_controller.rb
disguise-0.3.10 app/controllers/admin/disguise/themes_controller.rb
disguise-0.3.8 app/controllers/admin/disguise/themes_controller.rb
disguise-0.3.7 app/controllers/admin/disguise/themes_controller.rb
disguise-0.3.6 app/controllers/admin/disguise/themes_controller.rb
disguise-0.3.4 app/controllers/admin/disguise/themes_controller.rb
disguise-0.3.5 app/controllers/admin/disguise/themes_controller.rb