Sha256: 03984771b69072f8c6757a0bd6ba6f0dcde9a2c7439faad02c293cff1b821e50

Contents?: true

Size: 632 Bytes

Versions: 1

Compression:

Stored size: 632 Bytes

Contents

module Sunrise
  class DashboardController < Sunrise::ApplicationController
    include Sunrise::Utils::SearchWrapper
    
    authorize_resource :class => false
    
    def index
      per_page = Sunrise::Config.audit_events_per_page
      sort_mode = Sunrise::Config.default_sort_mode
      cur_page = (params[:page] || 1).to_i
      offset = (cur_page - 1) * per_page
      
      @events = Audited.audit_class.includes(:user).limit(per_page).offset(offset).order("audits.id #{sort_mode}")
      
      respond_with(@events) do |format|
        format.html { render :layout => params[:time].blank? }
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
sunrise-cms-0.4.2 app/controllers/sunrise/dashboard_controller.rb