Sha256: e913dd322c3e47d75c3c8258830cc708f8713430a03fd71645eadeb6f25874a2

Contents?: true

Size: 699 Bytes

Versions: 7

Compression:

Stored size: 699 Bytes

Contents

class Admin::ThemesController < Admin::BaseController

  crudify :theme, :order => "updated_at DESC"

  before_filter :find_theme, :only => [:update, :destroy, :edit, :preview_image, :activate]

  # accessor method for theme preview image
  def preview_image
    if File.exists? @theme.preview_image
      send_file(@theme.preview_image, :type => 'image/png',
                                      :disposition => 'inline',
                                      :stream => true)
    else
      return error_404
    end
  end

  def activate
    RefinerySetting[:theme] = @theme.folder_title

    flash[:notice] = "'#{@theme.title}' applied to live site."
    redirect_to admin_themes_url
  end

end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
refinerycms-0.9.6.12 vendor/plugins/themes/app/controllers/admin/themes_controller.rb
refinerycms-0.9.6.11 vendor/plugins/themes/app/controllers/admin/themes_controller.rb
refinerycms-0.9.6.10 vendor/plugins/themes/app/controllers/admin/themes_controller.rb
refinerycms-0.9.6.9 vendor/plugins/themes/app/controllers/admin/themes_controller.rb
refinerycms-0.9.6.8 vendor/plugins/themes/app/controllers/admin/themes_controller.rb
refinerycms-0.9.6.7 vendor/plugins/themes/app/controllers/admin/themes_controller.rb
refinerycms-0.9.6.6 vendor/plugins/themes/app/controllers/admin/themes_controller.rb