Sha256: 73ece3eb0d33c5fb6c9df18a80a40650f49ad7e87ea0f81efdebf22a934ce40f

Contents?: true

Size: 819 Bytes

Versions: 10

Compression:

Stored size: 819 Bytes

Contents

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

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

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

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

    protected

      def add_breadcrumb_for_controller
        add_breadcrumb I18n.t('hyrax.dashboard.my.works'), hyrax.dashboard_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

10 entries across 10 versions & 2 rubygems

Version Path
hyrax-1.1.1 app/controllers/hyrax/stats_controller.rb
hyrax-1.1.0 app/controllers/hyrax/stats_controller.rb
hyrax-1.0.5 app/controllers/hyrax/stats_controller.rb
hyrax-1.0.4 app/controllers/hyrax/stats_controller.rb
hyrax-1.0.3 app/controllers/hyrax/stats_controller.rb
hyrax-1.0.2 app/controllers/hyrax/stats_controller.rb
hyrax-1.0.1 app/controllers/hyrax/stats_controller.rb
hyrax-1.0.0.rc2 app/controllers/hyrax/stats_controller.rb
hyrax-1.0.0.rc1 app/controllers/hyrax/stats_controller.rb
test_hyrax-0.0.1.alpha app/controllers/hyrax/stats_controller.rb