Sha256: e418c1a494aff6f00ec81aa2024a9698d37e67d9910525be1e23bf7faaa1c2e3

Contents?: true

Size: 810 Bytes

Versions: 13

Compression:

Stored size: 810 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Admin
    # Controller that shows a simple dashboard.
    #
    class LogsController < Decidim::Admin::ApplicationController
      include Decidim::Admin::Logs::Filterable

      helper_method :logs, :no_logs_available?

      def index
        enforce_permission_to :read, :admin_log
      end

      private

      def logs
        @logs ||= filtered_collection.order(created_at: :desc)
      end

      def no_logs_available?
        root_query.none?
      end

      def base_query
        root_query.includes(
          :participatory_space, :user, :resource, :component, :version
        )
      end

      def root_query
        Decidim::ActionLog.where(
          organization: current_organization
        ).for_admin
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
decidim-admin-0.29.1 app/controllers/decidim/admin/logs_controller.rb
decidim-admin-0.28.4 app/controllers/decidim/admin/logs_controller.rb
decidim-admin-0.29.0 app/controllers/decidim/admin/logs_controller.rb
decidim-admin-0.28.3 app/controllers/decidim/admin/logs_controller.rb
decidim-admin-0.29.0.rc4 app/controllers/decidim/admin/logs_controller.rb
decidim-admin-0.29.0.rc3 app/controllers/decidim/admin/logs_controller.rb
decidim-admin-0.29.0.rc2 app/controllers/decidim/admin/logs_controller.rb
decidim-admin-0.29.0.rc1 app/controllers/decidim/admin/logs_controller.rb
decidim-admin-0.28.2 app/controllers/decidim/admin/logs_controller.rb
decidim-admin-0.28.1 app/controllers/decidim/admin/logs_controller.rb
decidim-admin-0.28.0 app/controllers/decidim/admin/logs_controller.rb
decidim-admin-0.28.0.rc5 app/controllers/decidim/admin/logs_controller.rb
decidim-admin-0.28.0.rc4 app/controllers/decidim/admin/logs_controller.rb