Sha256: 05ff6c3c0a3e0886d38a7d7e06ca88659bce5c8706392d0a50cc8c70483e22e3

Contents?: true

Size: 759 Bytes

Versions: 7

Compression:

Stored size: 759 Bytes

Contents

require 'open-uri'
require 'time'
require 'rexml/document'

class Admin::ThemesController < Admin::BaseController
  def index
    @themes = Theme.find_all
    @themes.each do |theme|
      # TODO: Move to Theme
      theme.description_html = TextFilter.filter_text(theme.description, [:markdown, :smartypants])
    end
    @active = this_blog.current_theme
  end

  def preview
    theme = Theme.find(params[:theme])
    send_file File.join(theme.path, 'preview.png'),
              type: 'image/png', disposition: 'inline', stream: false
  end

  def switchto
    this_blog.theme = params[:theme]
    this_blog.save
    this_blog.current_theme(:reload)
    flash[:success] = I18n.t('admin.themes.switchto.success')
    redirect_to admin_themes_url
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
publify_core-9.1.0 app/controllers/admin/themes_controller.rb
publify_core-9.0.1 app/controllers/admin/themes_controller.rb
publify_core-9.0.0 app/controllers/admin/themes_controller.rb
publify_core-9.0.0.pre6 app/controllers/admin/themes_controller.rb
publify_core-9.0.0.pre5 app/controllers/admin/themes_controller.rb
publify_core-9.0.0.pre4 app/controllers/admin/themes_controller.rb
publify_core-9.0.0.pre3 app/controllers/admin/themes_controller.rb