source stringclasses 1
value | repo stringlengths 5 63 | repo_url stringlengths 24 82 | path stringlengths 5 167 | language stringclasses 1
value | license stringclasses 5
values | stars int64 10 51.4k | ref stringclasses 23
values | size_bytes int64 200 258k | text stringlengths 137 258k |
|---|---|---|---|---|---|---|---|---|---|
github | samvera/hyrax | https://github.com/samvera/hyrax | app/search_builders/hyrax/dashboard/nested_collections_search_builder.rb | Ruby | apache-2.0 | 197 | main | 1,935 | # frozen_string_literal: true
module Hyrax
module Dashboard
# Responsible for searching for collections of the same type that are not the given collection
class NestedCollectionsSearchBuilder < ::Hyrax::CollectionSearchBuilder
# @param access [Symbol] :edit, :read, :discover - With the given :access wha... |
github | samvera/hyrax | https://github.com/samvera/hyrax | app/search_builders/hyrax/dashboard/collections_search_builder.rb | Ruby | apache-2.0 | 197 | main | 2,103 | # frozen_string_literal: true
module Hyrax
module Dashboard
class CollectionsSearchBuilder < Hyrax::CollectionSearchBuilder
include Hyrax::Dashboard::ManagedSearchFilters
self.solr_access_filters_logic += [:apply_collection_deposit_permissions]
self.default_processor_chain += [:show_only_manage... |
github | samvera/hyrax | https://github.com/samvera/hyrax | app/search_builders/hyrax/dashboard/works_search_builder.rb | Ruby | apache-2.0 | 197 | main | 697 | # frozen_string_literal: true
module Hyrax
module Dashboard
class WorksSearchBuilder < Hyrax::WorksSearchBuilder
include Hyrax::Dashboard::ManagedSearchFilters
self.default_processor_chain += [:show_only_managed_works_for_non_admins]
# Adds a filter to exclude works created by the current user... |
github | samvera/hyrax | https://github.com/samvera/hyrax | app/search_builders/hyrax/stats/work_status_search_builder.rb | Ruby | apache-2.0 | 197 | main | 815 | # frozen_string_literal: true
module Hyrax
module Stats
class WorkStatusSearchBuilder < ::SearchBuilder
self.default_processor_chain = [:include_suppressed_facet, :filter_models]
# includes the suppressed facet to get information on deposits.
# use caution when combining this with other searche... |
github | samvera/hyrax | https://github.com/samvera/hyrax | app/inputs/controlled_vocabulary_input.rb | Ruby | apache-2.0 | 197 | main | 3,088 | # frozen_string_literal: true
class ControlledVocabularyInput < MultiValueInput
# # Overriding so that the class is correct and the javascript for will activate for this element.
# # See https://github.com/samvera/hydra-editor/blob/4da9c0ea542f7fde512a306ec3cc90380691138b/app/assets/javascripts/hydra-editor/field_... |
github | samvera/hyrax | https://github.com/samvera/hyrax | app/inputs/multi_value_select_input.rb | Ruby | apache-2.0 | 197 | main | 1,627 | # frozen_string_literal: true
class MultiValueSelectInput < MultiValueInput
# Overriding so that the class is correct and the javascript for will work on this.
# See https://github.com/samvera/hydra-editor/blob/4da9c0ea542f7fde512a306ec3cc90380691138b/app/assets/javascripts/hydra-editor/field_manager.es6#L61
def ... |
github | samvera/hyrax | https://github.com/samvera/hyrax | app/inputs/multifile_input.rb | Ruby | apache-2.0 | 197 | main | 364 | # frozen_string_literal: true
class MultifileInput < SimpleForm::Inputs::CollectionInput
def input(wrapper_options = nil)
merged_input_options = merge_wrapper_options(input_html_options, wrapper_options)
merged_input_options[:name] = "#{@builder.object_name}[#{attribute_name}][]"
@builder.file_field(attr... |
github | samvera/hyrax | https://github.com/samvera/hyrax | app/values/hyrax/chart_data.rb | Ruby | apache-2.0 | 197 | main | 1,085 | # frozen_string_literal: true
module Hyrax
class ChartData
attr_reader :data
def initialize(data)
@data = data
end
def drilldown
data.each_with_object([]) do |(k, v), arr|
arr << Value.new(k, v).drilldown_value
end.compact
end
def series
data.each_with_object(... |
github | samvera/hyrax | https://github.com/samvera/hyrax | app/controllers/concerns/hyrax/flexible_schema_behavior.rb | Ruby | apache-2.0 | 197 | main | 345 | # frozen_string_literal: true
module Hyrax
module FlexibleSchemaBehavior
extend ActiveSupport::Concern
included do
before_action :set_latest_schema_version, only: [:new, :edit]
end
private
def set_latest_schema_version
@latest_schema_version = Hyrax::FlexibleSchema.current_schema_i... |
github | samvera/hyrax | https://github.com/samvera/hyrax | app/controllers/concerns/hyrax/deny_access_override_behavior.rb | Ruby | apache-2.0 | 197 | main | 439 | # frozen_string_literal: true
module Hyrax
module DenyAccessOverrideBehavior
# Overriding the default behavior from Hydra::Core::ControllerBehavior
def deny_access(exception)
if current_user&.persisted?
redirect_to root_path, alert: exception.message
else
session['user_return_to'] ... |
github | samvera/hyrax | https://github.com/samvera/hyrax | app/controllers/concerns/hyrax/themed_layout_controller.rb | Ruby | apache-2.0 | 197 | main | 708 | # frozen_string_literal: true
module Hyrax
module ThemedLayoutController
extend ActiveSupport::Concern
included do
class_attribute :theme
self.theme = 'hyrax'
helper_method :theme
helper_method :show_site_actions?
helper_method :show_site_search?
end
module ClassMethods... |
github | samvera/hyrax | https://github.com/samvera/hyrax | app/controllers/concerns/hyrax/embargoes_controller_behavior.rb | Ruby | apache-2.0 | 197 | main | 3,191 | # frozen_string_literal: true
module Hyrax
module EmbargoesControllerBehavior
extend ActiveSupport::Concern
include Hyrax::ManagesEmbargoes
include Hyrax::Collections::AcceptsBatches
def index
add_breadcrumb t(:'hyrax.controls.home'), root_path
add_breadcrumb t(:'hyrax.dashboard.breadcrum... |
github | samvera/hyrax | https://github.com/samvera/hyrax | app/controllers/concerns/hyrax/singular_subresource_controller.rb | Ruby | apache-2.0 | 197 | main | 564 | # frozen_string_literal: true
module Hyrax
module SingularSubresourceController
extend ActiveSupport::Concern
include DenyAccessOverrideBehavior
included do
before_action :find_work, only: :work
before_action :find_file_set, only: :file
load_and_authorize_resource :work, only: :work
... |
github | samvera/hyrax | https://github.com/samvera/hyrax | app/controllers/concerns/hyrax/api.rb | Ruby | apache-2.0 | 197 | main | 2,080 | # frozen_string_literal: true
module Hyrax
module API
# Generate appropriate json response for +response_type+
DEFAULT_RESPONSES =
{
success: {
code: 200,
message: "Request Succeeded",
description: I18n.t('hyrax.api.success.default')
}.freeze,
delete... |
github | samvera/hyrax | https://github.com/samvera/hyrax | app/controllers/concerns/hyrax/breadcrumbs.rb | Ruby | apache-2.0 | 197 | main | 1,057 | # frozen_string_literal: true
module Hyrax
module Breadcrumbs
extend ActiveSupport::Concern
def build_breadcrumbs
if request.referer
trail_from_referer
else
default_trail
add_breadcrumb_for_controller if user_signed_in?
add_breadcrumb_for_action
end
end
... |
github | samvera/hyrax | https://github.com/samvera/hyrax | app/controllers/concerns/hyrax/flexible_catalog_behavior.rb | Ruby | apache-2.0 | 197 | main | 7,043 | # frozen_string_literal: true
module Hyrax
module FlexibleCatalogBehavior
extend ActiveSupport::Concern
class_methods do
def load_flexible_schema
previous_profile, current_profile = Hyrax::FlexibleSchema.order("created_at asc").last(2).map(&:profile)
return if previous_profile.blank? &... |
github | samvera/hyrax | https://github.com/samvera/hyrax | app/controllers/concerns/hyrax/leases_controller_behavior.rb | Ruby | apache-2.0 | 197 | main | 2,603 | # frozen_string_literal: true
module Hyrax
module LeasesControllerBehavior
extend ActiveSupport::Concern
include Hyrax::ManagesEmbargoes
include Hyrax::Collections::AcceptsBatches
def index
add_breadcrumb t(:'hyrax.controls.home'), root_path
add_breadcrumb t(:'hyrax.dashboard.breadcrumbs.... |
github | samvera/hyrax | https://github.com/samvera/hyrax | app/controllers/concerns/hyrax/ensure_migrated_behavior.rb | Ruby | apache-2.0 | 197 | main | 1,768 | # frozen_string_literal: true
module Hyrax
##
# A shared module for controllers to ensure that a resource has been fully
# migrated from a Wings-backed ActiveFedora object to a native Valkyrie resource
# before an action (like `edit`) is performed.
#
# This is a temporary solution to handle just-in-time mi... |
github | samvera/hyrax | https://github.com/samvera/hyrax | app/controllers/concerns/hyrax/works_controller_behavior.rb | Ruby | apache-2.0 | 197 | main | 20,679 | # frozen_string_literal: true
require 'iiif_manifest'
module Hyrax
module WorksControllerBehavior
extend ActiveSupport::Concern
include Blacklight::Configurable
include Blacklight::SearchContext
include Blacklight::AccessControls::Catalog
include Hyrax::FlexibleSchemaBehavior if Hyrax.config.flex... |
github | samvera/hyrax | https://github.com/samvera/hyrax | app/controllers/concerns/hyrax/breadcrumbs_for_works.rb | Ruby | apache-2.0 | 197 | main | 1,365 | # frozen_string_literal: true
module Hyrax
module BreadcrumbsForWorks
extend ActiveSupport::Concern
include Hyrax::Breadcrumbs
class_methods do
# We don't want the breadcrumb action to occur until after the concern has
# been loaded and authorized
def curation_concern_type=(curation_con... |
github | samvera/hyrax | https://github.com/samvera/hyrax | app/controllers/concerns/hyrax/controller.rb | Ruby | apache-2.0 | 197 | main | 4,245 | # frozen_string_literal: true
##
# A mixin for Hyrax support methods. This is meant to be included in
# `ApplicationController`.
#
# @note private methods within this module are normally still "public API",
# since they are meant to be called by inheriting controllers.
module Hyrax::Controller
extend ActiveSupport... |
github | samvera/hyrax | https://github.com/samvera/hyrax | app/controllers/concerns/hyrax/local_file_downloads_controller_behavior.rb | Ruby | apache-2.0 | 197 | main | 2,449 | # frozen_string_literal: true
module Hyrax
module LocalFileDownloadsControllerBehavior
protected
# Handle the HTTP show request
def send_local_content
response.headers['Accept-Ranges'] = 'bytes'
if request.headers['Range']
send_range_for_local_file
else
send_local_file_c... |
github | samvera/hyrax | https://github.com/samvera/hyrax | app/controllers/concerns/hyrax/valkyrie_downloads_controller_behavior.rb | Ruby | apache-2.0 | 197 | main | 4,289 | # frozen_string_literal: true
module Hyrax
module ValkyrieDownloadsControllerBehavior
def show_valkyrie
file_set_id = params.require(:id)
file_set = Hyrax.query_service.find_by(id: file_set_id)
send_file_contents_valkyrie(file_set)
end
private
# rubocop:disable Metrics/AbcSize, Met... |
github | samvera/hyrax | https://github.com/samvera/hyrax | app/controllers/concerns/hyrax/breadcrumbs_for_works_analytics.rb | Ruby | apache-2.0 | 197 | main | 682 | # frozen_string_literal: true
module Hyrax
module BreadcrumbsForWorksAnalytics
extend ActiveSupport::Concern
include Hyrax::Breadcrumbs
included do
before_action :build_breadcrumbs, only: [:index, :show]
end
def add_breadcrumb_for_controller
add_breadcrumb I18n.t('hyrax.dashboard.bre... |
github | samvera/hyrax | https://github.com/samvera/hyrax | app/controllers/concerns/hyrax/manages_embargoes.rb | Ruby | apache-2.0 | 197 | main | 810 | # frozen_string_literal: true
module Hyrax
module ManagesEmbargoes
extend ActiveSupport::Concern
included do
attr_accessor :curation_concern
helper_method :curation_concern
base_class = Hyrax.config.use_valkyrie? ? Hyrax::Resource : ActiveFedora::Base
load_and_authorize_resource class... |
github | samvera/hyrax | https://github.com/samvera/hyrax | app/controllers/concerns/hyrax/analytics_error_handling.rb | Ruby | apache-2.0 | 197 | main | 3,789 | # frozen_string_literal: true
require 'google/cloud/errors'
module Hyrax
module AnalyticsErrorHandling
extend ActiveSupport::Concern
included do
rescue_from Google::Cloud::PermissionDeniedError, with: :handle_analytics_permission_error
rescue_from Google::Cloud::Error, with: :handle_analytics_ge... |
github | samvera/hyrax | https://github.com/samvera/hyrax | app/controllers/concerns/hyrax/breadcrumbs_for_collections.rb | Ruby | apache-2.0 | 197 | main | 756 | # frozen_string_literal: true
module Hyrax
module BreadcrumbsForCollections
extend ActiveSupport::Concern
include Hyrax::Breadcrumbs
included do
before_action :build_breadcrumbs, only: [:edit, :show]
end
def add_breadcrumb_for_controller
add_breadcrumb I18n.t('hyrax.dashboard.my.coll... |
github | samvera/hyrax | https://github.com/samvera/hyrax | app/controllers/concerns/hyrax/stream_file_downloads_controller_behavior.rb | Ruby | apache-2.0 | 197 | main | 1,386 | # frozen_string_literal: true
module Hyrax
# Overrides Hydra::Controller:DownloadBehavior handing of HEAD requests to
# respond with same headers as a GET request would receive.
module StreamFileDownloadsControllerBehavior
protected
# Handle the HTTP show request
def send_content
response.heade... |
github | samvera/hyrax | https://github.com/samvera/hyrax | app/controllers/concerns/hyrax/collections_controller_behavior.rb | Ruby | apache-2.0 | 197 | main | 5,058 | # frozen_string_literal: true
module Hyrax
module CollectionsControllerBehavior
extend ActiveSupport::Concern
include Blacklight::AccessControls::Catalog
include Blacklight::Configurable
include Blacklight::SearchContext
included do
# include the display_trophy_link view helper method
... |
github | samvera/hyrax | https://github.com/samvera/hyrax | app/controllers/concerns/hyrax/breadcrumbs_for_collection_analytics.rb | Ruby | apache-2.0 | 197 | main | 705 | # frozen_string_literal: true
module Hyrax
module BreadcrumbsForCollectionAnalytics
extend ActiveSupport::Concern
include Hyrax::Breadcrumbs
included do
before_action :build_breadcrumbs, only: [:index, :show]
end
def add_breadcrumb_for_controller
add_breadcrumb I18n.t('hyrax.dashboar... |
github | samvera/hyrax | https://github.com/samvera/hyrax | app/controllers/concerns/hyrax/collections/accepts_batches.rb | Ruby | apache-2.0 | 197 | main | 1,366 | # frozen_string_literal: true
module Hyrax
module Collections
module AcceptsBatches
def batch
@batch ||= batch_ids_from_params
end
def batch=(val)
@batch = val
end
# Callback to be used in before_filter
def check_for_empty_batch?
batch.empty?
end... |
github | samvera/hyrax | https://github.com/samvera/hyrax | app/controllers/concerns/hyrax/admin/users_controller_behavior.rb | Ruby | apache-2.0 | 197 | main | 734 | # frozen_string_literal: true
module Hyrax
module Admin
module UsersControllerBehavior
extend ActiveSupport::Concern
include Blacklight::SearchContext
included do
before_action :ensure_admin!
with_themed_layout 'dashboard'
end
# Display admin menu list of users
... |
github | samvera/hyrax | https://github.com/samvera/hyrax | app/controllers/concerns/hyrax/admin/stats_behavior.rb | Ruby | apache-2.0 | 197 | main | 1,582 | # frozen_string_literal: true
module Hyrax
module Admin
##
# @example using a custom presenter and stats services
# class MyStatsController < ApplicationController
# include Hyrax::Admin::StatsBehavior
#
# self.admin_stats_presenter = MyCustomStatsPresenter
# self.admin_stats... |
github | samvera/hyrax | https://github.com/samvera/hyrax | app/controllers/hyrax/downloads_controller.rb | Ruby | apache-2.0 | 197 | main | 5,168 | # frozen_string_literal: true
module Hyrax
class DownloadsController < ApplicationController
include Hydra::Controller::DownloadBehavior
include Hyrax::StreamFileDownloadsControllerBehavior
include Hyrax::LocalFileDownloadsControllerBehavior
include Hyrax::ValkyrieDownloadsControllerBehavior
inclu... |
github | samvera/hyrax | https://github.com/samvera/hyrax | app/controllers/hyrax/contact_form_controller.rb | Ruby | apache-2.0 | 197 | main | 1,520 | # frozen_string_literal: true
module Hyrax
class ContactFormController < ApplicationController
before_action :build_contact_form
layout 'homepage'
class_attribute :model_class
self.model_class = Hyrax::ContactForm
def new; end
def create
# not spam and a valid form
if @contact_f... |
github | samvera/hyrax | https://github.com/samvera/hyrax | app/controllers/hyrax/featured_work_lists_controller.rb | Ruby | apache-2.0 | 197 | main | 529 | # frozen_string_literal: true
module Hyrax
class FeaturedWorkListsController < ApplicationController
def create
authorize! :update, FeaturedWork
FeaturedWorkList.new.featured_works_attributes = list_params[:featured_works_attributes]
respond_to do |format|
format.html { redirect_to root_... |
github | samvera/hyrax | https://github.com/samvera/hyrax | app/controllers/hyrax/depositors_controller.rb | Ruby | apache-2.0 | 197 | main | 2,706 | # frozen_string_literal: true
module Hyrax
class DepositorsController < ApplicationController
include DenyAccessOverrideBehavior
before_action :authenticate_user!
layout :decide_layout
def index
add_breadcrumb t(:'hyrax.controls.home'), root_path
add_breadcrumb t(:'hyrax.dashboard.bread... |
github | samvera/hyrax | https://github.com/samvera/hyrax | app/controllers/hyrax/trophies_controller.rb | Ruby | apache-2.0 | 197 | main | 471 | # frozen_string_literal: true
module Hyrax
class TrophiesController < ApplicationController
before_action :authenticate_user!
def toggle_trophy
work_id = params[:id]
t = current_user.trophies.where(work_id: work_id).first
if t
authorize!(:destroy, t)
t.destroy
else
... |
github | samvera/hyrax | https://github.com/samvera/hyrax | app/controllers/hyrax/workflow_actions_controller.rb | Ruby | apache-2.0 | 197 | main | 1,546 | # frozen_string_literal: true
module Hyrax
class WorkflowActionsController < ApplicationController
DEFAULT_FORM_CLASS = Hyrax::Forms::WorkflowActionForm
##
# @!attribute [r] curation_concern
# @api private
# @return [Hyrax::Resource]
attr_reader :curation_concern
resource_klass = Hyr... |
github | samvera/hyrax | https://github.com/samvera/hyrax | app/controllers/hyrax/batch_uploads_controller.rb | Ruby | apache-2.0 | 197 | main | 4,227 | # frozen_string_literal: true
module Hyrax
class BatchUploadsController < ApplicationController
include Hydra::Controller::ControllerBehavior
include Hyrax::WorksControllerBehavior
# Gives the class of the form.
class BatchUploadFormService
def self.build(resource, current_ability, *extra)
... |
github | samvera/hyrax | https://github.com/samvera/hyrax | app/controllers/hyrax/single_use_links_viewer_controller.rb | Ruby | apache-2.0 | 197 | main | 4,091 | # frozen_string_literal: true
module Hyrax
class SingleUseLinksViewerController < DownloadsController
include Blacklight::Configurable
include Blacklight::SearchContext
include Blacklight::AccessControls::Catalog
include ActionDispatch::Routing::PolymorphicRoutes
skip_before_action :authorize_dow... |
github | samvera/hyrax | https://github.com/samvera/hyrax | app/controllers/hyrax/collections_controller.rb | Ruby | apache-2.0 | 197 | main | 1,114 | # frozen_string_literal: true
module Hyrax
class CollectionsController < ApplicationController
include CollectionsControllerBehavior
include BreadcrumbsForCollections
with_themed_layout :decide_layout
load_and_authorize_resource except: [:index],
instance_name: :collect... |
github | samvera/hyrax | https://github.com/samvera/hyrax | app/controllers/hyrax/content_blocks_controller.rb | Ruby | apache-2.0 | 197 | main | 1,361 | # frozen_string_literal: true
module Hyrax
class ContentBlocksController < ApplicationController
load_and_authorize_resource
with_themed_layout 'dashboard'
def edit
add_breadcrumb t(:'hyrax.controls.home'), root_path
add_breadcrumb t(:'hyrax.dashboard.breadcrumbs.admin'), hyrax.dashboard_path... |
github | samvera/hyrax | https://github.com/samvera/hyrax | app/controllers/hyrax/citations_controller.rb | Ruby | apache-2.0 | 197 | main | 793 | # frozen_string_literal: true
module Hyrax
class CitationsController < ApplicationController
include WorksControllerBehavior
include DenyAccessOverrideBehavior
include Breadcrumbs
# Overrides decide_layout from WorksControllerBehavior
with_themed_layout '1_column'
before_action :build_breadc... |
github | samvera/hyrax | https://github.com/samvera/hyrax | app/controllers/hyrax/transfers_controller.rb | Ruby | apache-2.0 | 197 | main | 2,856 | # frozen_string_literal: true
module Hyrax
class TransfersController < ApplicationController
before_action :authenticate_user!
before_action :load_proxy_deposit_request, only: :create
load_and_authorize_resource :proxy_deposit_request, parent: false, except: :index
before_action :authorize_depositor_b... |
github | samvera/hyrax | https://github.com/samvera/hyrax | app/controllers/hyrax/dashboard_controller.rb | Ruby | apache-2.0 | 197 | main | 1,310 | # frozen_string_literal: true
module Hyrax
class DashboardController < ApplicationController
include Blacklight::Configurable
include Blacklight::SearchContext
include Hyrax::Breadcrumbs
with_themed_layout 'dashboard'
before_action :authenticate_user!
before_action :build_breadcrumbs, only: [:... |
github | samvera/hyrax | https://github.com/samvera/hyrax | app/controllers/hyrax/batch_edits_controller.rb | Ruby | apache-2.0 | 197 | main | 5,467 | # frozen_string_literal: true
module Hyrax
class BatchEditsController < ApplicationController
include FileSetHelper
include Hyrax::Breadcrumbs
include Hyrax::Collections::AcceptsBatches
before_action :build_breadcrumbs, only: :edit
before_action :filter_docs_with_access!, only: [:edit, :update, :... |
github | samvera/hyrax | https://github.com/samvera/hyrax | app/controllers/hyrax/single_use_links_controller.rb | Ruby | apache-2.0 | 197 | main | 1,616 | # frozen_string_literal: true
module Hyrax
class SingleUseLinksController < ApplicationController
class_attribute :show_presenter
self.show_presenter = Hyrax::SingleUseLinkPresenter
before_action :authenticate_user!
before_action :authorize_user!
# Catch permission errors
rescue_from Hydra::Ac... |
github | samvera/hyrax | https://github.com/samvera/hyrax | app/controllers/hyrax/users_controller.rb | Ruby | apache-2.0 | 197 | main | 2,265 | # frozen_string_literal: true
module Hyrax
class UsersController < ApplicationController
include Blacklight::SearchContext
prepend_before_action :find_user, only: [:show]
helper Hyrax::TrophyHelper
def index
authenticate_user! if Flipflop.hide_users_list?
@users = search(params[:uq])
... |
github | samvera/hyrax | https://github.com/samvera/hyrax | app/controllers/hyrax/uploads_controller.rb | Ruby | apache-2.0 | 197 | main | 1,365 | # frozen_string_literal: true
module Hyrax
class UploadsController < ApplicationController
load_and_authorize_resource class: Hyrax::UploadedFile
def create
if params[:id].blank?
@upload.attributes = { file: params[:files].first,
user: current_user }
else
... |
github | samvera/hyrax | https://github.com/samvera/hyrax | app/controllers/hyrax/file_sets_controller.rb | Ruby | apache-2.0 | 197 | main | 14,116 | # frozen_string_literal: true
module Hyrax
class FileSetsController < ApplicationController
rescue_from WorkflowAuthorizationException, with: :render_unavailable
include Blacklight::Configurable
include Blacklight::SearchContext
include Blacklight::AccessControls::Catalog
include Hyrax::Breadcrum... |
github | samvera/hyrax | https://github.com/samvera/hyrax | app/controllers/hyrax/operations_controller.rb | Ruby | apache-2.0 | 197 | main | 343 | # frozen_string_literal: true
module Hyrax
class OperationsController < ApplicationController
load_and_authorize_resource
def index
@operations = @operations.where(parent_id: nil)
.order(updated_at: :desc)
.page(params[:page])
end
d... |
github | samvera/hyrax | https://github.com/samvera/hyrax | app/controllers/hyrax/stats_controller.rb | Ruby | apache-2.0 | 197 | main | 995 | # frozen_string_literal: true
module Hyrax
class StatsController < ApplicationController
include Hyrax::SingularSubresourceController
include Hyrax::Breadcrumbs
before_action :build_breadcrumbs, only: [:work, :file]
def work
@document = ::SolrDocument.find(params[:id])
@pageviews = Hyrax... |
github | samvera/hyrax | https://github.com/samvera/hyrax | app/controllers/hyrax/notifications_controller.rb | Ruby | apache-2.0 | 197 | main | 980 | # frozen_string_literal: true
module Hyrax
class NotificationsController < ApplicationController
before_action :authenticate_user!
with_themed_layout 'dashboard'
def index
add_breadcrumb t(:'hyrax.controls.home'), root_path
add_breadcrumb t(:'hyrax.dashboard.breadcrumbs.admin'), hyrax.dashboa... |
github | samvera/hyrax | https://github.com/samvera/hyrax | app/controllers/hyrax/fixity_checks_controller.rb | Ruby | apache-2.0 | 197 | main | 1,222 | # frozen_string_literal: true
module Hyrax
class FixityChecksController < ApplicationController
before_action :authenticate_user!
# request here with param :file_set_id will trigger a fixity check if
# needed, and respond with a JSON hash that looks something like:
#
# { "file_id" => [
# ... |
github | samvera/hyrax | https://github.com/samvera/hyrax | app/controllers/hyrax/homepage_controller.rb | Ruby | apache-2.0 | 197 | main | 1,583 | # frozen_string_literal: true
class Hyrax::HomepageController < ApplicationController
# Adds Hydra behaviors into the application controller
include Blacklight::SearchContext
include Blacklight::AccessControls::Catalog
class_attribute :presenter_class
self.presenter_class = Hyrax::HomepagePresenter
layout ... |
github | samvera/hyrax | https://github.com/samvera/hyrax | app/controllers/hyrax/pages_controller.rb | Ruby | apache-2.0 | 197 | main | 1,684 | # frozen_string_literal: true
module Hyrax
# Shows the about and help page
class PagesController < ApplicationController
load_and_authorize_resource class: ContentBlock, except: :show
layout :pages_layout
helper Hyrax::ContentBlockHelper
def show
@page = ContentBlock.for(params[:key])
en... |
github | samvera/hyrax | https://github.com/samvera/hyrax | app/controllers/hyrax/static_controller.rb | Ruby | apache-2.0 | 197 | main | 467 | # frozen_string_literal: true
module Hyrax
# Renders the Help page, terms of use, messages about exporting to Zotero and Mendeley
class StaticController < ApplicationController
layout 'homepage'
def zotero
respond_to do |format|
format.html
format.js { render layout: false }
end... |
github | samvera/hyrax | https://github.com/samvera/hyrax | app/controllers/hyrax/resource_sync_controller.rb | Ruby | apache-2.0 | 197 | main | 1,687 | # frozen_string_literal: true
class Hyrax::ResourceSyncController < ApplicationController
# We don't need locale here
def default_url_options
super.except(:locale)
end
def source_description
render_from_cache_as_xml(:source_description)
end
def capability_list
render_from_cache_as_xml(:capabil... |
github | samvera/hyrax | https://github.com/samvera/hyrax | app/controllers/hyrax/my_controller.rb | Ruby | apache-2.0 | 197 | main | 2,657 | # frozen_string_literal: true
module Hyrax
class MyController < ApplicationController
include Hydra::Catalog
include Hyrax::Collections::AcceptsBatches
# Define filter facets that apply to all repository objects.
def self.configure_facets
# clear facet's copied from the CatalogController
... |
github | samvera/hyrax | https://github.com/samvera/hyrax | app/controllers/hyrax/featured_works_controller.rb | Ruby | apache-2.0 | 197 | main | 735 | # frozen_string_literal: true
module Hyrax
class FeaturedWorksController < ApplicationController
def create
authorize! :create, FeaturedWork
@featured_work = FeaturedWork.new(work_id: params[:id])
respond_to do |format|
if @featured_work.save
format.json { render json: @featur... |
github | samvera/hyrax | https://github.com/samvera/hyrax | app/controllers/hyrax/permissions_controller.rb | Ruby | apache-2.0 | 197 | main | 1,426 | # frozen_string_literal: true
module Hyrax
class PermissionsController < ApplicationController
load_resource class: Hyrax::Resource, instance_name: :curation_concern
attr_reader :curation_concern
helper_method :curation_concern
def confirm
# intentional noop to display default view
end
... |
github | samvera/hyrax | https://github.com/samvera/hyrax | app/controllers/hyrax/my/works_controller.rb | Ruby | apache-2.0 | 197 | main | 1,766 | # frozen_string_literal: true
module Hyrax
module My
class WorksController < MyController
# Define collection specific filter facets.
def self.configure_facets
configure_blacklight do |config|
config.search_builder_class = Hyrax::My::WorksSearchBuilder
config.add_facet_fiel... |
github | samvera/hyrax | https://github.com/samvera/hyrax | app/controllers/hyrax/my/highlights_controller.rb | Ruby | apache-2.0 | 197 | main | 923 | # frozen_string_literal: true
module Hyrax
module My
class HighlightsController < MyController
configure_blacklight do |config|
config.search_builder_class = Hyrax::My::HighlightsSearchBuilder
end
def index
super
end
private
def search_action_url(*args)
... |
github | samvera/hyrax | https://github.com/samvera/hyrax | app/controllers/hyrax/my/collections_controller.rb | Ruby | apache-2.0 | 197 | main | 2,227 | # frozen_string_literal: true
module Hyrax
module My
class CollectionsController < MyController
configure_blacklight do |config|
config.search_builder_class = Hyrax::My::CollectionsSearchBuilder
end
# Define collection specific filter facets.
def self.configure_facets
confi... |
github | samvera/hyrax | https://github.com/samvera/hyrax | app/controllers/hyrax/my/shares_controller.rb | Ruby | apache-2.0 | 197 | main | 543 | # frozen_string_literal: true
module Hyrax
module My
class SharesController < MyController
configure_blacklight do |config|
config.search_builder_class = Hyrax::My::SharesSearchBuilder
end
def index
super
end
private
def search_action_url(*args)
hyrax... |
github | samvera/hyrax | https://github.com/samvera/hyrax | app/controllers/hyrax/api/zotero_controller.rb | Ruby | apache-2.0 | 197 | main | 2,946 | # frozen_string_literal: true
require 'oauth'
module Hyrax
module API
# Adds the ability to authenticate against Zotero's OAuth endpoint
class ZoteroController < ApplicationController
before_action :authenticate_user!
before_action :authorize_user!
before_action :validate_params, only: :cal... |
github | samvera/hyrax | https://github.com/samvera/hyrax | app/controllers/hyrax/api/items_controller.rb | Ruby | apache-2.0 | 197 | main | 2,337 | # frozen_string_literal: true
module Hyrax
module API
# Adds an endpoint that consumes and RESTfully emits JSON from Arkivo
# representing new and updated Zotero-managed publications. An item in the
# Zotero parlance is mapped to a work in Hyrax.
class ItemsController < ApplicationController
ski... |
github | samvera/hyrax | https://github.com/samvera/hyrax | app/controllers/hyrax/dashboard/profiles_controller.rb | Ruby | apache-2.0 | 197 | main | 2,662 | # frozen_string_literal: true
module Hyrax
module Dashboard
## Shows and edit the profile of the current_user
class ProfilesController < Hyrax::UsersController
with_themed_layout 'dashboard'
before_action :find_user
authorize_resource class: '::User', instance_name: :user
def show
... |
github | samvera/hyrax | https://github.com/samvera/hyrax | app/controllers/hyrax/dashboard/collections_controller.rb | Ruby | apache-2.0 | 197 | main | 26,597 | # frozen_string_literal: true
module Hyrax
module Dashboard
## Shows a list of all collections to the admins
class CollectionsController < Hyrax::My::CollectionsController
include Blacklight::AccessControls::Catalog
include Blacklight::Configurable
include Blacklight::SearchContext
inc... |
github | samvera/hyrax | https://github.com/samvera/hyrax | app/controllers/hyrax/dashboard/collection_members_controller.rb | Ruby | apache-2.0 | 197 | main | 2,652 | # frozen_string_literal: true
module Hyrax
module Dashboard
## Shows a list of all collections to the admins
class CollectionMembersController < Hyrax::My::CollectionsController
before_action :filter_docs_with_read_access!
include Hyrax::Collections::AcceptsBatches
load_resource only: :upd... |
github | samvera/hyrax | https://github.com/samvera/hyrax | app/controllers/hyrax/dashboard/works_controller.rb | Ruby | apache-2.0 | 197 | main | 623 | # frozen_string_literal: true
module Hyrax
module Dashboard
## Shows a list of all works to the admins
class WorksController < Hyrax::My::WorksController
# Define collection specific filter facets.
configure_blacklight do |config|
config.search_builder_class = Hyrax::Dashboard::WorksSearch... |
github | samvera/hyrax | https://github.com/samvera/hyrax | app/controllers/hyrax/dashboard/nest_collections_controller.rb | Ruby | apache-2.0 | 197 | main | 3,892 | # frozen_string_literal: true
module Hyrax
module Dashboard
##
# @api public
class NestCollectionsController < ApplicationController
include Blacklight::Configurable
include Blacklight::SearchContext
class_attribute :form_class, :new_collection_form_class
self.form_class = Hyrax::... |
github | samvera/hyrax | https://github.com/samvera/hyrax | app/controllers/hyrax/admin/workflows_controller.rb | Ruby | apache-2.0 | 197 | main | 2,270 | # frozen_string_literal: true
module Hyrax
# Presents a list of works in workflow
class Admin::WorkflowsController < ApplicationController
before_action :ensure_authorized!
with_themed_layout 'dashboard'
class_attribute :deposited_workflow_state_name
# Works that are in this workflow state (see wor... |
github | samvera/hyrax | https://github.com/samvera/hyrax | app/controllers/hyrax/admin/appearances_controller.rb | Ruby | apache-2.0 | 197 | main | 995 | # frozen_string_literal: true
module Hyrax
module Admin
class AppearancesController < ApplicationController
before_action :require_permissions
with_themed_layout 'dashboard'
class_attribute :form_class
self.form_class = Hyrax::Forms::Admin::Appearance
def show
add_breadcrumb... |
github | samvera/hyrax | https://github.com/samvera/hyrax | app/controllers/hyrax/admin/permission_template_accesses_controller.rb | Ruby | apache-2.0 | 197 | main | 2,702 | # frozen_string_literal: true
module Hyrax
module Admin
class PermissionTemplateAccessesController < ApplicationController
load_and_authorize_resource class: 'Hyrax::PermissionTemplateAccess'
def destroy
authorize! :destroy, @permission_template_access
ActiveRecord::Base.transaction d... |
github | samvera/hyrax | https://github.com/samvera/hyrax | app/controllers/hyrax/admin/workflow_roles_controller.rb | Ruby | apache-2.0 | 197 | main | 1,217 | # frozen_string_literal: true
module Hyrax
module Admin
class WorkflowRolesController < ApplicationController
before_action :require_permissions
with_themed_layout 'dashboard'
def index
add_breadcrumb t(:'hyrax.controls.home'), root_path
add_breadcrumb t(:'hyrax.dashboard.breadc... |
github | samvera/hyrax | https://github.com/samvera/hyrax | app/controllers/hyrax/admin/collection_types_controller.rb | Ruby | apache-2.0 | 197 | main | 4,046 | # frozen_string_literal: true
module Hyrax
class Admin::CollectionTypesController < ApplicationController
before_action do
authorize! :manage, :collection_types
end
before_action :set_collection_type, only: [:edit, :update, :destroy]
with_themed_layout 'dashboard'
class_attribute :form_clas... |
github | samvera/hyrax | https://github.com/samvera/hyrax | app/controllers/hyrax/admin/features_controller.rb | Ruby | apache-2.0 | 197 | main | 590 | # frozen_string_literal: true
module Hyrax
module Admin
class FeaturesController < Flipflop::FeaturesController
with_themed_layout 'dashboard'
before_action do
authorize! :manage, Hyrax::Feature
end
def index
add_breadcrumb t(:'hyrax.controls.home'), root_path
add... |
github | samvera/hyrax | https://github.com/samvera/hyrax | app/controllers/hyrax/admin/permission_templates_controller.rb | Ruby | apache-2.0 | 197 | main | 3,879 | # frozen_string_literal: true
module Hyrax
module Admin
class PermissionTemplatesController < ApplicationController
before_action :find_permission_template
authorize_resource class: 'Hyrax::PermissionTemplate', instance_name: :permission_template
def update
update_info = form.update(upd... |
github | samvera/hyrax | https://github.com/samvera/hyrax | app/controllers/hyrax/admin/collection_type_participants_controller.rb | Ruby | apache-2.0 | 197 | main | 1,825 | # frozen_string_literal: true
module Hyrax
class Admin::CollectionTypeParticipantsController < ApplicationController
before_action do
authorize! :manage, :collection_types
end
class_attribute :form_class
self.form_class = Hyrax::Forms::Admin::CollectionTypeParticipantForm
def create
... |
github | samvera/hyrax | https://github.com/samvera/hyrax | app/controllers/hyrax/admin/strategies_controller.rb | Ruby | apache-2.0 | 197 | main | 363 | # frozen_string_literal: true
module Hyrax
module Admin
class StrategiesController < Flipflop::StrategiesController
before_action do
authorize! :manage, Hyrax::Feature
end
# TODO: we could remove this if we used an isolated engine
def features_url(*args)
hyrax.admin_featur... |
github | samvera/hyrax | https://github.com/samvera/hyrax | app/controllers/hyrax/admin/admin_sets_controller.rb | Ruby | apache-2.0 | 197 | main | 7,684 | # frozen_string_literal: true
module Hyrax
class Admin::AdminSetsController < ApplicationController
include Hyrax::CollectionsControllerBehavior
before_action :authenticate_user!
load_and_authorize_resource instance_name: :admin_set,
class: Hyrax.config.admin_set_model
... |
github | samvera/hyrax | https://github.com/samvera/hyrax | app/controllers/hyrax/admin/metadata_profiles_controller.rb | Ruby | apache-2.0 | 197 | main | 2,347 | # frozen_string_literal: true
module Hyrax
module Admin
class MetadataProfilesController < ApplicationController
include Hyrax::ThemedLayoutController
require 'yaml'
with_themed_layout 'dashboard'
# GET /allinson_flex_profiles
def index
add_breadcrumbs
@metadata_pr... |
github | samvera/hyrax | https://github.com/samvera/hyrax | app/controllers/hyrax/admin/analytics/collection_reports_controller.rb | Ruby | apache-2.0 | 197 | main | 2,827 | # frozen_string_literal: true
module Hyrax
module Admin
module Analytics
class CollectionReportsController < AnalyticsController
include Hyrax::BreadcrumbsForCollectionAnalytics
include Hyrax::AnalyticsErrorHandling
def index
return unless Hyrax.config.analytics_reporting?... |
github | samvera/hyrax | https://github.com/samvera/hyrax | app/controllers/hyrax/admin/analytics/analytics_controller.rb | Ruby | apache-2.0 | 197 | main | 1,316 | # frozen_string_literal: true
module Hyrax
module Admin
module Analytics
class AnalyticsController < ApplicationController
include Hyrax::SingularSubresourceController
before_action :set_months
before_action :set_date_range
before_action :set_document, only: [:show]
w... |
github | samvera/hyrax | https://github.com/samvera/hyrax | app/controllers/hyrax/admin/analytics/work_reports_controller.rb | Ruby | apache-2.0 | 197 | main | 4,738 | # frozen_string_literal: true
module Hyrax
module Admin
module Analytics
class WorkReportsController < AnalyticsController
include Hyrax::BreadcrumbsForWorksAnalytics
include Hyrax::AnalyticsErrorHandling
before_action :authenticate_user!
def index
return unless Hy... |
github | samvera/hyrax | https://github.com/samvera/hyrax | app/mailers/hyrax/contact_mailer.rb | Ruby | apache-2.0 | 197 | main | 305 | # frozen_string_literal: true
module Hyrax
# Mailer for contacting the administrator
class ContactMailer < ApplicationMailer
def contact(contact_form)
@contact_form = contact_form
# Check for spam
return if @contact_form.spam?
mail(@contact_form.headers)
end
end
end |
github | samvera/hyrax | https://github.com/samvera/hyrax | app/indexers/concerns/hyrax/permission_indexer.rb | Ruby | apache-2.0 | 197 | main | 877 | # frozen_string_literal: true
module Hyrax
##
# Indexes `*_groups`/`*_users` style permissions. We depend on these
# permissions being up-to-date in the index to support `Hyrax::Ability`.
#
# @example
# class MyIndexer < Hyrax::Indexers::ResourceIndexer
# include Hyrax::PermissionIndexer
# end
... |
github | samvera/hyrax | https://github.com/samvera/hyrax | app/indexers/concerns/hyrax/workflow_indexer.rb | Ruby | apache-2.0 | 197 | main | 1,225 | # frozen_string_literal: true
module Hyrax
module WorkflowIndexer
# Write the workflow roles and state into the solr_document
# @param [Hash] solr_document the solr document to add the fields to
def to_solr
super.tap do |solr_doc|
index_workflow_fields(solr_doc)
end
end
# Wri... |
github | samvera/hyrax | https://github.com/samvera/hyrax | app/indexers/concerns/hyrax/thumbnail_indexer.rb | Ruby | apache-2.0 | 197 | main | 901 | # frozen_string_literal: true
module Hyrax
module ThumbnailIndexer
extend ActiveSupport::Concern
included do
class_attribute :thumbnail_path_service
self.thumbnail_path_service = ThumbnailPathService
class_attribute :thumbnail_field
self.thumbnail_field = :thumbnail_path_ss
end
... |
github | samvera/hyrax | https://github.com/samvera/hyrax | app/indexers/concerns/hyrax/visibility_indexer.rb | Ruby | apache-2.0 | 197 | main | 614 | # frozen_string_literal: true
module Hyrax
##
# Indexes visibility of the resource; Blacklight depends on visibility being
# present in the index to determine visibility of results and object show
# views.
#
# @example
# class MyIndexer < Hyrax::Indexers::ResourceIndexer
# include Hyrax::Visibili... |
github | samvera/hyrax | https://github.com/samvera/hyrax | app/indexers/concerns/hyrax/indexes_linked_metadata.rb | Ruby | apache-2.0 | 197 | main | 296 | # frozen_string_literal: true
module Hyrax
# This module can be mixed in on an indexer in order to index the linked metadata fields
module IndexesLinkedMetadata
# We're overriding a method from ActiveFedora::IndexingService
def rdf_service
DeepIndexingService
end
end
end |
github | samvera/hyrax | https://github.com/samvera/hyrax | app/indexers/concerns/hyrax/indexes_basic_metadata.rb | Ruby | apache-2.0 | 197 | main | 295 | # frozen_string_literal: true
module Hyrax
# This module can be mixed in on an indexer in order to index the basic metadata fields
module IndexesBasicMetadata
# We're overriding a method from ActiveFedora::IndexingService
def rdf_service
BasicMetadataIndexer
end
end
end |
github | samvera/hyrax | https://github.com/samvera/hyrax | app/indexers/concerns/hyrax/location_indexer.rb | Ruby | apache-2.0 | 197 | main | 611 | # frozen_string_literal: true
module Hyrax
##
# Indexes properties common to Hyrax::Resource types
module LocationIndexer
def to_solr
super.tap do |index_document|
index_document[:based_near_label_tesim] = index_document[:based_near_label_sim] = based_near_label_lookup(resource.based_near) if r... |
github | samvera/hyrax | https://github.com/samvera/hyrax | app/indexers/hyrax/indexers.rb | Ruby | apache-2.0 | 197 | main | 1,998 | # frozen_string_literal: true
module Hyrax
module Indexers
##
# Provides a model‐specific subclass for
# +Hyrax::Indexers::PcdmObjectIndexer+.
#
# The base Hyrax engine could get on without this, but it’s useful for
# downstream applications and reflects what we do for forms.
def self.Pcd... |
github | samvera/hyrax | https://github.com/samvera/hyrax | app/indexers/hyrax/work_indexer.rb | Ruby | apache-2.0 | 197 | main | 1,199 | # frozen_string_literal: true
module Hyrax
class WorkIndexer < ActiveFedora::IndexingService
include Hyrax::IndexesThumbnails
include Hyrax::IndexesWorkflow
self.thumbnail_path_service = Hyrax::WorkThumbnailPathService
def generate_solr_document
super.tap do |solr_doc|
solr_doc['member_... |
github | samvera/hyrax | https://github.com/samvera/hyrax | app/indexers/hyrax/indexes_workflow.rb | Ruby | apache-2.0 | 197 | main | 1,471 | # frozen_string_literal: true
module Hyrax
module IndexesWorkflow
mattr_accessor :suppressed_field, instance_writer: false do
"suppressed_bsi"
end
# Adds thumbnail indexing to the solr document
def generate_solr_document
super.tap do |solr_doc|
index_suppressed(solr_doc)
i... |
github | samvera/hyrax | https://github.com/samvera/hyrax | app/indexers/hyrax/pcdm_collection_indexer.rb | Ruby | apache-2.0 | 197 | main | 380 | # frozen_string_literal: true
module Hyrax
##
# @deprecated use +Hyrax::Indexers::PcdmCollectionIndexer+ instead
class PcdmCollectionIndexer < Hyrax::Indexers::PcdmCollectionIndexer
def initialize(*args, **kwargs)
Deprecation.warn "`Hyrax::PcdmCollectionIndexer` is deprecated. Use `Hyrax::Indexers::Pcd... |
github | samvera/hyrax | https://github.com/samvera/hyrax | app/indexers/hyrax/administrative_set_indexer.rb | Ruby | apache-2.0 | 197 | main | 395 | # frozen_string_literal: true
module Hyrax
##
# @deprecated use +Hyrax::Indexers::AdministrativeSetIndexer+ instead
class AdministrativeSetIndexer < Hyrax::Indexers::AdministrativeSetIndexer
def initialize(*args, **kwargs)
Deprecation.warn "`Hyrax::AdministrativeSetIndexer` is deprecated. Use `Hyrax::I... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.