Sha256: 21d0ccf4e24afeab4ba5c4023bed2252e19c2f9035d0a225c22e885be4fca826

Contents?: true

Size: 1.28 KB

Versions: 25

Compression:

Stored size: 1.28 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

25 entries across 25 versions & 1 rubygems

Version Path
roroacms-1.0.0 app/controllers/roroacms/admin/themes_controller.rb
roroacms-0.0.8.6.7 app/controllers/roroacms/admin/themes_controller.rb
roroacms-0.0.8.6.6 app/controllers/roroacms/admin/themes_controller.rb
roroacms-0.0.8.6.5 app/controllers/roroacms/admin/themes_controller.rb
roroacms-0.0.8.6.4 app/controllers/roroacms/admin/themes_controller.rb
roroacms-0.0.8.6.3 app/controllers/roroacms/admin/themes_controller.rb
roroacms-0.0.8.6.2 app/controllers/roroacms/admin/themes_controller.rb
roroacms-0.0.8.6.1 app/controllers/roroacms/admin/themes_controller.rb
roroacms-0.0.8.6 app/controllers/roroacms/admin/themes_controller.rb
roroacms-0.0.8.5 app/controllers/roroacms/admin/themes_controller.rb
roroacms-0.0.8.4 app/controllers/roroacms/admin/themes_controller.rb
roroacms-0.0.8.3 app/controllers/roroacms/admin/themes_controller.rb
roroacms-0.0.8.2 app/controllers/roroacms/admin/themes_controller.rb
roroacms-0.0.8.1 app/controllers/roroacms/admin/themes_controller.rb
roroacms-0.0.8 app/controllers/roroacms/admin/themes_controller.rb
roroacms-0.0.7.10 app/controllers/roroacms/admin/themes_controller.rb
roroacms-0.0.7.8 app/controllers/roroacms/admin/themes_controller.rb
roroacms-0.0.7.7 app/controllers/roroacms/admin/themes_controller.rb
roroacms-0.0.7.6 app/controllers/roroacms/admin/themes_controller.rb
roroacms-0.0.7.5 app/controllers/roroacms/admin/themes_controller.rb