Sha256: cc612d8f76b64e984a8311fd1fadd8ba59a81942a9fca284bb973cb91c2b76f8

Contents?: true

Size: 909 Bytes

Versions: 36

Compression:

Stored size: 909 Bytes

Contents

module Hyrax
  class StatsController < ApplicationController
    include Hyrax::SingularSubresourceController
    include Hyrax::Breadcrumbs

    before_action :build_breadcrumbs, only: [:work, :file]

    # TODO: New reporting features FlipFlop pattern:
    # Flipflop.enabled?(:analytics_redesign)

    def work
      @stats = Hyrax::WorkUsage.new(params[:id])
    end

    def file
      @stats = Hyrax::FileUsage.new(params[:id])
    end

    private

      def add_breadcrumb_for_controller
        add_breadcrumb I18n.t('hyrax.dashboard.my.works'), hyrax.my_works_path
      end

      def add_breadcrumb_for_action
        case action_name
        when 'file'.freeze
          add_breadcrumb I18n.t("hyrax.file_set.browse_view"), main_app.hyrax_file_set_path(params["id"])
        when 'work'.freeze
          add_breadcrumb @work.to_s, main_app.polymorphic_path(@work)
        end
      end
  end
end

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
hyrax-2.9.6 app/controllers/hyrax/stats_controller.rb
hyrax-2.9.5 app/controllers/hyrax/stats_controller.rb
hyrax-2.9.4 app/controllers/hyrax/stats_controller.rb
hyrax-2.9.3 app/controllers/hyrax/stats_controller.rb
hyrax-2.9.2 app/controllers/hyrax/stats_controller.rb
hyrax-2.9.1 app/controllers/hyrax/stats_controller.rb
hyrax-2.9.0 app/controllers/hyrax/stats_controller.rb
hyrax-2.8.0 app/controllers/hyrax/stats_controller.rb
hyrax-2.7.2 app/controllers/hyrax/stats_controller.rb
hyrax-2.7.1 app/controllers/hyrax/stats_controller.rb
hyrax-2.7.0 app/controllers/hyrax/stats_controller.rb
hyrax-2.6.0 app/controllers/hyrax/stats_controller.rb
hyrax-3.0.0.pre.rc1 app/controllers/hyrax/stats_controller.rb
hyrax-3.0.0.pre.beta3 app/controllers/hyrax/stats_controller.rb
hyrax-2.5.1 app/controllers/hyrax/stats_controller.rb
hyrax-2.5.0 app/controllers/hyrax/stats_controller.rb
hyrax-3.0.0.pre.beta2 app/controllers/hyrax/stats_controller.rb
hyrax-2.4.1 app/controllers/hyrax/stats_controller.rb
hyrax-3.0.0.pre.beta1 app/controllers/hyrax/stats_controller.rb
hyrax-2.4.0 app/controllers/hyrax/stats_controller.rb