Sha256: ddbf1e30eaf8ebf5958cd5e38b96d3cc207a4d5296e3676cded4c73a6a91ac19

Contents?: true

Size: 767 Bytes

Versions: 8

Compression:

Stored size: 767 Bytes

Contents

class StatsController < ApplicationController
  include Sufia::SingularSubresourceController
  include Sufia::Breadcrumbs

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

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

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

  protected

    def add_breadcrumb_for_controller
      add_breadcrumb I18n.t('sufia.dashboard.my.works'), sufia.dashboard_works_path
    end

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

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
sufia-7.1.0 app/controllers/stats_controller.rb
sufia-7.0.0 app/controllers/stats_controller.rb
sufia-7.0.0.rc2 app/controllers/stats_controller.rb
sufia-7.0.0.rc1 app/controllers/stats_controller.rb
sufia-7.0.0.beta4 app/controllers/stats_controller.rb
sufia-7.0.0.beta3 app/controllers/stats_controller.rb
sufia-7.0.0.beta2 app/controllers/stats_controller.rb
sufia-7.0.0.beta1 app/controllers/stats_controller.rb