Sha256: d8a041f22be3b12f7cb65ab6d44e1e21e2165c7346614a0659d660bbdf8326f7

Contents?: true

Size: 709 Bytes

Versions: 11

Compression:

Stored size: 709 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)
                                .order(created_at: :desc)
                                .first(20)
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
decidim-admin-0.14.4 app/controllers/decidim/admin/dashboard_controller.rb
decidim-admin-0.14.3 app/controllers/decidim/admin/dashboard_controller.rb
decidim-admin-0.14.2 app/controllers/decidim/admin/dashboard_controller.rb
decidim-admin-0.14.1 app/controllers/decidim/admin/dashboard_controller.rb
decidim-admin-0.13.1 app/controllers/decidim/admin/dashboard_controller.rb
decidim-admin-0.12.2 app/controllers/decidim/admin/dashboard_controller.rb
decidim-admin-0.13.0 app/controllers/decidim/admin/dashboard_controller.rb
decidim-admin-0.12.1 app/controllers/decidim/admin/dashboard_controller.rb
decidim-admin-0.13.0.pre1 app/controllers/decidim/admin/dashboard_controller.rb
decidim-admin-0.12.0 app/controllers/decidim/admin/dashboard_controller.rb
decidim-admin-0.12.0.pre app/controllers/decidim/admin/dashboard_controller.rb