Sha256: 8704d5adad9fca47b5e735a429071491d0228d7dcf81985559c07263a827a508

Contents?: true

Size: 1.1 KB

Versions: 22

Compression:

Stored size: 1.1 KB

Contents

module Admin
  class LogsController < ApplicationController
    before_filter :authenticate_user!   # This is devise, ensure we're logged in.

    layout (EffectiveLogging.layout.kind_of?(Hash) ? EffectiveLogging.layout[:admin_logs] : EffectiveLogging.layout)

    skip_log_page_views :quiet => true
    helper EffectiveLoggingHelper

    def index
      @datatable = Effective::Datatables::Logs.new() if defined?(EffectiveDatatables)
      @page_title = 'Logs'

      EffectiveLogging.authorized?(self, :index, Effective::Log)
    end

    def show
      @log = Effective::Log.includes(:logs).find(params[:id])
      @log.next_log = Effective::Log.unscoped.order(:id).where(:parent_id => @log.parent_id).where('id > ?', @log.id).first
      @log.prev_log = Effective::Log.unscoped.order(:id).where(:parent_id => @log.parent_id).where('id < ?', @log.id).last

      @page_title = "Log ##{@log.to_param}"

      if @log.logs.present?
        @log.datatable = Effective::Datatables::Logs.new(:log_id => @log.id) if defined?(EffectiveDatatables)
      end

      EffectiveLogging.authorized?(self, :show, @log)
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
effective_logging-1.5.6 app/controllers/admin/logs_controller.rb
effective_logging-1.5.5 app/controllers/admin/logs_controller.rb
effective_logging-1.5.4 app/controllers/admin/logs_controller.rb
effective_logging-1.5.3 app/controllers/admin/logs_controller.rb
effective_logging-1.5.2 app/controllers/admin/logs_controller.rb
effective_logging-1.5.1 app/controllers/admin/logs_controller.rb
effective_logging-1.5.0 app/controllers/admin/logs_controller.rb
effective_logging-1.4.1 app/controllers/admin/logs_controller.rb
effective_logging-1.4.0 app/controllers/admin/logs_controller.rb
effective_logging-1.3.1 app/controllers/admin/logs_controller.rb
effective_logging-1.3.0 app/controllers/admin/logs_controller.rb
effective_logging-1.2.6 app/controllers/admin/logs_controller.rb
effective_logging-1.2.5 app/controllers/admin/logs_controller.rb
effective_logging-1.2.4 app/controllers/admin/logs_controller.rb
effective_logging-1.2.3 app/controllers/admin/logs_controller.rb
effective_logging-1.2.2 app/controllers/admin/logs_controller.rb
effective_logging-1.2.1 app/controllers/admin/logs_controller.rb
effective_logging-1.2.0 app/controllers/admin/logs_controller.rb
effective_logging-1.1.3 app/controllers/admin/logs_controller.rb
effective_logging-1.1.2 app/controllers/admin/logs_controller.rb