Sha256: 35c41d523851b6b6f3e270fd206e689d8e4ee3ff2120c0bf58537a82ab86be27

Contents?: true

Size: 1.13 KB

Versions: 10

Compression:

Stored size: 1.13 KB

Contents

class Admin::DashboardController < Admin::BaseController

  def index
    @recent_activity = []

    Refinery::Plugins.active.each do |plugin|
      begin
        plugin.activity.each do |activity|
          @recent_activity += activity.class.find(:all,
            :conditions => activity.conditions,
            :order => activity.order,
            :limit => activity.limit
          )
        end
      rescue
        logger.warn "#{$!.class.name} raised while getting recent activity for dashboard."
        logger.warn $!.message
        logger.warn $!.backtrace.collect { |b| " > #{b}" }.join("\n")
      end
    end

    @recent_activity = @recent_activity.compact.sort { |x,y|
      y.updated_at <=> x.updated_at
    }.first(activity_show_limit=RefinerySetting.find_or_set(:activity_show_limit, 7))

    @recent_inquiries = defined?(Inquiry) ? Inquiry.latest(activity_show_limit) : []
  end

  def disable_upgrade_message
    RefinerySetting.find(:first, :conditions => {
        :name => 'show_internet_explorer_upgrade_message',
        :scoping => 'refinery'
      }
    ).update_attribute(:value, false)
    render :nothing => true
  end

end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
refinerycms-0.9.8.9 vendor/refinerycms/dashboard/app/controllers/admin/dashboard_controller.rb
refinerycms-0.9.8.8 vendor/refinerycms/dashboard/app/controllers/admin/dashboard_controller.rb
refinerycms-0.9.8.7 vendor/refinerycms/dashboard/app/controllers/admin/dashboard_controller.rb
refinerycms-0.9.8.6 vendor/refinerycms/dashboard/app/controllers/admin/dashboard_controller.rb
refinerycms-0.9.8.5 vendor/refinerycms/dashboard/app/controllers/admin/dashboard_controller.rb
refinerycms-0.9.8.4 vendor/refinerycms/dashboard/app/controllers/admin/dashboard_controller.rb
refinerycms-0.9.8.3 vendor/refinerycms/dashboard/app/controllers/admin/dashboard_controller.rb
refinerycms-0.9.8.2 vendor/refinerycms/dashboard/app/controllers/admin/dashboard_controller.rb
refinerycms-0.9.8.1 vendor/refinerycms/dashboard/app/controllers/admin/dashboard_controller.rb
refinerycms-0.9.8 vendor/refinerycms/dashboard/app/controllers/admin/dashboard_controller.rb