hyrax 3.1.0 → 3.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.circleci/config.yml +8 -11
- data/.dassie/.env +1 -2
- data/.dassie/Gemfile +8 -4
- data/.dassie/app/controllers/catalog_controller.rb +6 -0
- data/.dassie/app/models/user.rb +0 -2
- data/.dassie/config/analytics.yml +12 -5
- data/.dassie/config/environments/development.rb +2 -0
- data/.dassie/config/initializers/hyrax.rb +13 -1
- data/.dassie/db/migrate/20210921150120_enable_uuid_extension.valkyrie_engine.rb +7 -0
- data/.dassie/db/migrate/20210921150121_create_orm_resources.valkyrie_engine.rb +19 -0
- data/.dassie/db/migrate/20210921150122_add_model_type_to_orm_resources.valkyrie_engine.rb +7 -0
- data/.dassie/db/migrate/20210921150123_change_model_type_to_internal_model.valkyrie_engine.rb +7 -0
- data/.dassie/db/migrate/20210921150124_create_path_gin_index.valkyrie_engine.rb +7 -0
- data/.dassie/db/migrate/20210921150125_create_internal_resource_index.valkyrie_engine.rb +7 -0
- data/.dassie/db/migrate/20210921150126_create_updated_at_index.valkyrie_engine.rb +7 -0
- data/.dassie/db/migrate/20210921150127_add_optimistic_locking_to_orm_resources.valkyrie_engine.rb +7 -0
- data/.dassie/db/migrate/20211130181150_create_default_administrative_set.rb +8 -0
- data/.dassie/db/schema.rb +20 -1
- data/.env +7 -4
- data/.github/workflows/main.yml +17 -0
- data/.github/workflows/release.yml +17 -0
- data/.gitignore +4 -0
- data/.regen +1 -1
- data/.rubocop_fixme.yml +3 -1
- data/CONTAINERS.md +13 -10
- data/Dockerfile +4 -4
- data/README.md +37 -0
- data/app/actors/hyrax/actors/base_actor.rb +1 -1
- data/app/actors/hyrax/actors/collections_membership_actor.rb +3 -3
- data/app/actors/hyrax/actors/file_actor.rb +6 -4
- data/app/actors/hyrax/actors/file_set_actor.rb +2 -0
- data/app/actors/hyrax/actors/transfer_request_actor.rb +3 -7
- data/app/assets/javascripts/hyrax/admin/graphs.es6 +34 -37
- data/app/assets/javascripts/hyrax/analytics_events.js +75 -0
- data/app/assets/javascripts/hyrax/autocomplete/linked_data.es6 +1 -3
- data/app/assets/javascripts/hyrax/collapse.js +24 -0
- data/app/assets/javascripts/hyrax/collections.js +1 -2
- data/app/assets/javascripts/hyrax/ga_events.js +2 -8
- data/app/assets/javascripts/hyrax/reports-buttons.js +33 -0
- data/app/assets/javascripts/hyrax.js +2 -1
- data/app/assets/stylesheets/_bootstrap-default-overrides.scss +9 -0
- data/app/assets/stylesheets/hyrax/_styles.scss +5 -0
- data/app/authorities/qa/authorities/collections.rb +4 -5
- data/app/authorities/qa/authorities/find_works.rb +1 -1
- data/app/controllers/concerns/hyrax/breadcrumbs_for_collection_analytics.rb +26 -0
- data/app/controllers/concerns/hyrax/breadcrumbs_for_works_analytics.rb +26 -0
- data/app/controllers/concerns/hyrax/collections_controller_behavior.rb +13 -5
- data/app/controllers/concerns/hyrax/controller.rb +56 -2
- data/app/controllers/concerns/hyrax/works_controller_behavior.rb +83 -59
- data/app/controllers/hyrax/admin/admin_sets_controller.rb +105 -36
- data/app/controllers/hyrax/admin/analytics/analytics_controller.rb +40 -0
- data/app/controllers/hyrax/admin/analytics/collection_reports_controller.rb +61 -0
- data/app/controllers/hyrax/admin/analytics/work_reports_controller.rb +122 -0
- data/app/controllers/hyrax/admin/permission_template_accesses_controller.rb +17 -21
- data/app/controllers/hyrax/batch_edits_controller.rb +12 -3
- data/app/controllers/hyrax/batch_uploads_controller.rb +4 -0
- data/app/controllers/hyrax/citations_controller.rb +1 -1
- data/app/controllers/hyrax/collections_controller.rb +6 -1
- data/app/controllers/hyrax/dashboard/collection_members_controller.rb +12 -9
- data/app/controllers/hyrax/dashboard/collections_controller.rb +119 -37
- data/app/controllers/hyrax/dashboard/nest_collections_controller.rb +75 -39
- data/app/controllers/hyrax/dashboard_controller.rb +8 -0
- data/app/controllers/hyrax/my_controller.rb +4 -4
- data/app/controllers/hyrax/stats_controller.rb +3 -1
- data/app/controllers/hyrax/workflow_actions_controller.rb +8 -5
- data/app/forms/hyrax/forms/administrative_set_form.rb +80 -0
- data/app/forms/hyrax/forms/batch_edit_form.rb +1 -1
- data/app/forms/hyrax/forms/collection_form.rb +2 -2
- data/app/forms/hyrax/forms/dashboard/nest_collection_form.rb +33 -8
- data/app/forms/hyrax/forms/pcdm_collection_form.rb +68 -0
- data/app/forms/hyrax/forms/permission_template_form.rb +17 -9
- data/app/forms/hyrax/forms/resource_form.rb +24 -15
- data/app/forms/hyrax/forms/workflow_action_form.rb +4 -0
- data/app/helpers/hyrax/collections_helper.rb +14 -0
- data/app/helpers/hyrax/hyrax_helper_behavior.rb +9 -0
- data/app/helpers/hyrax/membership_helper.rb +1 -1
- data/app/helpers/hyrax/trophy_helper.rb +1 -1
- data/app/helpers/hyrax/url_helper.rb +1 -1
- data/app/indexers/hyrax/administrative_set_indexer.rb +12 -6
- data/app/indexers/hyrax/deep_indexing_service.rb +1 -1
- data/app/indexers/hyrax/file_set_indexer.rb +1 -0
- data/app/indexers/hyrax/pcdm_collection_indexer.rb +5 -1
- data/app/indexers/hyrax/thumbnail_indexer.rb +31 -0
- data/app/indexers/hyrax/valkyrie_file_set_indexer.rb +7 -7
- data/app/indexers/hyrax/valkyrie_indexer.rb +4 -2
- data/app/indexers/hyrax/valkyrie_work_indexer.rb +13 -0
- data/app/inputs/controlled_vocabulary_input.rb +2 -0
- data/app/jobs/change_depositor_event_job.rb +47 -0
- data/app/jobs/characterize_job.rb +66 -3
- data/app/jobs/concerns/hyrax/members_permission_job_behavior.rb +1 -1
- data/app/jobs/content_depositor_change_event_job.rb +2 -1
- data/app/jobs/hyrax/propagate_change_depositor_job.rb +32 -0
- data/app/jobs/inherit_permissions_job.rb +1 -1
- data/app/jobs/valkyrie_create_derivatives_job.rb +25 -0
- data/app/jobs/valkyrie_ingest_job.rb +124 -0
- data/app/models/admin_set.rb +18 -7
- data/app/models/collection_branding_info.rb +8 -6
- data/app/models/concerns/hyrax/ability/admin_set_ability.rb +31 -7
- data/app/models/concerns/hyrax/ability/collection_ability.rb +35 -20
- data/app/models/concerns/hyrax/ability/collection_type_ability.rb +1 -1
- data/app/models/concerns/hyrax/ability.rb +28 -7
- data/app/models/concerns/hyrax/collection_behavior.rb +2 -2
- data/app/models/concerns/hyrax/file_set/characterization.rb +7 -1
- data/app/models/concerns/hyrax/solr_document/metadata.rb +2 -0
- data/app/models/concerns/hyrax/solr_document_behavior.rb +11 -5
- data/app/models/file_download_stat.rb +4 -4
- data/app/models/hyrax/administrative_set.rb +43 -2
- data/app/models/hyrax/collection_type.rb +2 -2
- data/app/models/hyrax/default_administrative_set.rb +42 -0
- data/app/models/hyrax/file_metadata.rb +5 -1
- data/app/models/hyrax/file_set.rb +42 -1
- data/app/models/hyrax/pcdm_collection.rb +56 -0
- data/app/models/hyrax/permission.rb +1 -1
- data/app/models/hyrax/permission_template.rb +30 -10
- data/app/models/hyrax/statistic.rb +31 -4
- data/app/models/hyrax/work.rb +92 -0
- data/app/models/hyrax/workflow_action_info.rb +16 -0
- data/app/models/proxy_deposit_request.rb +1 -1
- data/app/models/sipity/comment.rb +17 -0
- data/app/models/sipity.rb +11 -2
- data/app/presenters/hyrax/admin/dashboard_presenter.rb +8 -6
- data/app/presenters/hyrax/admin/repository_growth_presenter.rb +10 -5
- data/app/presenters/hyrax/admin/user_activity_presenter.rb +8 -12
- data/app/presenters/hyrax/admin_set_presenter.rb +10 -5
- data/app/presenters/hyrax/collection_presenter.rb +3 -3
- data/app/presenters/hyrax/file_set_presenter.rb +2 -0
- data/app/presenters/hyrax/menu_presenter.rb +4 -0
- data/app/presenters/hyrax/pcdm_member_presenter_factory.rb +3 -3
- data/app/presenters/hyrax/work_show_presenter.rb +11 -3
- data/app/presenters/hyrax/work_usage.rb +1 -0
- data/app/search_builders/hyrax/README.md +1 -1
- data/app/search_builders/hyrax/abstract_type_relation.rb +4 -2
- data/app/search_builders/hyrax/dashboard/collections_search_builder.rb +2 -2
- data/app/search_builders/hyrax/dashboard/managed_search_filters.rb +44 -4
- data/app/search_builders/hyrax/dashboard/nested_collections_search_builder.rb +2 -2
- data/app/search_builders/hyrax/exposed_models_relation.rb +1 -1
- data/app/search_builders/hyrax/filter_by_type.rb +1 -2
- data/app/search_builders/hyrax/my/collections_search_builder.rb +12 -5
- data/app/services/hyrax/access_control_list.rb +13 -0
- data/app/services/hyrax/admin_set_create_service.rb +179 -51
- data/app/services/hyrax/analytics/google/events.rb +37 -0
- data/app/services/hyrax/analytics/google/events_daily.rb +72 -0
- data/app/services/hyrax/analytics/google/visits.rb +44 -0
- data/app/services/hyrax/analytics/google/visits_daily.rb +49 -0
- data/app/services/hyrax/analytics/google.rb +204 -0
- data/app/services/hyrax/analytics/matomo.rb +193 -0
- data/app/services/hyrax/analytics/results.rb +79 -0
- data/app/services/hyrax/analytics.rb +12 -82
- data/app/services/hyrax/change_content_depositor_service.rb +2 -2
- data/app/services/hyrax/change_depositor_service.rb +70 -0
- data/app/services/hyrax/characterization/valkyrie_characterization_service.rb +134 -0
- data/app/services/hyrax/collection_types/permissions_service.rb +1 -1
- data/app/services/hyrax/collections/collection_member_service.rb +12 -2
- data/app/services/hyrax/collections/nested_collection_query_service.rb +31 -14
- data/app/services/hyrax/collections/permissions_create_service.rb +81 -79
- data/app/services/hyrax/collections/permissions_service.rb +1 -1
- data/app/services/hyrax/curation_concern.rb +24 -2
- data/app/services/hyrax/custom_queries/navigators/child_file_sets_navigator.rb +45 -0
- data/app/services/hyrax/custom_queries/navigators/child_filesets_navigator.rb +7 -2
- data/app/services/hyrax/custom_queries/navigators/parent_work_navigator.rb +54 -0
- data/app/services/hyrax/default_middleware_stack.rb +14 -0
- data/app/services/hyrax/ensure_well_formed_admin_set_service.rb +3 -3
- data/app/services/hyrax/file_set_derivatives_service.rb +21 -2
- data/app/services/hyrax/file_set_type_service.rb +2 -5
- data/app/services/hyrax/listeners/acl_index_listener.rb +3 -1
- data/app/services/hyrax/listeners/active_fedora_acl_index_listener.rb +4 -1
- data/app/services/hyrax/listeners/batch_notification_listener.rb +3 -1
- data/app/services/hyrax/listeners/file_metadata_listener.rb +38 -0
- data/app/services/hyrax/listeners/file_set_lifecycle_listener.rb +6 -2
- data/app/services/hyrax/listeners/file_set_lifecycle_notification_listener.rb +6 -2
- data/app/services/hyrax/listeners/member_cleanup_listener.rb +26 -3
- data/app/services/hyrax/listeners/metadata_index_listener.rb +72 -11
- data/app/services/hyrax/listeners/object_lifecycle_listener.rb +9 -3
- data/app/services/hyrax/listeners/proxy_deposit_listener.rb +16 -8
- data/app/services/hyrax/listeners/trophy_cleanup_listener.rb +3 -0
- data/app/services/hyrax/listeners/workflow_listener.rb +3 -1
- data/app/services/hyrax/listeners.rb +8 -0
- data/app/services/hyrax/location_service.rb +33 -0
- data/app/services/hyrax/multiple_membership_checker.rb +44 -1
- data/app/services/hyrax/permission_manager.rb +4 -4
- data/app/services/hyrax/resource_visibility_propagator.rb +1 -1
- data/app/services/hyrax/restriction_service.rb +4 -0
- data/app/services/hyrax/simple_schema_loader.rb +5 -1
- data/app/services/hyrax/solr_query_service.rb +12 -7
- data/app/services/hyrax/solr_service.rb +1 -1
- data/app/services/hyrax/statistics/collections/over_time.rb +2 -1
- data/app/services/hyrax/statistics/users/over_time.rb +8 -5
- data/app/services/hyrax/statistics/works/over_time.rb +10 -0
- data/app/services/hyrax/thumbnail_path_service.rb +1 -1
- data/app/services/hyrax/work_uploads_handler.rb +2 -9
- data/app/services/hyrax/workflow/abstract_notification.rb +2 -2
- data/app/services/hyrax/workflow/action_taken_service.rb +16 -4
- data/app/services/hyrax/workflow/activate_object.rb +5 -4
- data/app/services/hyrax/workflow/changes_required_notification.rb +5 -4
- data/app/services/hyrax/workflow/deactivate_object.rb +7 -5
- data/app/services/hyrax/workflow/deposited_notification.rb +8 -4
- data/app/services/hyrax/workflow/grant_edit_to_depositor.rb +7 -3
- data/app/services/hyrax/workflow/grant_read_to_depositor.rb +10 -3
- data/app/services/hyrax/workflow/revoke_edit_from_depositor.rb +8 -2
- data/app/services/hyrax/workflow/workflow_action_service.rb +4 -1
- data/app/validators/hyrax/collection_membership_validator.rb +38 -0
- data/app/views/catalog/_index_header_list_hyrax_pcdm_collection.html.erb +4 -0
- data/app/views/hyrax/admin/admin_sets/_form.html.erb +1 -1
- data/app/views/hyrax/admin/admin_sets/_form_participant_table.html.erb +2 -2
- data/app/views/hyrax/admin/admin_sets/_form_participants.html.erb +2 -2
- data/app/views/hyrax/admin/admin_sets/_form_visibility.html.erb +2 -2
- data/app/views/hyrax/admin/admin_sets/_form_workflow.erb +1 -1
- data/app/views/hyrax/admin/analytics/_date_range_form.html.erb +11 -0
- data/app/views/hyrax/admin/analytics/collection_reports/_custom_range.html.erb +39 -0
- data/app/views/hyrax/admin/analytics/collection_reports/_monthly_summary.html.erb +48 -0
- data/app/views/hyrax/admin/analytics/collection_reports/_summary.html.erb +55 -0
- data/app/views/hyrax/admin/analytics/collection_reports/_top_collections.html.erb +55 -0
- data/app/views/hyrax/admin/analytics/collection_reports/index.html.erb +70 -0
- data/app/views/hyrax/admin/analytics/collection_reports/show.html.erb +94 -0
- data/app/views/hyrax/admin/analytics/work_reports/_custom_range.html.erb +43 -0
- data/app/views/hyrax/admin/analytics/work_reports/_monthly_summary.html.erb +35 -0
- data/app/views/hyrax/admin/analytics/work_reports/_summary.html.erb +60 -0
- data/app/views/hyrax/admin/analytics/work_reports/_top_file_set_downloads.html.erb +33 -0
- data/app/views/hyrax/admin/analytics/work_reports/_top_works.html.erb +40 -0
- data/app/views/hyrax/admin/analytics/work_reports/_work_counts.html.erb +18 -0
- data/app/views/hyrax/admin/analytics/work_reports/_work_files.html.erb +41 -0
- data/app/views/hyrax/admin/analytics/work_reports/index.html.erb +77 -0
- data/app/views/hyrax/admin/analytics/work_reports/show.html.erb +90 -0
- data/app/views/hyrax/admin/collection_types/index.html.erb +1 -1
- data/app/views/hyrax/admin/stats/show.html.erb +1 -1
- data/app/views/hyrax/base/_form.html.erb +1 -1
- data/app/views/hyrax/base/_form_child_work_relationships.html.erb +1 -1
- data/app/views/hyrax/base/_relationships_parent_row.html.erb +0 -1
- data/app/views/hyrax/base/show.html.erb +6 -0
- data/app/views/hyrax/collections/show.html.erb +4 -0
- data/app/views/hyrax/dashboard/_repository_growth.html.erb +5 -5
- data/app/views/hyrax/dashboard/_resource_type_graph.html.erb +41 -0
- data/app/views/hyrax/dashboard/_sidebar.html.erb +4 -1
- data/app/views/hyrax/dashboard/_tabs.html.erb +11 -0
- data/app/views/hyrax/dashboard/_user_activity.html.erb +17 -23
- data/app/views/hyrax/dashboard/_user_activity_graph.html.erb +55 -0
- data/app/views/hyrax/dashboard/_visibility_graph.html.erb +31 -0
- data/app/views/hyrax/dashboard/_work_type_graph.html.erb +41 -0
- data/app/views/hyrax/dashboard/collections/_collection_title.html.erb +1 -1
- data/app/views/hyrax/dashboard/collections/_default_group.html.erb +2 -2
- data/app/views/hyrax/dashboard/collections/_form.html.erb +24 -17
- data/app/views/hyrax/dashboard/collections/_form_discovery.html.erb +6 -3
- data/app/views/hyrax/dashboard/collections/_form_share.html.erb +2 -2
- data/app/views/hyrax/dashboard/collections/_form_share_table.html.erb +3 -3
- data/app/views/hyrax/dashboard/collections/_list_collections.html.erb +2 -2
- data/app/views/hyrax/dashboard/collections/_sort_and_per_page.html.erb +1 -1
- data/app/views/hyrax/dashboard/show_admin.html.erb +24 -45
- data/app/views/hyrax/dashboard/sidebar/_activity.html.erb +22 -0
- data/app/views/hyrax/dashboard/works/_default_group.html.erb +1 -1
- data/app/views/hyrax/dashboard/works/_list_works.html.erb +1 -1
- data/app/views/hyrax/file_sets/_actions.html.erb +4 -3
- data/app/views/hyrax/file_sets/show.html.erb +6 -0
- data/app/views/hyrax/homepage/index.html.erb +1 -1
- data/app/views/hyrax/my/_work_action_menu.html.erb +8 -9
- data/app/views/hyrax/my/collections/_default_group.html.erb +2 -2
- data/app/views/hyrax/my/collections/_list_collections.html.erb +2 -2
- data/app/views/hyrax/my/collections/_modal_collection_types_to_create.html.erb +1 -1
- data/app/views/hyrax/my/collections/index.html.erb +4 -3
- data/app/views/hyrax/my/works/_default_group.html.erb +1 -1
- data/app/views/hyrax/my/works/_list_works.html.erb +1 -2
- data/app/views/hyrax/my/works/index.html.erb +4 -2
- data/app/views/hyrax/stats/_downloads.html.erb +18 -0
- data/app/views/hyrax/stats/_pageviews.html.erb +18 -0
- data/app/views/hyrax/stats/work.html.erb +17 -9
- data/app/views/layouts/_head_tag_content.html.erb +7 -2
- data/app/views/layouts/hyrax/dashboard.html.erb +1 -0
- data/app/views/layouts/hyrax.html.erb +1 -0
- data/app/views/{_ga.html.erb → shared/_ga.html.erb} +3 -7
- data/app/views/shared/_matomo.html.erb +15 -0
- data/app/views/shared/_read_only.html.erb +5 -0
- data/chart/hyrax/Chart.yaml +2 -2
- data/chart/hyrax/README.md +22 -1
- data/chart/hyrax/templates/deployment.yaml +6 -0
- data/chart/hyrax/values.yaml +1 -1
- data/config/features.rb +3 -0
- data/config/i18n-tasks.yml +2 -2
- data/config/initializers/1_healthz.rb +1 -0
- data/config/initializers/listeners.rb +5 -5
- data/config/locales/hyrax.de.yml +200 -5
- data/config/locales/hyrax.en.yml +202 -21
- data/config/locales/hyrax.es.yml +204 -9
- data/config/locales/hyrax.fr.yml +196 -1
- data/config/locales/hyrax.it.yml +197 -2
- data/config/locales/hyrax.pt-BR.yml +196 -1
- data/config/locales/hyrax.zh.yml +196 -1
- data/config/metadata/basic_metadata.yaml +2 -0
- data/config/metadata/core_metadata.yaml +1 -1
- data/config/routes.rb +4 -0
- data/db/seeds.rb +1 -1
- data/docker-compose.yml +48 -42
- data/documentation/developing-your-hyrax-based-app.md +2 -2
- data/documentation/legacyREADME.md +1 -1
- data/hyrax.gemspec +4 -2
- data/lib/generators/hyrax/templates/catalog_controller.rb +3 -1
- data/lib/generators/hyrax/templates/config/analytics.yml +13 -7
- data/lib/generators/hyrax/templates/config/initializers/hyrax.rb +10 -13
- data/lib/generators/hyrax/templates/db/migrate/20211130181150_create_default_administrative_set.rb.erb +8 -0
- data/lib/generators/hyrax/work/templates/feature_spec.rb.erb +4 -2
- data/lib/generators/hyrax/work_resource/templates/indexer_spec.rb.erb +1 -0
- data/lib/hyrax/administrative_set_name.rb +18 -0
- data/lib/hyrax/collection_name.rb +8 -2
- data/lib/hyrax/configuration.rb +104 -4
- data/lib/hyrax/controlled_vocabularies/location.rb +9 -2
- data/lib/hyrax/controlled_vocabularies/resource_label_caching.rb +42 -0
- data/lib/hyrax/controlled_vocabularies.rb +1 -0
- data/lib/hyrax/engine.rb +7 -6
- data/lib/hyrax/form_fields.rb +1 -0
- data/lib/hyrax/publisher.rb +61 -0
- data/lib/hyrax/resource_sync/change_list_writer.rb +2 -2
- data/lib/hyrax/resource_sync/resource_list_writer.rb +2 -2
- data/lib/hyrax/specs/capybara.rb +1 -1
- data/lib/hyrax/specs/shared_specs/hydra_works.rb +13 -4
- data/lib/hyrax/specs/shared_specs/indexers.rb +120 -0
- data/lib/hyrax/transactions/admin_set_create.rb +23 -0
- data/lib/hyrax/transactions/admin_set_destroy.rb +22 -0
- data/lib/hyrax/transactions/admin_set_update.rb +21 -0
- data/lib/hyrax/transactions/collection_create.rb +25 -0
- data/lib/hyrax/transactions/collection_destroy.rb +22 -0
- data/lib/hyrax/transactions/collection_update.rb +21 -0
- data/lib/hyrax/transactions/container.rb +118 -17
- data/lib/hyrax/transactions/create_work.rb +3 -0
- data/lib/hyrax/transactions/destroy_work.rb +3 -0
- data/lib/hyrax/transactions/steps/add_to_collections.rb +13 -1
- data/lib/hyrax/transactions/steps/apply_collection_permission_template.rb +2 -0
- data/lib/hyrax/transactions/steps/apply_collection_type_permissions.rb +29 -0
- data/lib/hyrax/transactions/steps/apply_permission_template.rb +2 -0
- data/lib/hyrax/transactions/steps/apply_visibility.rb +2 -0
- data/lib/hyrax/transactions/steps/change_depositor.rb +46 -0
- data/lib/hyrax/transactions/steps/check_for_empty_admin_set.rb +36 -0
- data/lib/hyrax/transactions/steps/delete_access_control.rb +32 -0
- data/lib/hyrax/transactions/steps/delete_resource.rb +19 -3
- data/lib/hyrax/transactions/steps/destroy_work.rb +3 -1
- data/lib/hyrax/transactions/steps/ensure_permission_template.rb +2 -0
- data/lib/hyrax/transactions/steps/save.rb +37 -7
- data/lib/hyrax/transactions/steps/save_access_control.rb +2 -2
- data/lib/hyrax/transactions/steps/save_work.rb +3 -0
- data/lib/hyrax/transactions/steps/set_collection_type_gid.rb +35 -0
- data/lib/hyrax/transactions/steps/set_user_as_creator.rb +41 -0
- data/lib/hyrax/transactions/steps/update_work_members.rb +51 -0
- data/lib/hyrax/transactions/update_work.rb +4 -3
- data/lib/hyrax/transactions/work_create.rb +1 -1
- data/lib/hyrax/transactions/work_destroy.rb +2 -1
- data/lib/hyrax/transactions/work_update.rb +19 -0
- data/lib/hyrax/version.rb +1 -1
- data/lib/tasks/default_admin_set.rake +12 -11
- data/lib/tasks/regenerate_derivatives.rake +1 -1
- data/lib/wings/attribute_transformer.rb +5 -1
- data/lib/wings/setup.rb +18 -1
- data/lib/wings/valkyrie/persister.rb +16 -0
- data/lib/wings/valkyrie/query_service.rb +2 -1
- data/lib/wings/valkyrie/storage.rb +7 -1
- data/template.rb +1 -1
- data/vendor/assets/javascripts/morris/morris.min.js +1 -7
- data/vendor/assets/stylesheets/morris.js/0.5.1/morris.css +1 -1
- metadata +121 -17
- data/app/views/hyrax/dashboard/_repository_objects.html.erb +0 -28
@@ -143,7 +143,7 @@ module Hyrax
|
|
143
143
|
def groups_for(mode:)
|
144
144
|
Enumerator.new do |yielder|
|
145
145
|
acl.permissions.each do |permission|
|
146
|
-
next unless permission.mode == mode
|
146
|
+
next unless permission.mode.to_sym == mode
|
147
147
|
next unless permission.agent.starts_with?(Hyrax::Group.name_prefix)
|
148
148
|
yielder << permission.agent.gsub(Hyrax::Group.name_prefix, '')
|
149
149
|
end
|
@@ -154,7 +154,7 @@ module Hyrax
|
|
154
154
|
groups = groups.map(&:to_s)
|
155
155
|
|
156
156
|
acl.permissions.each do |permission|
|
157
|
-
next unless permission.mode == mode
|
157
|
+
next unless permission.mode.to_sym == mode
|
158
158
|
next unless permission.agent.starts_with?(Hyrax::Group.name_prefix)
|
159
159
|
|
160
160
|
group_name = permission.agent.gsub(Hyrax::Group.name_prefix, '')
|
@@ -175,7 +175,7 @@ module Hyrax
|
|
175
175
|
end
|
176
176
|
|
177
177
|
acl.permissions.each do |permission|
|
178
|
-
next unless permission.mode == mode
|
178
|
+
next unless permission.mode.to_sym == mode
|
179
179
|
next if permission.agent.starts_with?(Hyrax::Group.name_prefix)
|
180
180
|
next if users.include? permission.agent
|
181
181
|
|
@@ -189,7 +189,7 @@ module Hyrax
|
|
189
189
|
def users_for(mode:)
|
190
190
|
Enumerator.new do |yielder|
|
191
191
|
acl.permissions.each do |permission|
|
192
|
-
next unless permission.mode == mode
|
192
|
+
next unless permission.mode.to_sym == mode
|
193
193
|
next if permission.agent.starts_with?(Hyrax::Group.name_prefix)
|
194
194
|
yielder << permission.agent
|
195
195
|
end
|
@@ -39,7 +39,7 @@ module Hyrax
|
|
39
39
|
#
|
40
40
|
# @raise [RuntimeError] if visibility propagation fails
|
41
41
|
def propagate
|
42
|
-
queries.
|
42
|
+
queries.find_child_file_sets(resource: source).each do |file_set|
|
43
43
|
file_set.visibility = source.visibility
|
44
44
|
embargo_manager.copy_embargo_to(target: file_set)
|
45
45
|
lease_manager.copy_lease_to(target: file_set)
|
@@ -76,7 +76,11 @@ module Hyrax
|
|
76
76
|
##
|
77
77
|
# @return [Dry::Types::Type]
|
78
78
|
def type
|
79
|
-
collection_type = config['multiple']
|
79
|
+
collection_type = if config['multiple']
|
80
|
+
Valkyrie::Types::Array.constructor { |v| Array(v).select(&:present?) }
|
81
|
+
else
|
82
|
+
Identity
|
83
|
+
end
|
80
84
|
collection_type.of(type_for(config['type']))
|
81
85
|
end
|
82
86
|
|
@@ -59,10 +59,11 @@ module Hyrax
|
|
59
59
|
end
|
60
60
|
|
61
61
|
##
|
62
|
+
# @param join_with [String] the connector (eg. 'AND', 'OR') used to join each clause (default: 'AND')
|
62
63
|
# @return [String] the combined query that can be submitted to solr
|
63
|
-
def build
|
64
|
+
def build(join_with: 'AND')
|
64
65
|
return 'id:NEVER_USE_THIS_ID' if @query.blank? # forces this method to always return a valid solr query
|
65
|
-
@query.join(
|
66
|
+
@query.join(padded_join_with(join_with))
|
66
67
|
end
|
67
68
|
|
68
69
|
##
|
@@ -106,8 +107,8 @@ module Hyrax
|
|
106
107
|
|
107
108
|
##
|
108
109
|
# @param field_pairs [Hash] a list of pairs of property name and values (e.g. { field1: values, field2: values })
|
109
|
-
# @param join_with [String] the connector used to join the field pairs (default: '
|
110
|
-
# @param type [String] type of query to run.
|
110
|
+
# @param join_with [String] the connector (eg. 'AND', 'OR') used to join the field pairs (default: 'AND')
|
111
|
+
# @param type [String] type of query to run (e.g. 'raw', 'field', 'terms') (default: 'field')
|
111
112
|
# @return [SolrQueryService] the existing service with field_pair query appended
|
112
113
|
def with_field_pairs(field_pairs: {}, join_with: default_join_with, type: 'field')
|
113
114
|
pairs_query = construct_query_for_pairs(field_pairs, join_with, type)
|
@@ -140,7 +141,7 @@ module Hyrax
|
|
140
141
|
|
141
142
|
# Construct a solr query from a list of pairs (e.g. { field1: values, field2: values })
|
142
143
|
# @param [Hash] field_pairs a list of pairs of property name and values
|
143
|
-
# @param [String] join_with the value we're joining the clauses with (default: '
|
144
|
+
# @param [String] join_with the value (e.g. 'AND', 'OR') we're joining the clauses with (default: 'AND')
|
144
145
|
# @param [String] type of query to run. Either 'raw' or 'field' (default: 'field')
|
145
146
|
# @return [String] a solr query
|
146
147
|
# @example
|
@@ -150,7 +151,7 @@ module Hyrax
|
|
150
151
|
clauses = pairs_to_clauses(field_pairs, type)
|
151
152
|
return "" if clauses.count.zero?
|
152
153
|
return clauses.first if clauses.count == 1
|
153
|
-
"(#{clauses.join(join_with)})"
|
154
|
+
"(#{clauses.join(padded_join_with(join_with))})"
|
154
155
|
end
|
155
156
|
|
156
157
|
# Construct a solr query from the model (e.g. Collection, Monograph)
|
@@ -184,7 +185,11 @@ module Hyrax
|
|
184
185
|
end
|
185
186
|
|
186
187
|
def default_join_with
|
187
|
-
'
|
188
|
+
'AND'
|
189
|
+
end
|
190
|
+
|
191
|
+
def padded_join_with(join_with)
|
192
|
+
" #{join_with.strip} "
|
188
193
|
end
|
189
194
|
|
190
195
|
# @param [Array<Array>] pairs a list of (key, value) pairs. The value itself may
|
@@ -8,9 +8,8 @@ module Hyrax
|
|
8
8
|
Enumerator.new(size) do |y|
|
9
9
|
x = @x_min
|
10
10
|
while x <= @x_max
|
11
|
-
|
11
|
+
y.yield [@x_output.call(x), point(x)]
|
12
12
|
x += @delta_x.days
|
13
|
-
y.yield [@x_output.call(x), point(bottom, x)]
|
14
13
|
end
|
15
14
|
end
|
16
15
|
end
|
@@ -21,9 +20,13 @@ module Hyrax
|
|
21
20
|
::User.registered
|
22
21
|
end
|
23
22
|
|
24
|
-
#
|
25
|
-
def query(
|
26
|
-
{ created_at:
|
23
|
+
# Overridden to search one day at a time
|
24
|
+
def query(date_string)
|
25
|
+
{ created_at: date_string.to_date.beginning_of_day..date_string.to_date.end_of_day }
|
26
|
+
end
|
27
|
+
|
28
|
+
def point(date_string)
|
29
|
+
relation.where(query(date_string)).count
|
27
30
|
end
|
28
31
|
end
|
29
32
|
end
|
@@ -3,6 +3,16 @@ module Hyrax
|
|
3
3
|
module Statistics
|
4
4
|
module Works
|
5
5
|
class OverTime < Statistics::OverTime
|
6
|
+
def points
|
7
|
+
Enumerator.new(size) do |y|
|
8
|
+
x = @x_min
|
9
|
+
while x <= @x_max
|
10
|
+
y.yield [@x_output.call(x), point(@x_min, x)]
|
11
|
+
x += @delta_x.days
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
6
16
|
private
|
7
17
|
|
8
18
|
def relation
|
@@ -114,8 +114,8 @@ module Hyrax
|
|
114
114
|
file_set.permission_manager.acl.save if file_set.permission_manager.acl.pending_changes?
|
115
115
|
append_to_work(file_set)
|
116
116
|
|
117
|
-
|
118
|
-
|
117
|
+
ValkyrieIngestJob.perform_later(file)
|
118
|
+
|
119
119
|
{ file_set: file_set, user: file.user }
|
120
120
|
end
|
121
121
|
|
@@ -160,13 +160,6 @@ module Hyrax
|
|
160
160
|
@target_permissions ||= Hyrax::AccessControlList.new(resource: work)
|
161
161
|
end
|
162
162
|
|
163
|
-
##
|
164
|
-
# @api private
|
165
|
-
# @return [JobIoWrapper]
|
166
|
-
def wrap_file(file, file_set)
|
167
|
-
JobIoWrapper.create_with_varied_file_handling!(user: file.user, file: file, relation: :original_file, file_set: file_set)
|
168
|
-
end
|
169
|
-
|
170
163
|
##
|
171
164
|
# @api private
|
172
165
|
#
|
@@ -39,9 +39,9 @@ module Hyrax
|
|
39
39
|
# @option recipients [Array<Hyrax::User>] :to a list of users to which to send the notification
|
40
40
|
# @option recipients [Array<Hyrax::User>] :cc a list of users to which to copy on the notification
|
41
41
|
def initialize(entity, comment, user, recipients)
|
42
|
-
@work_id = entity.
|
42
|
+
@work_id = entity.proxy_for.id
|
43
43
|
@title = entity.proxy_for.title.first
|
44
|
-
@comment = comment
|
44
|
+
@comment = comment&.comment.to_s
|
45
45
|
# Convert to hash with indifferent access to allow both string and symbol keys
|
46
46
|
@recipients = recipients.with_indifferent_access
|
47
47
|
@user = user
|
@@ -14,7 +14,14 @@ module Hyrax
|
|
14
14
|
end
|
15
15
|
|
16
16
|
def initialize(target:, action:, comment:, user:)
|
17
|
-
@target =
|
17
|
+
@target =
|
18
|
+
case target
|
19
|
+
when Valkyrie::Resource
|
20
|
+
Hyrax::ChangeSet.for(target)
|
21
|
+
else
|
22
|
+
target
|
23
|
+
end
|
24
|
+
|
18
25
|
@action = action
|
19
26
|
@comment = comment
|
20
27
|
@user = user
|
@@ -70,10 +77,15 @@ module Hyrax
|
|
70
77
|
# @api private
|
71
78
|
def save_target
|
72
79
|
case target
|
73
|
-
when
|
74
|
-
target.
|
80
|
+
when Valkyrie::ChangeSet
|
81
|
+
return target.model unless target.changed?
|
82
|
+
|
83
|
+
Hyrax::Transactions::Container['change_set.apply']
|
84
|
+
.with_step_args('change_set.save' => { user: user })
|
85
|
+
.call(target)
|
86
|
+
.value!
|
75
87
|
else
|
76
|
-
|
88
|
+
target.save
|
77
89
|
end
|
78
90
|
end
|
79
91
|
end
|
@@ -3,14 +3,15 @@ module Hyrax
|
|
3
3
|
module Workflow
|
4
4
|
module ActivateObject
|
5
5
|
##
|
6
|
-
# This is a built in function for workflow, setting the
|
7
|
-
# of the target to the Fedora
|
6
|
+
# This is a built in function for workflow, setting the +#state+
|
7
|
+
# of the target to the Fedora +active+ status URI
|
8
8
|
#
|
9
|
-
# @param target [#state] an instance of a model
|
9
|
+
# @param target [#state] an instance of a model with a +#state+ property;
|
10
|
+
# e.g. a {Hyrax::Work}
|
10
11
|
#
|
11
12
|
# @return [RDF::Vocabulary::Term] the Fedora Resource Status 'active' term
|
12
13
|
def self.call(target:, **)
|
13
|
-
target.state =
|
14
|
+
target.state = Hyrax::ResourceStatus::ACTIVE
|
14
15
|
end
|
15
16
|
end
|
16
17
|
end
|
@@ -9,14 +9,15 @@ module Hyrax
|
|
9
9
|
end
|
10
10
|
|
11
11
|
def message
|
12
|
-
I18n.t('hyrax.notifications.workflow.changes_required.message',
|
13
|
-
|
14
|
-
|
12
|
+
I18n.t('hyrax.notifications.workflow.changes_required.message',
|
13
|
+
title: title,
|
14
|
+
link: (link_to work_id, document_path),
|
15
|
+
comment: comment)
|
15
16
|
end
|
16
17
|
|
17
18
|
def users_to_notify
|
18
19
|
user_key = document.depositor
|
19
|
-
super << ::User.
|
20
|
+
super << ::User.find_by_user_key(user_key)
|
20
21
|
end
|
21
22
|
end
|
22
23
|
end
|
@@ -2,15 +2,17 @@
|
|
2
2
|
module Hyrax
|
3
3
|
module Workflow
|
4
4
|
##
|
5
|
-
# This is a built in function for workflow, setting the
|
6
|
-
# of the target to the Fedora
|
5
|
+
# This is a built in function for workflow, setting the +#state+
|
6
|
+
# of the target to the Fedora +inactive+ status URI
|
7
7
|
#
|
8
|
-
# @param target [#state] an instance of a model
|
8
|
+
# @param target [#state] an instance of a model with a +#state+ property;
|
9
|
+
# e.g. a {Hyrax::Work}
|
9
10
|
#
|
10
|
-
# @return [RDF::
|
11
|
+
# @return [RDF::URI] the Fedora Resource Status 'inactive' term
|
12
|
+
# @see Hyrax::ResourceStatus
|
11
13
|
module DeactivateObject
|
12
14
|
def self.call(target:, **)
|
13
|
-
target.state =
|
15
|
+
target.state = Hyrax::ResourceStatus::INACTIVE
|
14
16
|
end
|
15
17
|
end
|
16
18
|
end
|
@@ -9,13 +9,17 @@ module Hyrax
|
|
9
9
|
end
|
10
10
|
|
11
11
|
def message
|
12
|
-
I18n.t('hyrax.notifications.workflow.deposited.message',
|
13
|
-
|
12
|
+
I18n.t('hyrax.notifications.workflow.deposited.message',
|
13
|
+
title: title,
|
14
|
+
link: (link_to work_id, document_path),
|
15
|
+
user: user.user_key,
|
16
|
+
comment: comment)
|
14
17
|
end
|
15
18
|
|
16
19
|
def users_to_notify
|
17
|
-
user_key =
|
18
|
-
|
20
|
+
user_key = @entity.proxy_for.depositor
|
21
|
+
|
22
|
+
super << ::User.find_by_user_key(user_key)
|
19
23
|
end
|
20
24
|
end
|
21
25
|
end
|
@@ -1,6 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
module Hyrax
|
3
3
|
module Workflow
|
4
|
+
##
|
4
5
|
# This is a built in function for workflow, so that a workflow action can be created that
|
5
6
|
# grants the creator the ability to alter it.
|
6
7
|
module GrantEditToDepositor
|
@@ -8,11 +9,14 @@ module Hyrax
|
|
8
9
|
# @return void
|
9
10
|
def self.call(target:, **)
|
10
11
|
return true unless target.try(:depositor)
|
11
|
-
|
12
|
-
target.try(:
|
12
|
+
|
13
|
+
model = target.try(:model) || target # get the model if target is a ChangeSet
|
14
|
+
model.edit_users = model.edit_users.to_a + Array.wrap(target.depositor) # += works in Ruby 2.6+
|
15
|
+
model.try(:permission_manager)&.acl&.save
|
16
|
+
|
13
17
|
# If there are a lot of members, granting access to each could take a
|
14
18
|
# long time. Do this work in the background.
|
15
|
-
GrantEditToMembersJob.perform_later(
|
19
|
+
GrantEditToMembersJob.perform_later(model, target.depositor)
|
16
20
|
end
|
17
21
|
end
|
18
22
|
end
|
@@ -1,16 +1,23 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
module Hyrax
|
3
3
|
module Workflow
|
4
|
+
##
|
4
5
|
# This is a built in function for workflow, so that a workflow action can be created that
|
5
6
|
# grants the creator the ability to view their work.
|
6
7
|
module GrantReadToDepositor
|
7
|
-
# @param [#read_users=, #read_users] target
|
8
|
+
# @param [#read_users=, #read_users] target to which we are adding read_users
|
9
|
+
# for the depositor
|
8
10
|
# @return void
|
9
11
|
def self.call(target:, **)
|
10
|
-
|
12
|
+
return true unless target.try(:depositor)
|
13
|
+
|
14
|
+
model = target.try(:model) || target # get the model if target is a ChangeSet
|
15
|
+
model.read_users = model.read_users.to_a + Array.wrap(target.depositor) # += works in Ruby 2.6+
|
16
|
+
model.try(:permission_manager)&.acl&.save
|
17
|
+
|
11
18
|
# If there are a lot of members, granting access to each could take a
|
12
19
|
# long time. Do this work in the background.
|
13
|
-
GrantReadToMembersJob.perform_later(
|
20
|
+
GrantReadToMembersJob.perform_later(model, target.depositor)
|
14
21
|
end
|
15
22
|
end
|
16
23
|
end
|
@@ -1,14 +1,20 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
module Hyrax
|
3
3
|
module Workflow
|
4
|
+
##
|
4
5
|
# This is a built in function for workflow, so that a workflow action can be created that
|
5
6
|
# removes the creators the ability to alter it.
|
6
7
|
module RevokeEditFromDepositor
|
7
8
|
def self.call(target:, **)
|
8
|
-
|
9
|
+
return true unless target.try(:depositor)
|
10
|
+
|
11
|
+
model = target.try(:model) || target # get the model if target is a ChangeSet
|
12
|
+
model.edit_users = model.edit_users.to_a - Array.wrap(target.depositor)
|
13
|
+
model.try(:permission_manager)&.acl&.save
|
14
|
+
|
9
15
|
# If there are a lot of members, revoking access from each could take a
|
10
16
|
# long time. Do this work in the background.
|
11
|
-
RevokeEditFromMembersJob.perform_later(
|
17
|
+
RevokeEditFromMembersJob.perform_later(model, target.depositor)
|
12
18
|
end
|
13
19
|
end
|
14
20
|
end
|
@@ -31,7 +31,8 @@ module Hyrax
|
|
31
31
|
end
|
32
32
|
|
33
33
|
def create_sipity_comment
|
34
|
-
return
|
34
|
+
return Sipity::NullComment.new(entity: subject.entity, agent: subject.agent) if
|
35
|
+
comment_text.blank?
|
35
36
|
Sipity::Comment.create!(entity: subject.entity, agent: subject.agent, comment: comment_text)
|
36
37
|
end
|
37
38
|
|
@@ -44,7 +45,9 @@ module Hyrax
|
|
44
45
|
)
|
45
46
|
end
|
46
47
|
|
48
|
+
##
|
47
49
|
# Run any configured custom methods
|
50
|
+
#
|
48
51
|
def handle_additional_sipity_workflow_action_processing(comment:)
|
49
52
|
Hyrax::Workflow::ActionTakenService.handle_action_taken(
|
50
53
|
target: subject.work,
|
@@ -0,0 +1,38 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
module Hyrax
|
3
|
+
# Validates that the record passes the multiple membership checker
|
4
|
+
class CollectionMembershipValidator < ActiveModel::Validator
|
5
|
+
def validate(record)
|
6
|
+
update_collections(record)
|
7
|
+
validation = validate_multi_membership(record)
|
8
|
+
return if validation == true
|
9
|
+
record.errors[:member_of_collection_ids] << validation
|
10
|
+
end
|
11
|
+
|
12
|
+
private
|
13
|
+
|
14
|
+
def validate_multi_membership(record)
|
15
|
+
# collections-in-collections do not have multi-membership restrictions
|
16
|
+
return true if record.is_a? Hyrax::Forms::PcdmCollectionForm
|
17
|
+
|
18
|
+
Hyrax::MultipleMembershipChecker.new(item: record).validate
|
19
|
+
end
|
20
|
+
|
21
|
+
def update_collections(record)
|
22
|
+
record.member_of_collection_ids = collections_ids(record)
|
23
|
+
record.member_of_collection_ids.uniq!
|
24
|
+
end
|
25
|
+
|
26
|
+
def collections_ids(record)
|
27
|
+
collection_ids = []
|
28
|
+
if record.member_of_collections_attributes.present?
|
29
|
+
record.member_of_collections_attributes
|
30
|
+
.each do |_k, h|
|
31
|
+
next if h["_destroy"] == "true"
|
32
|
+
collection_ids << Valkyrie::ID.new(h["id"])
|
33
|
+
end
|
34
|
+
end
|
35
|
+
collection_ids
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
@@ -26,7 +26,7 @@
|
|
26
26
|
<% if f.object.persisted? && f.object.member_ids.present? %>
|
27
27
|
<%# we're loading these values dynamically to speed page load %>
|
28
28
|
<%= f.input :thumbnail_id,
|
29
|
-
input_html: { data: { text: f.object
|
29
|
+
input_html: { data: { text: thumbnail_label_for(object: f.object) } } %>
|
30
30
|
<% end %>
|
31
31
|
|
32
32
|
</div>
|
@@ -1,6 +1,6 @@
|
|
1
1
|
<h3><%= t(".#{access}.title") %></h3>
|
2
2
|
<p><%= t(".#{access}.help") %></p>
|
3
|
-
<% if @form.
|
3
|
+
<% if collection_permission_template_form_for(form: @form).access_grants.select(&filter).any? %>
|
4
4
|
<table class="table table-striped share-status">
|
5
5
|
<thead>
|
6
6
|
<tr>
|
@@ -10,7 +10,7 @@
|
|
10
10
|
</tr>
|
11
11
|
</thead>
|
12
12
|
<tbody>
|
13
|
-
<% @form.
|
13
|
+
<% collection_permission_template_form_for(form: @form).access_grants.select(&filter).each do |g| %>
|
14
14
|
<tr>
|
15
15
|
<td data-agent="<%= g.agent_id %>"><%= g.label %></td>
|
16
16
|
<td><%= g.agent_type.titleize %></td>
|
@@ -5,7 +5,7 @@
|
|
5
5
|
<h3><%= t('.add_participants') %></h3>
|
6
6
|
<% access_options = options_for_select([['Manager', 'manage'], ['Depositor', 'deposit'], ['Viewer', 'view']]) %>
|
7
7
|
<div class="sharing-row-form">
|
8
|
-
<%= simple_form_for @form
|
8
|
+
<%= simple_form_for collection_permission_template_form_for(form: @form),
|
9
9
|
url: [hyrax, :admin, @form, :permission_template],
|
10
10
|
html: { id: 'group-participants-form', class: 'form-inline' } do |f| %>
|
11
11
|
|
@@ -33,7 +33,7 @@
|
|
33
33
|
</div>
|
34
34
|
|
35
35
|
<div class="sharing-row-form">
|
36
|
-
<%= simple_form_for @form
|
36
|
+
<%= simple_form_for collection_permission_template_form_for(form: @form),
|
37
37
|
url: [hyrax, :admin, @form, :permission_template],
|
38
38
|
html: { id: 'user-participants-form', class: 'form-inline add-users' } do |f| %>
|
39
39
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
<div id="visibility" class="tab-pane">
|
2
2
|
<div class="panel panel-default labels">
|
3
|
-
<%= simple_form_for @form
|
3
|
+
<%= simple_form_for collection_permission_template_form_for(form: @form),
|
4
4
|
url: [hyrax, :admin, @form, :permission_template],
|
5
5
|
html: { class: 'nav-safety' } do |f| %>
|
6
6
|
<div class="panel-body">
|
@@ -62,4 +62,4 @@
|
|
62
62
|
</div>
|
63
63
|
<% end %>
|
64
64
|
</div>
|
65
|
-
</div>
|
65
|
+
</div>
|
@@ -1,6 +1,6 @@
|
|
1
1
|
<div id="workflow" class="tab-pane">
|
2
2
|
<div class="panel panel-default labels">
|
3
|
-
<%= simple_form_for @form
|
3
|
+
<%= simple_form_for collection_permission_template_form_for(form: @form),
|
4
4
|
url: [hyrax, :admin, @form, :permission_template],
|
5
5
|
html: { id: 'form_workflows', class: 'nav-safety' } do |f| %>
|
6
6
|
<% if f.object.available_workflows.any? %>
|
@@ -0,0 +1,11 @@
|
|
1
|
+
<div class="panel panel-default">
|
2
|
+
<div class="panel-heading"><h4><%= t('.date_range_heading') %></h4></div>
|
3
|
+
<div class="panel-body">
|
4
|
+
<%= form_tag(redirect_path, method: :get, class: "form-inline") do %>
|
5
|
+
<%= t('.start_date') %>: <%= date_field_tag :start_date, "", class: 'datepicker form-control', placeholder: 'mm/dd/yyyy', required: true %>
|
6
|
+
<%= t('.end_date') %>: <%= date_field_tag :end_date, "", class: 'datepicker form-control', placeholder: 'mm/dd/yyyy', required: true %>
|
7
|
+
<%= submit_tag "#{t('.set_date_range')}", class: 'btn btn-primary' %>
|
8
|
+
<%= link_to "#{t('.reset_date_range')}", redirect_path if params[:start_date] %>
|
9
|
+
<% end %>
|
10
|
+
</div>
|
11
|
+
</div>
|
@@ -0,0 +1,39 @@
|
|
1
|
+
<div class="panel panel-default">
|
2
|
+
<div class="panel-heading"><h4><%= t('.summary_heading') %></h4></div>
|
3
|
+
<div class="panel-body">
|
4
|
+
<table class="table table-striped">
|
5
|
+
<thead>
|
6
|
+
<tr>
|
7
|
+
<th> </th>
|
8
|
+
<th><%= @start_date.to_date.strftime("%B %d, %Y") %> through <%= @end_date.to_date.strftime("%B %d, %Y") %></th>
|
9
|
+
</tr>
|
10
|
+
</thead>
|
11
|
+
<tbody>
|
12
|
+
<% if @pageviews %>
|
13
|
+
<tr>
|
14
|
+
<td><b><%= t('.collection_home_page_views') %></b></td>
|
15
|
+
<td><%= @pageviews.range(@start_date.to_date, @end_date.to_date) %></td>
|
16
|
+
</tr>
|
17
|
+
<% end %>
|
18
|
+
<% if @work_page_views %>
|
19
|
+
<tr>
|
20
|
+
<td><b><%= t('.work_views') %></b></td>
|
21
|
+
<td><%= @work_page_views.range(@start_date.to_date, @end_date.to_date) %></td>
|
22
|
+
</tr>
|
23
|
+
<% end %>
|
24
|
+
<% if @downloads %>
|
25
|
+
<tr>
|
26
|
+
<td><b><%= t('.work_downloads') %></b></td>
|
27
|
+
<td><%= @downloads.range(@start_date.to_date, @end_date.to_date) %></td>
|
28
|
+
</tr>
|
29
|
+
<% end %>
|
30
|
+
</tbody>
|
31
|
+
</table>
|
32
|
+
</div>
|
33
|
+
</div>
|
34
|
+
|
35
|
+
<% if params[:start_date] %>
|
36
|
+
<% if @top_collections %>
|
37
|
+
<%= render 'top_collections' %>
|
38
|
+
<% end %>
|
39
|
+
<% end %>
|