Sha256: 8bc22a9a32663f0240d4050647b6eeb4d0cf09ceec8f663042606a8af811f593

Contents?: true

Size: 752 Bytes

Versions: 15

Compression:

Stored size: 752 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Admin
    # Controller that shows a simple dashboard.
    #
    class DashboardController < Decidim::Admin::ApplicationController
      helper_method :latest_action_logs

      def show
        enforce_permission_to :read, :admin_dashboard
      end

      private

      def latest_action_logs
        @latest_action_logs ||= Decidim::ActionLog
                                .where(organization: current_organization)
                                .includes(:participatory_space, :user, :resource, :component, :version)
                                .for_admin
                                .order(created_at: :desc)
                                .first(20)
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
decidim-admin-0.21.0 app/controllers/decidim/admin/dashboard_controller.rb
decidim-admin-0.20.1 app/controllers/decidim/admin/dashboard_controller.rb
decidim-admin-0.20.0 app/controllers/decidim/admin/dashboard_controller.rb
decidim-admin-0.19.1 app/controllers/decidim/admin/dashboard_controller.rb
decidim-admin-0.18.1 app/controllers/decidim/admin/dashboard_controller.rb
decidim-admin-0.19.0 app/controllers/decidim/admin/dashboard_controller.rb
decidim-admin-0.17.2 app/controllers/decidim/admin/dashboard_controller.rb
decidim-admin-0.18.0 app/controllers/decidim/admin/dashboard_controller.rb
decidim-admin-0.17.1 app/controllers/decidim/admin/dashboard_controller.rb
decidim-admin-0.16.1 app/controllers/decidim/admin/dashboard_controller.rb
decidim-admin-0.17.0 app/controllers/decidim/admin/dashboard_controller.rb
decidim-admin-0.16.0 app/controllers/decidim/admin/dashboard_controller.rb
decidim-admin-0.15.2 app/controllers/decidim/admin/dashboard_controller.rb
decidim-admin-0.15.1 app/controllers/decidim/admin/dashboard_controller.rb
decidim-admin-0.15.0 app/controllers/decidim/admin/dashboard_controller.rb