Sha256: bae0da06fdf824db37740f4dc26ad0037c0644641470aded9c8c719a59fadb88

Contents?: true

Size: 1.33 KB

Versions: 14

Compression:

Stored size: 1.33 KB

Contents

module Roroacms
  
  class Admin::ThemesController < AdminController

    include Roroacms::AdminRoroaHelper
    add_breadcrumb I18n.t("generic.themes"), :admin_themes_path, :title => I18n.t("controllers.admin.themes.breadcrumb_title")


    # lists all the avalible themes

    def index
      # set title
      set_title(I18n.t("generic.themes"))

      # finds the current theme that is set in the admin panel
      @current = Setting.get('theme_folder')
      @theme_options = get_theme_options
    end


    # update the currently used theme

    def create
      # the theme used is set in the settings area - this does the update of the current theme used
      Setting.where("setting_name = 'theme_folder'").update_all('setting' => params[:theme])
      Setting.reload_settings
      respond_to do |format|
        format.html { redirect_to admin_themes_path, notice: I18n.t("controllers.admin.themes.create.flash.success") }
      end
    end


    # remove the theme from the theme folder stopping any future usage.

    def destroy
      # remove the directory from the directory structure
      destory_theme params[:id]

      respond_to do |format|
        format.html { redirect_to admin_themes_path, notice: I18n.t("controllers.admin.themes.destroy.flash.success") }
      end
    end

  end

end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
roroacms-0.0.6.9 app/controllers/roroacms/admin/themes_controller.rb
roroacms-0.0.6.8 app/controllers/roroacms/admin/themes_controller.rb
roroacms-0.0.6.7 app/controllers/roroacms/admin/themes_controller.rb
roroacms-0.0.6.6 app/controllers/roroacms/admin/themes_controller.rb
roroacms-0.0.6.5 app/controllers/roroacms/admin/themes_controller.rb
roroacms-0.0.6.4 app/controllers/roroacms/admin/themes_controller.rb
roroacms-0.0.6.2 app/controllers/roroacms/admin/themes_controller.rb
roroacms-0.0.6.1 app/controllers/roroacms/admin/themes_controller.rb
roroacms-0.0.6 app/controllers/roroacms/admin/themes_controller.rb
roroacms-0.0.5 app/controllers/roroacms/admin/themes_controller.rb
roroacms-0.0.4 app/controllers/roroacms/admin/themes_controller.rb
roroacms-0.0.3 app/controllers/roroacms/admin/themes_controller.rb
roroacms-0.0.2 app/controllers/roroacms/admin/themes_controller.rb
roroacms-0.0.1 app/controllers/roroacms/admin/themes_controller.rb