Sha256: b082491e27f750cea8ee9d221446507e77ffaec3afea7f5b0c3d9cafca2b6246

Contents?: true

Size: 1.75 KB

Versions: 9

Compression:

Stored size: 1.75 KB

Contents

=begin
  Camaleon CMS is a content management system
  Copyright (C) 2015 by Owen Peredo Diaz
  Email: owenperedo@gmail.com
  This program is free software: you can redistribute it and/or modify   it under the terms of the GNU Affero General Public License as  published by the Free Software Foundation, either version 3 of the  License, or (at your option) any later version.
  This program is distributed in the hope that it will be useful,  but WITHOUT ANY WARRANTY; without even the implied warranty of  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  See the  GNU Affero General Public License (GPLv3) for more details.
=end
class AdminController < CamaleonController
  rescue_from CanCan::AccessDenied do |exception|
    flash[:error] = "Error: #{exception.message}"
    redirect_to admin_dashboard_path
  end
  include Admin::ApplicationHelper

  layout "admin"
  before_action :authenticate
  before_action :admin_init_actions
  before_action :admin_logged_actions
  before_action :admin_before_hooks
  after_action :admin_after_hooks

  # render admin dashabord
  def index

  end

  # render admin dashboard
  def dashboard
     render "admin/dashboard/index"
  end

  private
  # initialize all vars and methods for admin panel
  def admin_init_actions
    I18n.locale = current_site.get_admin_language
    @_admin_menus = {}
    @_admin_breadcrumb = []
    @_extra_models_for_fields = []
    # self.append_view_path(Rails.root.join("app", "apps"))
  end

  # trigger hooks for admin panel before admin load
  def admin_before_hooks
    hooks_run("admin_before_load")
  end

  # trigger hooks for admin panel after admin load
  def admin_after_hooks
    hooks_run("admin_after_load")
  end

  def admin_logged_actions
    admin_menus_add_commons unless request.xhr?
  end

end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
camaleon_cms-0.2.1 app/controllers/admin_controller.rb
camaleon_cms-0.2.0 app/controllers/admin_controller.rb
camaleon_cms-0.1.9 app/controllers/admin_controller.rb
camaleon_cms-0.1.8 app/controllers/admin_controller.rb
camaleon_cms-0.1.7 app/controllers/admin_controller.rb
camaleon_cms-0.1.6 app/controllers/admin_controller.rb
camaleon_cms-0.1.5 app/controllers/admin_controller.rb
camaleon_cms-0.1.4 app/controllers/admin_controller.rb
camaleon_cms-0.1.3 app/controllers/admin_controller.rb