hyrax 2.1.0.beta1 → 2.1.0.beta2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +9 -49
- data/.rubocop_fixme.yml +1 -0
- data/.travis.yml +1 -1
- data/Gemfile +3 -3
- data/README.md +4 -2
- data/app/actors/hyrax/actors/file_set_actor.rb +0 -1
- data/app/actors/hyrax/actors/interpret_visibility_actor.rb +1 -3
- data/app/actors/hyrax/actors/model_actor.rb +4 -0
- data/app/assets/javascripts/hyrax.js +1 -1
- data/app/assets/javascripts/hyrax/app.js.erb +1 -1
- data/app/assets/javascripts/hyrax/authority_select.es6 +15 -7
- data/app/assets/javascripts/hyrax/collections.js +188 -9
- data/app/assets/javascripts/hyrax/content_blocks.js +13 -1
- data/app/assets/javascripts/hyrax/editor.es6 +2 -1
- data/app/assets/javascripts/hyrax/proxy_rights.js +2 -2
- data/app/assets/javascripts/hyrax/turbolinks_events.js +5 -0
- data/app/assets/stylesheets/hyrax/_accessibility.scss +21 -0
- data/app/assets/stylesheets/hyrax/_catalog.scss +21 -16
- data/app/assets/stylesheets/hyrax/_collections.scss +48 -7
- data/app/assets/stylesheets/hyrax/_modal.scss +4 -0
- data/app/assets/stylesheets/hyrax/_settings.scss +1 -1
- data/app/assets/stylesheets/hyrax/dashboard.scss +0 -1
- data/app/controllers/concerns/hyrax/breadcrumbs.rb +3 -1
- data/app/controllers/concerns/hyrax/embargoes_controller_behavior.rb +17 -1
- data/app/controllers/concerns/hyrax/leases_controller_behavior.rb +10 -0
- data/app/controllers/concerns/hyrax/local_file_downloads_controller_behavior.rb +86 -0
- data/app/controllers/concerns/hyrax/works_controller_behavior.rb +14 -11
- data/app/controllers/hyrax/admin/collection_types_controller.rb +11 -1
- data/app/controllers/hyrax/api/items_controller.rb +2 -6
- data/app/controllers/hyrax/batch_edits_controller.rb +6 -0
- data/app/controllers/hyrax/batch_uploads_controller.rb +1 -1
- data/app/controllers/hyrax/dashboard/collections_controller.rb +4 -7
- data/app/controllers/hyrax/dashboard/profiles_controller.rb +2 -0
- data/app/controllers/hyrax/dashboard_controller.rb +2 -2
- data/app/controllers/hyrax/depositors_controller.rb +19 -0
- data/app/controllers/hyrax/downloads_controller.rb +3 -4
- data/app/controllers/hyrax/embargoes_controller.rb +2 -0
- data/app/controllers/hyrax/file_sets_controller.rb +12 -0
- data/app/controllers/hyrax/leases_controller.rb +2 -0
- data/app/controllers/hyrax/my/works_controller.rb +9 -0
- data/app/controllers/hyrax/my_controller.rb +0 -1
- data/app/controllers/hyrax/transfers_controller.rb +1 -3
- data/app/controllers/hyrax/users_controller.rb +1 -3
- data/app/forms/hyrax/forms/admin/collection_type_form.rb +1 -1
- data/app/forms/hyrax/forms/permission_template_form.rb +1 -4
- data/app/forms/hyrax/forms/work_form.rb +1 -3
- data/app/helpers/hyrax/citations_behaviors/common_behavior.rb +1 -3
- data/app/helpers/hyrax/citations_behaviors/formatters/chicago_formatter.rb +1 -5
- data/app/helpers/hyrax/collections_helper.rb +7 -4
- data/app/helpers/hyrax/file_set_helper.rb +0 -1
- data/app/helpers/hyrax/hyrax_helper_behavior.rb +0 -1
- data/app/helpers/hyrax/trophy_helper.rb +0 -1
- data/app/indexers/hyrax/admin_set_indexer.rb +2 -0
- data/app/inputs/multi_value_select_input.rb +1 -3
- data/app/jobs/attach_files_to_work_job.rb +5 -1
- data/app/jobs/import_url_job.rb +9 -8
- data/app/models/admin_set.rb +1 -5
- data/app/models/concerns/hyrax/ability.rb +3 -4
- data/app/models/concerns/hyrax/collection_behavior.rb +0 -4
- data/app/models/concerns/hyrax/collection_nesting.rb +12 -0
- data/app/models/concerns/hyrax/suppressible.rb +1 -5
- data/app/models/featured_work_list.rb +1 -3
- data/app/models/hyrax/collection_type.rb +3 -2
- data/app/models/hyrax/permission_template_access.rb +6 -4
- data/app/models/proxy_deposit_request.rb +1 -1
- data/app/presenters/hyrax/collection_presenter.rb +0 -24
- data/app/presenters/hyrax/displays_image.rb +1 -1
- data/app/presenters/hyrax/file_set_presenter.rb +1 -1
- data/app/presenters/hyrax/menu_presenter.rb +1 -1
- data/app/presenters/hyrax/work_show_presenter.rb +15 -10
- data/app/search_builders/hyrax/abstract_type_relation.rb +2 -1
- data/app/search_builders/hyrax/collection_member_search_builder.rb +1 -1
- data/app/search_builders/hyrax/dashboard/collections_search_builder.rb +3 -1
- data/app/search_builders/hyrax/parent_collection_search_builder.rb +2 -2
- data/app/services/hyrax/admin_set_create_service.rb +1 -3
- data/app/services/hyrax/analytics.rb +1 -3
- data/app/services/hyrax/collection_member_service.rb +6 -5
- data/app/services/hyrax/collection_types/create_service.rb +37 -10
- data/app/services/hyrax/collections/permissions_create_service.rb +1 -3
- data/app/services/hyrax/collections/permissions_service.rb +6 -4
- data/app/views/catalog/_index_header_list_collection.html.erb +1 -1
- data/app/views/catalog/_index_header_list_default.html.erb +1 -1
- data/app/views/catalog/_index_list_default.html.erb +6 -10
- data/app/views/catalog/_search_form.html.erb +10 -11
- data/app/views/catalog/_thumbnail_list_collection.html.erb +1 -1
- data/app/views/catalog/_thumbnail_list_default.html.erb +1 -1
- data/app/views/hyrax/admin/admin_sets/_form.html.erb +1 -1
- data/app/views/hyrax/admin/admin_sets/_form_participant_table.html.erb +1 -1
- data/app/views/hyrax/admin/admin_sets/_form_participants.html.erb +1 -1
- data/app/views/hyrax/admin/admin_sets/_form_visibility.html.erb +3 -3
- data/app/views/hyrax/admin/admin_sets/_show_document_list_row.html.erb +2 -2
- data/app/views/hyrax/admin/admin_sets/index.html.erb +1 -1
- data/app/views/hyrax/admin/appearances/show.html.erb +4 -4
- data/app/views/hyrax/admin/collection_types/_form_settings.html.erb +3 -2
- data/app/views/hyrax/admin/collection_types/index.html.erb +2 -2
- data/app/views/hyrax/admin/features/index.html.erb +2 -4
- data/app/views/hyrax/admin/stats/_date_form.html.erb +3 -3
- data/app/views/hyrax/admin/stats/_top_data.html.erb +1 -1
- data/app/views/hyrax/admin/stats/show.html.erb +1 -1
- data/app/views/hyrax/admin/workflows/index.html.erb +0 -1
- data/app/views/hyrax/base/_file_manager_actions.html.erb +2 -2
- data/app/views/hyrax/base/_file_manager_member.html.erb +1 -1
- data/app/views/hyrax/base/_form_child_work_relationships.html.erb +1 -2
- data/app/views/hyrax/base/_form_files.html.erb +3 -3
- data/app/views/hyrax/base/_form_member_of_collections.html.erb +1 -2
- data/app/views/hyrax/base/_form_progress.html.erb +3 -3
- data/app/views/hyrax/base/_form_relationships.html.erb +2 -3
- data/app/views/hyrax/base/_form_representative.html.erb +0 -1
- data/app/views/hyrax/base/_form_share.html.erb +1 -3
- data/app/views/hyrax/base/_form_thumbnail.html.erb +0 -1
- data/app/views/hyrax/base/_form_visibility_component.html.erb +6 -6
- data/app/views/hyrax/base/_relationships_parent_rows.html.erb +3 -1
- data/app/views/hyrax/base/_representative_media.html.erb +1 -1
- data/app/views/hyrax/base/_share_with.html.erb +3 -3
- data/app/views/hyrax/base/_show_actions.html.erb +14 -1
- data/app/views/hyrax/base/_social_media.html.erb +5 -5
- data/app/views/hyrax/base/_work_title.erb +3 -1
- data/app/views/hyrax/base/_workflow_actions.html.erb +1 -1
- data/app/views/hyrax/base/inspect_work.html.erb +1 -1
- data/app/views/hyrax/base/show.html.erb +2 -2
- data/app/views/hyrax/batch_edits/_check_all.html.erb +2 -2
- data/app/views/hyrax/batch_edits/edit.html.erb +47 -44
- data/app/views/hyrax/batch_select/_add_button.html.erb +2 -2
- data/app/views/hyrax/citations/work.html.erb +3 -3
- data/app/views/hyrax/collections/_collection.html.erb +1 -1
- data/app/views/hyrax/collections/_default_group.html.erb +1 -1
- data/app/views/hyrax/collections/_list_collections.html.erb +2 -2
- data/app/views/hyrax/collections/_list_works.html.erb +1 -1
- data/app/views/hyrax/collections/_show_descriptions.html.erb +6 -6
- data/app/views/hyrax/collections/_show_document_list_row.html.erb +2 -2
- data/app/views/hyrax/collections/_show_parent_collections.html.erb +11 -38
- data/app/views/hyrax/collections/_sort_and_per_page.html.erb +13 -13
- data/app/views/hyrax/collections/_subcollection_list.html.erb +1 -1
- data/app/views/hyrax/collections/_view_type_group.html.erb +1 -1
- data/app/views/hyrax/collections/show.html.erb +122 -122
- data/app/views/hyrax/content_blocks/_form.html.erb +13 -12
- data/app/views/hyrax/content_blocks/_modal_content_block.html.erb +15 -0
- data/app/views/hyrax/dashboard/_index_partials/_proxy_rights.html.erb +25 -19
- data/app/views/hyrax/dashboard/_sidebar.html.erb +1 -1
- data/app/views/hyrax/dashboard/collections/_button_for_remove_selected_from_collection.html.erb +1 -1
- data/app/views/hyrax/dashboard/collections/_collection_title.html.erb +16 -16
- data/app/views/hyrax/dashboard/collections/_form.html.erb +3 -1
- data/app/views/hyrax/dashboard/collections/_form_branding.html.erb +11 -11
- data/app/views/hyrax/dashboard/collections/_form_default_group_delt.html.erb +1 -1
- data/app/views/hyrax/dashboard/collections/_form_discovery.html.erb +2 -2
- data/app/views/hyrax/dashboard/collections/_form_for_select_collection.html.erb +4 -4
- data/app/views/hyrax/dashboard/collections/_form_share.html.erb +51 -44
- data/app/views/hyrax/dashboard/collections/_form_share_table.html.erb +2 -2
- data/app/views/hyrax/dashboard/collections/_list_collections.html.erb +4 -4
- data/app/views/hyrax/dashboard/collections/_list_works.html.erb +1 -1
- data/app/views/hyrax/dashboard/collections/_modal_remove_from_collection.html.erb +10 -5
- data/app/views/hyrax/dashboard/collections/_modal_remove_sub_collection.html.erb +10 -5
- data/app/views/hyrax/dashboard/collections/_show_actions.html.erb +1 -1
- data/app/views/hyrax/dashboard/collections/_show_add_items_actions.html.erb +2 -2
- data/app/views/hyrax/dashboard/collections/_show_document_list_row.html.erb +2 -2
- data/app/views/hyrax/dashboard/collections/_show_parent_collection_row.html.erb +10 -5
- data/app/views/hyrax/dashboard/collections/_show_parent_collections.html.erb +11 -34
- data/app/views/hyrax/dashboard/collections/_sort_and_per_page.html.erb +1 -1
- data/app/views/hyrax/dashboard/collections/_subcollection_list.html.erb +23 -17
- data/app/views/hyrax/dashboard/collections/show.html.erb +6 -6
- data/app/views/hyrax/dashboard/profiles/_edit_primary.html.erb +0 -4
- data/app/views/hyrax/dashboard/profiles/_trophy_edit.html.erb +16 -14
- data/app/views/hyrax/dashboard/profiles/show.html.erb +6 -0
- data/app/views/hyrax/dashboard/show_admin.html.erb +19 -3
- data/app/views/hyrax/dashboard/sidebar/_activity.html.erb +6 -0
- data/app/views/hyrax/dashboard/works/_list_works.html.erb +1 -1
- data/app/views/hyrax/depositors/index.html.erb +13 -0
- data/app/views/hyrax/embargoes/_list_expired_active_embargoes.html.erb +1 -1
- data/app/views/hyrax/embargoes/edit.html.erb +47 -35
- data/app/views/hyrax/embargoes/index.html.erb +6 -7
- data/app/views/hyrax/file_sets/_actions.html.erb +6 -2
- data/app/views/hyrax/file_sets/_extra_fields_modal.html.erb +3 -3
- data/app/views/hyrax/file_sets/_groups_description.html.erb +0 -1
- data/app/views/hyrax/file_sets/_permission_form.html.erb +3 -3
- data/app/views/hyrax/file_sets/edit.html.erb +24 -20
- data/app/views/hyrax/file_sets/media_display/_audio.html.erb +23 -6
- data/app/views/hyrax/file_sets/media_display/_default.html.erb +1 -1
- data/app/views/hyrax/file_sets/media_display/_video.html.erb +23 -6
- data/app/views/hyrax/leases/_list_expired_active_leases.html.erb +1 -1
- data/app/views/hyrax/leases/edit.html.erb +47 -35
- data/app/views/hyrax/leases/index.html.erb +6 -6
- data/app/views/hyrax/my/_collection_action_menu.html.erb +1 -1
- data/app/views/hyrax/my/_facet_limit.html.erb +1 -2
- data/app/views/hyrax/my/_facet_pagination.html.erb +6 -6
- data/app/views/hyrax/my/_facet_pivot.html.erb +1 -1
- data/app/views/hyrax/my/_results_pagination.html.erb +1 -1
- data/app/views/hyrax/my/collections/_facets.html.erb +1 -1
- data/app/views/hyrax/my/collections/_list_collections.html.erb +5 -5
- data/app/views/hyrax/my/collections/_modal_add_subcollection.html.erb +3 -2
- data/app/views/hyrax/my/collections/_modal_add_to_collection.html.erb +3 -1
- data/app/views/hyrax/my/collections/_modal_add_to_collection_permission_deny.html.erb +1 -1
- data/app/views/hyrax/my/collections/_modal_collection_types_to_create.html.erb +2 -2
- data/app/views/hyrax/my/collections/_modal_delete_collection.html.erb +1 -2
- data/app/views/hyrax/my/collections/_modal_delete_deny.html.erb +1 -1
- data/app/views/hyrax/my/collections/_modal_delete_selected_collections.html.erb +2 -2
- data/app/views/hyrax/my/collections/_tabs.html.erb +2 -2
- data/app/views/hyrax/my/collections/index.html.erb +7 -3
- data/app/views/hyrax/my/facet.html.erb +1 -1
- data/app/views/hyrax/my/index.html.erb +6 -2
- data/app/views/hyrax/my/works/_facets.html.erb +1 -1
- data/app/views/hyrax/my/works/_list_works.html.erb +1 -1
- data/app/views/hyrax/my/works/_tabs.html.erb +2 -2
- data/app/views/hyrax/my/works/index.html.erb +6 -2
- data/app/views/hyrax/notifications/_notifications.html.erb +1 -1
- data/app/views/hyrax/pages/_form.html.erb +12 -12
- data/app/views/hyrax/pages/show.html.erb +1 -1
- data/app/views/hyrax/single_use_links_viewer/show.html.erb +1 -1
- data/app/views/hyrax/stats/file.html.erb +6 -2
- data/app/views/hyrax/stats/work.html.erb +6 -2
- data/app/views/hyrax/transfers/_received.html.erb +6 -6
- data/app/views/hyrax/transfers/_sent.html.erb +2 -2
- data/app/views/hyrax/transfers/new.html.erb +0 -1
- data/app/views/hyrax/users/_activity_log.html.erb +2 -2
- data/app/views/hyrax/users/_profile_tabs.html.erb +1 -1
- data/app/views/hyrax/users/_search_form.html.erb +1 -1
- data/app/views/hyrax/users/_user.html.erb +0 -1
- data/app/views/hyrax/users/index.html.erb +1 -1
- data/app/views/kaminari/blacklight_compact/_paginator.html.erb +1 -2
- data/app/views/layouts/_head_tag_content.html.erb +2 -2
- data/app/views/layouts/error.html.erb +1 -1
- data/app/views/layouts/hyrax.html.erb +6 -3
- data/app/views/layouts/hyrax/dashboard.html.erb +6 -3
- data/app/views/records/show_fields/_based_near.html.erb +0 -1
- data/app/views/records/show_fields/_contributor.html.erb +0 -1
- data/app/views/records/show_fields/_date_created.html.erb +0 -1
- data/app/views/records/show_fields/_description.html.erb +1 -1
- data/app/views/records/show_fields/_identifier.html.erb +0 -1
- data/app/views/records/show_fields/_language.html.erb +0 -1
- data/app/views/records/show_fields/_publisher.html.erb +0 -1
- data/app/views/records/show_fields/_related_url.html.erb +0 -1
- data/app/views/records/show_fields/_resource_type.html.erb +0 -1
- data/app/views/records/show_fields/_subject.html.erb +0 -1
- data/app/views/shared/_citations.html.erb +17 -17
- data/app/views/shared/_select_work_type_modal.html.erb +2 -2
- data/config/locales/hyrax.de.yml +198 -189
- data/config/locales/hyrax.en.yml +21 -14
- data/config/locales/hyrax.es.yml +9 -0
- data/config/locales/hyrax.fr.yml +9 -0
- data/config/locales/hyrax.it.yml +9 -0
- data/config/locales/hyrax.pt-BR.yml +9 -0
- data/config/locales/hyrax.zh.yml +9 -0
- data/config/routes.rb +1 -0
- data/hyrax.gemspec +7 -18
- data/lib/generators/hyrax/models_generator.rb +0 -1
- data/lib/generators/hyrax/templates/db/migrate/20180302200051_add_branding_to_collection_type.rb.erb +5 -0
- data/lib/generators/hyrax/work/templates/feature_spec.rb.erb +1 -1
- data/lib/hyrax/configuration.rb +2 -4
- data/lib/hyrax/engine.rb +22 -4
- data/lib/hyrax/version.rb +1 -1
- data/spec/actors/hyrax/actors/lease_actor_spec.rb +16 -0
- data/spec/controllers/hyrax/admin/appearances_controller_spec.rb +1 -1
- data/spec/controllers/hyrax/admin/collection_types_controller_spec.rb +2 -0
- data/spec/controllers/hyrax/admin/features_controller_spec.rb +1 -1
- data/spec/controllers/hyrax/admin/workflow_roles_controller_spec.rb +1 -1
- data/spec/controllers/hyrax/admin/workflows_controller_spec.rb +1 -1
- data/spec/controllers/hyrax/batch_edits_controller_spec.rb +14 -1
- data/spec/controllers/hyrax/batch_uploads_controller_spec.rb +2 -2
- data/spec/controllers/hyrax/citations_controller_spec.rb +4 -2
- data/spec/controllers/hyrax/collections_controller_spec.rb +32 -4
- data/spec/controllers/hyrax/content_blocks_controller_spec.rb +1 -1
- data/spec/controllers/hyrax/dashboard/collections_controller_spec.rb +11 -6
- data/spec/controllers/hyrax/depositors_controller_spec.rb +11 -0
- data/spec/controllers/hyrax/downloads_controller_spec.rb +42 -0
- data/spec/controllers/hyrax/embargoes_controller_spec.rb +40 -1
- data/spec/controllers/hyrax/file_sets_controller_spec.rb +10 -2
- data/spec/controllers/hyrax/generic_works_controller_spec.rb +38 -6
- data/spec/controllers/hyrax/leases_controller_spec.rb +11 -0
- data/spec/controllers/hyrax/my/collections_controller_spec.rb +1 -1
- data/spec/controllers/hyrax/my/works_controller_spec.rb +1 -1
- data/spec/controllers/hyrax/pages_controller_spec.rb +1 -1
- data/spec/controllers/hyrax/stats_controller_spec.rb +2 -0
- data/spec/controllers/hyrax/transfers_controller_spec.rb +1 -1
- data/spec/factories/collection_types.rb +10 -1
- data/spec/factories/collections.rb +5 -3
- data/spec/factories/collections_factory.rb +3 -3
- data/spec/factories/file_sets.rb +2 -6
- data/spec/factories/generic_works.rb +68 -4
- data/spec/factory_tests/collections_factory_spec.rb +2 -1
- data/spec/features/batch_create_spec.rb +60 -0
- data/spec/features/batch_edit_spec.rb +1 -0
- data/spec/features/browse_dashboard_works_spec.rb +1 -0
- data/spec/features/collection_multi_membership_spec.rb +9 -6
- data/spec/features/collection_spec.rb +1 -1
- data/spec/features/collection_type_spec.rb +49 -1
- data/spec/features/create_work_admin_spec.rb +2 -2
- data/spec/features/create_work_spec.rb +1 -0
- data/spec/features/dashboard/all_works.rb +10 -2
- data/spec/features/dashboard/collection_spec.rb +38 -17
- data/spec/features/dashboard/display_admin_dashboard_spec.rb +29 -0
- data/spec/features/dashboard/display_dashboard_spec.rb +1 -1
- data/spec/features/edit_content_block_admin_spec.rb +45 -0
- data/spec/features/edit_work_spec.rb +40 -2
- data/spec/features/ownership_transfer_spec.rb +1 -0
- data/spec/features/proxy_spec.rb +2 -2
- data/spec/features/search_spec.rb +2 -5
- data/spec/features/work_show_spec.rb +14 -4
- data/spec/forms/hyrax/forms/admin/collection_type_form_spec.rb +1 -0
- data/spec/forms/hyrax/forms/collection_form_spec.rb +1 -1
- data/spec/helpers/hyrax/ability_helper_spec.rb +2 -2
- data/spec/helpers/hyrax/collections_helper_spec.rb +12 -4
- data/spec/javascripts/authority_select_spec.js +1 -1
- data/spec/javascripts/settings_spec.js +1 -0
- data/spec/jobs/attach_files_to_work_job_spec.rb +13 -0
- data/spec/jobs/import_url_job_spec.rb +14 -0
- data/spec/models/collection_spec.rb +1 -0
- data/spec/models/concerns/hyrax/collection_nesting_spec.rb +16 -0
- data/spec/models/hyrax/collection_type_spec.rb +1 -0
- data/spec/presenters/hyrax/collection_presenter_spec.rb +1 -100
- data/spec/presenters/hyrax/file_set_presenter_spec.rb +17 -2
- data/spec/presenters/hyrax/menu_presenter_spec.rb +6 -0
- data/spec/presenters/hyrax/work_show_presenter_spec.rb +15 -3
- data/spec/search_builders/hyrax/abstract_type_relation_spec.rb +18 -0
- data/spec/search_builders/hyrax/dashboard/collections_search_builder_spec.rb +30 -19
- data/spec/search_builders/hyrax/parent_collection_search_builder_spec.rb +15 -0
- data/spec/services/hyrax/collection_member_service_spec.rb +10 -19
- data/spec/services/hyrax/collection_types/create_service_spec.rb +35 -2
- data/spec/services/hyrax/collections/collection_member_service_spec.rb +1 -1
- data/spec/services/hyrax/qa_select_service_spec.rb +0 -1
- data/spec/support/selectors.rb +15 -0
- data/spec/views/hyrax/admin/admin_sets/_show_document_list_row.html.erb_spec.rb +2 -0
- data/spec/views/hyrax/admin/collection_types/_form_settings.html.erb_spec.rb +1 -0
- data/spec/views/hyrax/admin/stats/show.html.erb_spec.rb +9 -0
- data/spec/views/hyrax/base/_attributes.html.erb_spec.rb +1 -1
- data/spec/views/hyrax/base/_relationships.html.erb_spec.rb +13 -1
- data/spec/views/hyrax/base/_show_actions.html.erb_spec.rb +10 -0
- data/spec/views/hyrax/base/show.html.erb_spec.rb +8 -0
- data/spec/views/hyrax/collections/_show_parent_collections.html.erb_spec.rb +3 -53
- data/spec/views/hyrax/dashboard/_sidebar.html.erb_spec.rb +22 -0
- data/spec/views/hyrax/dashboard/collections/_form_share.erb_spec.rb +2 -1
- data/spec/views/hyrax/dashboard/collections/_show_actions.html.erb_spec.rb +13 -0
- data/spec/views/hyrax/dashboard/collections/_show_parent_collection_row.html.erb_spec.rb +26 -8
- data/spec/views/hyrax/dashboard/collections/_show_parent_collections.html.erb_spec.rb +7 -43
- data/spec/views/hyrax/dashboard/collections/_subcollection_list.html.erb_spec.rb +13 -1
- data/spec/views/hyrax/dashboard/collections/show.html.erb_spec.rb +1 -0
- data/spec/views/hyrax/dashboard/profiles/_trophy_edit.html.erb_spec.rb +36 -0
- data/spec/views/hyrax/dashboard/profiles/edit.html.erb_spec.rb +0 -38
- data/spec/views/hyrax/dashboard/profiles/show.html.erb_spec.rb +37 -0
- data/spec/views/hyrax/depositors/index.html.erb_spec.rb +13 -0
- data/spec/views/hyrax/file_sets/_actions.html.erb_spec.rb +15 -0
- data/spec/views/hyrax/file_sets/media_display/_audio.html.erb_spec.rb +29 -0
- data/spec/views/hyrax/file_sets/media_display/_default.html.erb_spec.rb +1 -1
- data/spec/views/hyrax/file_sets/media_display/_video.html.erb_spec.rb +29 -0
- data/spec/views/hyrax/my/collections/_list_collections.html.erb_spec.rb +6 -2
- data/tasks/hyrax_dev.rake +1 -3
- data/template.rb +1 -1
- metadata +49 -41
- data/app/assets/javascripts/hyrax/collections_forms.js +0 -108
@@ -46,12 +46,7 @@ module Hyrax
|
|
46
46
|
def new
|
47
47
|
# TODO: move these lines to the work form builder in Hyrax
|
48
48
|
curation_concern.depositor = current_user.user_key
|
49
|
-
|
50
|
-
# admin_set_id is required on the client, otherwise simple_form renders a blank option.
|
51
|
-
# however it isn't a required field for someone to submit via json.
|
52
|
-
# Set the first admin_set they have access to.
|
53
|
-
admin_set = Hyrax::AdminSetService.new(self).search_results(:deposit).first
|
54
|
-
curation_concern.admin_set_id = admin_set && admin_set.id
|
49
|
+
curation_concern.admin_set_id = admin_set_id_for_new
|
55
50
|
build_form
|
56
51
|
end
|
57
52
|
|
@@ -137,6 +132,16 @@ module Hyrax
|
|
137
132
|
|
138
133
|
private
|
139
134
|
|
135
|
+
def admin_set_id_for_new
|
136
|
+
# admin_set_id is required on the client, otherwise simple_form renders a blank option.
|
137
|
+
# however it isn't a required field for someone to submit via json.
|
138
|
+
# Set the default admin set if it exists; otherwise, set to first admin_set they have access to.
|
139
|
+
admin_sets = Hyrax::AdminSetService.new(self).search_results(:deposit)
|
140
|
+
return nil if admin_sets.blank? # shouldn't happen
|
141
|
+
return AdminSet::DEFAULT_ID if admin_sets.map(&:id).include?(AdminSet::DEFAULT_ID)
|
142
|
+
admin_sets.first.id
|
143
|
+
end
|
144
|
+
|
140
145
|
def build_form
|
141
146
|
@form = work_form_service.build(curation_concern, current_ability, self)
|
142
147
|
end
|
@@ -154,12 +159,10 @@ module Hyrax
|
|
154
159
|
end
|
155
160
|
|
156
161
|
def parent_presenter
|
162
|
+
return @parent_presenter unless params[:parent_id]
|
163
|
+
|
157
164
|
@parent_presenter ||=
|
158
|
-
|
159
|
-
if params[:parent_id]
|
160
|
-
@parent_presenter ||= show_presenter.new(search_result_document(id: params[:parent_id]), current_ability, request)
|
161
|
-
end
|
162
|
-
end
|
165
|
+
show_presenter.new(search_result_document(id: params[:parent_id]), current_ability, request)
|
163
166
|
end
|
164
167
|
|
165
168
|
# Include 'hyrax/base' in the search path for views, while prefering
|
@@ -29,6 +29,7 @@ module Hyrax
|
|
29
29
|
Hyrax::CollectionTypes::CreateService.add_default_participants(@collection_type.id)
|
30
30
|
redirect_to hyrax.edit_admin_collection_type_path(@collection_type), notice: t(:'hyrax.admin.collection_types.create.notification', name: @collection_type.title)
|
31
31
|
else
|
32
|
+
report_error_msg
|
32
33
|
setup_form
|
33
34
|
add_common_breadcrumbs
|
34
35
|
add_breadcrumb t(:'hyrax.admin.collection_types.new.header'), hyrax.new_admin_collection_type_path
|
@@ -64,6 +65,15 @@ module Hyrax
|
|
64
65
|
|
65
66
|
private
|
66
67
|
|
68
|
+
def report_error_msg
|
69
|
+
error_msg = @collection_type.errors.messages
|
70
|
+
msg = 'Save was not successful because '
|
71
|
+
error_msg.each { |k, v| msg << k.to_s + ' ' + v.join(', ') + ', and ' }
|
72
|
+
msg.chomp!(', and ')
|
73
|
+
msg << '.'
|
74
|
+
flash[:error] = msg
|
75
|
+
end
|
76
|
+
|
67
77
|
def update_referer
|
68
78
|
hyrax.edit_admin_collection_type_path(@collection_type) + (params[:referer_anchor] || '')
|
69
79
|
end
|
@@ -90,7 +100,7 @@ module Hyrax
|
|
90
100
|
end
|
91
101
|
|
92
102
|
def collection_type_params
|
93
|
-
params.require(:collection_type).permit(:title, :description, :nestable, :discoverable, :sharable, :share_applies_to_new_works,
|
103
|
+
params.require(:collection_type).permit(:title, :description, :nestable, :brandable, :discoverable, :sharable, :share_applies_to_new_works,
|
94
104
|
:allow_multiple_membership, :require_membership, :assigns_workflow, :assigns_visibility)
|
95
105
|
end
|
96
106
|
end
|
@@ -34,13 +34,9 @@ module Hyrax
|
|
34
34
|
def my_load_and_authorize_resource
|
35
35
|
@work = Hyrax::WorkRelation.new.find(params[:id])
|
36
36
|
|
37
|
-
unless user.can? :edit, @work
|
38
|
-
return render plain: "#{user} lacks access to #{@work}", status: :unauthorized
|
39
|
-
end
|
37
|
+
return render plain: "#{user} lacks access to #{@work}", status: :unauthorized unless user.can? :edit, @work
|
40
38
|
|
41
|
-
if @work.arkivo_checksum.nil?
|
42
|
-
return render plain: "Forbidden: #{@work} not deposited via Arkivo", status: :forbidden
|
43
|
-
end
|
39
|
+
return render plain: "Forbidden: #{@work} not deposited via Arkivo", status: :forbidden if @work.arkivo_checksum.nil?
|
44
40
|
rescue ActiveFedora::ObjectNotFoundError
|
45
41
|
return render plain: "id '#{params[:id]}' not found", status: :not_found
|
46
42
|
end
|
@@ -11,6 +11,8 @@ module Hyrax
|
|
11
11
|
# provides the help_text view method
|
12
12
|
helper PermissionsHelper
|
13
13
|
|
14
|
+
with_themed_layout 'dashboard'
|
15
|
+
|
14
16
|
def edit
|
15
17
|
work = form_class.model_class.new
|
16
18
|
work.depositor = current_user.user_key
|
@@ -47,6 +49,10 @@ module Hyrax
|
|
47
49
|
obj.attributes = work_params
|
48
50
|
obj.date_modified = Time.current.ctime
|
49
51
|
obj.visibility = params[:visibility]
|
52
|
+
|
53
|
+
InheritPermissionsJob.perform_now(obj)
|
54
|
+
VisibilityCopyJob.perform_now(obj)
|
55
|
+
|
50
56
|
obj.save
|
51
57
|
end
|
52
58
|
|
@@ -60,7 +60,7 @@ module Hyrax
|
|
60
60
|
# Calling `#t` in a controller context does not mark _html keys as html_safe
|
61
61
|
flash[:notice] = view_context.t('hyrax.works.create.after_create_html', application_name: view_context.application_name)
|
62
62
|
if uploading_on_behalf_of?
|
63
|
-
redirect_to hyrax.
|
63
|
+
redirect_to hyrax.dashboard_works_path
|
64
64
|
else
|
65
65
|
redirect_to hyrax.my_works_path
|
66
66
|
end
|
@@ -63,8 +63,10 @@ module Hyrax
|
|
63
63
|
end
|
64
64
|
|
65
65
|
def show
|
66
|
-
|
67
|
-
|
66
|
+
if @collection.collection_type.brandable?
|
67
|
+
banner_info = CollectionBrandingInfo.where(collection_id: @collection.id.to_s).where(role: "banner")
|
68
|
+
@banner_file = "/" + banner_info.first.local_path.split("/")[-4..-1].join("/") unless banner_info.empty?
|
69
|
+
end
|
68
70
|
|
69
71
|
presenter
|
70
72
|
query_collection_members
|
@@ -142,12 +144,7 @@ module Hyrax
|
|
142
144
|
|
143
145
|
process_member_changes
|
144
146
|
@collection.visibility = Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_PRIVATE unless @collection.discoverable?
|
145
|
-
visiblity_updated = (@collection.visibility != collection_params[:visibility])
|
146
147
|
if @collection.update(collection_params.except(:members))
|
147
|
-
# added because the collection indexing happens before Hydra::AccessControls::Permission is
|
148
|
-
# saved, and the after_update_index callback in the nested_relationship_reindexer removes the
|
149
|
-
# permissions from the collection's Solr document.
|
150
|
-
@collection.update_index if visiblity_updated
|
151
148
|
after_update
|
152
149
|
else
|
153
150
|
after_update_error
|
@@ -10,6 +10,8 @@ module Hyrax
|
|
10
10
|
add_breadcrumb t(:'hyrax.controls.home'), root_path
|
11
11
|
add_breadcrumb t(:'hyrax.dashboard.breadcrumbs.admin'), hyrax.dashboard_path
|
12
12
|
add_breadcrumb t(:'hyrax.admin.sidebar.profile'), hyrax.dashboard_profile_path
|
13
|
+
|
14
|
+
@presenter = Hyrax::UserProfilePresenter.new(@user, current_ability)
|
13
15
|
end
|
14
16
|
|
15
17
|
# Display form for users to edit their profile information
|
@@ -1,12 +1,12 @@
|
|
1
1
|
module Hyrax
|
2
2
|
class DashboardController < ApplicationController
|
3
3
|
include Blacklight::Base
|
4
|
+
include Hyrax::Breadcrumbs
|
4
5
|
with_themed_layout 'dashboard'
|
5
6
|
before_action :authenticate_user!
|
7
|
+
before_action :build_breadcrumbs, only: [:show]
|
6
8
|
|
7
9
|
def show
|
8
|
-
add_breadcrumb t(:'hyrax.controls.home'), root_path
|
9
|
-
add_breadcrumb t(:'hyrax.dashboard.breadcrumbs.admin'), hyrax.dashboard_path
|
10
10
|
if can? :read, :admin_dashboard
|
11
11
|
@presenter = Hyrax::Admin::DashboardPresenter.new
|
12
12
|
@admin_set_rows = Hyrax::AdminSetService.new(self).search_results_with_work_count(:read)
|
@@ -5,6 +5,15 @@ module Hyrax
|
|
5
5
|
before_action :authenticate_user!
|
6
6
|
before_action :validate_users, only: :create
|
7
7
|
|
8
|
+
layout :decide_layout
|
9
|
+
|
10
|
+
def index
|
11
|
+
add_breadcrumb t(:'hyrax.controls.home'), root_path
|
12
|
+
add_breadcrumb t(:'hyrax.dashboard.breadcrumbs.admin'), hyrax.dashboard_path
|
13
|
+
add_breadcrumb t(:'hyrax.dashboard.manage_proxies'), hyrax.depositors_path
|
14
|
+
@user = current_user
|
15
|
+
end
|
16
|
+
|
8
17
|
def create
|
9
18
|
grantor = authorize_and_return_grantor
|
10
19
|
grantee = ::User.from_url_component(params[:grantee_id])
|
@@ -41,5 +50,15 @@ module Hyrax
|
|
41
50
|
Hyrax::MessengerService.deliver(::User.batch_user, grantor, message_to_grantor, "Proxy Depositor Added")
|
42
51
|
Hyrax::MessengerService.deliver(::User.batch_user, grantee, message_to_grantee, "Proxy Depositor Added")
|
43
52
|
end
|
53
|
+
|
54
|
+
def decide_layout
|
55
|
+
layout = case action_name
|
56
|
+
when 'index'
|
57
|
+
'dashboard'
|
58
|
+
else
|
59
|
+
'1_column'
|
60
|
+
end
|
61
|
+
File.join(theme, layout)
|
62
|
+
end
|
44
63
|
end
|
45
64
|
end
|
@@ -1,6 +1,7 @@
|
|
1
1
|
module Hyrax
|
2
2
|
class DownloadsController < ApplicationController
|
3
3
|
include Hydra::Controller::DownloadBehavior
|
4
|
+
include Hyrax::LocalFileDownloadsControllerBehavior
|
4
5
|
|
5
6
|
def self.default_content_path
|
6
7
|
:original_file
|
@@ -15,9 +16,7 @@ module Hyrax
|
|
15
16
|
super
|
16
17
|
when String
|
17
18
|
# For derivatives stored on the local file system
|
18
|
-
|
19
|
-
response.headers['Content-Length'] = File.size(file).to_s
|
20
|
-
send_file file, derivative_download_options
|
19
|
+
send_local_content
|
21
20
|
else
|
22
21
|
raise ActiveFedora::ObjectNotFoundError
|
23
22
|
end
|
@@ -55,7 +54,7 @@ module Hyrax
|
|
55
54
|
# Loads the file specified by the HTTP parameter `:file`.
|
56
55
|
# If this object does not have a file by that name, return the default file
|
57
56
|
# as returned by {#default_file}
|
58
|
-
# @return [ActiveFedora::File,
|
57
|
+
# @return [ActiveFedora::File, File, NilClass] Returns the file from the repository or a path to a file on the local file system, if it exists.
|
59
58
|
def load_file
|
60
59
|
file_reference = params[:file]
|
61
60
|
return default_file unless file_reference
|
@@ -28,6 +28,8 @@ module Hyrax
|
|
28
28
|
private :curation_concern=
|
29
29
|
helper_method :file_set
|
30
30
|
|
31
|
+
layout :decide_layout
|
32
|
+
|
31
33
|
# GET /concern/file_sets/:id
|
32
34
|
def edit
|
33
35
|
initialize_edit_form
|
@@ -168,5 +170,15 @@ module Hyrax
|
|
168
170
|
def _prefixes
|
169
171
|
@_prefixes ||= super + ['hyrax/base']
|
170
172
|
end
|
173
|
+
|
174
|
+
def decide_layout
|
175
|
+
layout = case action_name
|
176
|
+
when 'show'
|
177
|
+
'1_column'
|
178
|
+
else
|
179
|
+
'dashboard'
|
180
|
+
end
|
181
|
+
File.join(theme, layout)
|
182
|
+
end
|
171
183
|
end
|
172
184
|
end
|
@@ -1,6 +1,15 @@
|
|
1
1
|
module Hyrax
|
2
2
|
module My
|
3
3
|
class WorksController < MyController
|
4
|
+
# Define collection specific filter facets.
|
5
|
+
def self.configure_facets
|
6
|
+
configure_blacklight do |config|
|
7
|
+
config.add_facet_field solr_name("admin_set", :facetable), limit: 5
|
8
|
+
config.add_facet_field solr_name('member_of_collections', :symbol), limit: 5
|
9
|
+
end
|
10
|
+
end
|
11
|
+
configure_facets
|
12
|
+
|
4
13
|
class_attribute :create_work_presenter_class
|
5
14
|
self.create_work_presenter_class = Hyrax::SelectTypeListPresenter
|
6
15
|
|
@@ -13,7 +13,6 @@ module Hyrax
|
|
13
13
|
helper_method: :visibility_badge,
|
14
14
|
limit: 5, label: I18n.t('hyrax.dashboard.my.heading.visibility')
|
15
15
|
config.add_facet_field IndexesWorkflow.suppressed_field, helper_method: :suppressed_to_status
|
16
|
-
config.add_facet_field solr_name("admin_set", :facetable), limit: 5
|
17
16
|
config.add_facet_field solr_name("resource_type", :facetable), limit: 5
|
18
17
|
end
|
19
18
|
end
|
@@ -46,9 +46,7 @@ module Hyrax
|
|
46
46
|
# any existing edit permissions on the work.
|
47
47
|
def accept
|
48
48
|
@proxy_deposit_request.transfer!(params[:reset])
|
49
|
-
if params[:sticky]
|
50
|
-
current_user.can_receive_deposits_from << @proxy_deposit_request.sending_user
|
51
|
-
end
|
49
|
+
current_user.can_receive_deposits_from << @proxy_deposit_request.sending_user if params[:sticky]
|
52
50
|
redirect_to hyrax.transfers_path, notice: "Transfer complete"
|
53
51
|
end
|
54
52
|
|
@@ -24,9 +24,7 @@ module Hyrax
|
|
24
24
|
def search(query)
|
25
25
|
clause = query.blank? ? nil : "%" + query.downcase + "%"
|
26
26
|
base = ::User.where(*base_query)
|
27
|
-
if clause.present?
|
28
|
-
base = base.where("#{Hydra.config.user_key_field} like lower(?) OR display_name like lower(?)", clause, clause)
|
29
|
-
end
|
27
|
+
base = base.where("#{Hydra.config.user_key_field} like lower(?) OR display_name like lower(?)", clause, clause) if clause.present?
|
30
28
|
base.registered
|
31
29
|
.where("#{Hydra.config.user_key_field} not in (?)",
|
32
30
|
[::User.batch_user_key, ::User.audit_user_key])
|
@@ -6,7 +6,7 @@ module Hyrax
|
|
6
6
|
attr_accessor :collection_type
|
7
7
|
validates :title, presence: true
|
8
8
|
|
9
|
-
delegate :title, :description, :discoverable, :nestable, :sharable, :share_applies_to_new_works,
|
9
|
+
delegate :title, :description, :brandable, :discoverable, :nestable, :sharable, :share_applies_to_new_works,
|
10
10
|
:require_membership, :allow_multiple_membership, :assigns_workflow,
|
11
11
|
:assigns_visibility, :id, :collection_type_participants, :persisted?,
|
12
12
|
:collections?, :admin_set?, :user_collection?, to: :collection_type
|
@@ -45,7 +45,6 @@ module Hyrax
|
|
45
45
|
# @return [Hash{Symbol => String, Boolean}] { :content_tab (for confirmation message),
|
46
46
|
# :updated (true/false),
|
47
47
|
# :error_code (for flash error lookup) }
|
48
|
-
# rubocop:disable Metrics/MethodLength
|
49
48
|
def update(attributes)
|
50
49
|
@attributes = attributes
|
51
50
|
return_info = { content_tab: tab_to_update }
|
@@ -219,9 +218,7 @@ module Hyrax
|
|
219
218
|
def grants_as_collection
|
220
219
|
return [] unless attributes[:access_grants_attributes]
|
221
220
|
attributes_collection = attributes[:access_grants_attributes]
|
222
|
-
if attributes_collection.respond_to?(:permitted?)
|
223
|
-
attributes_collection = attributes_collection.to_h
|
224
|
-
end
|
221
|
+
attributes_collection = attributes_collection.to_h if attributes_collection.respond_to?(:permitted?)
|
225
222
|
if attributes_collection.is_a? Hash
|
226
223
|
attributes_collection = attributes_collection
|
227
224
|
.sort_by { |i, _| i.to_i }
|
@@ -160,9 +160,7 @@ module Hyrax
|
|
160
160
|
# are going into a mediated deposit workflow.
|
161
161
|
def self.sanitize_params(form_params)
|
162
162
|
admin_set_id = form_params[:admin_set_id]
|
163
|
-
if admin_set_id && workflow_for(admin_set_id: admin_set_id).allows_access_grant?
|
164
|
-
return super
|
165
|
-
end
|
163
|
+
return super if admin_set_id && workflow_for(admin_set_id: admin_set_id).allows_access_grant?
|
166
164
|
params_without_permissions = permitted_params.reject { |arg| arg.respond_to?(:key?) && arg.key?(:permissions_attributes) }
|
167
165
|
form_params.permit(*params_without_permissions)
|
168
166
|
end
|
@@ -6,9 +6,7 @@ module Hyrax
|
|
6
6
|
end
|
7
7
|
|
8
8
|
def clean_end_punctuation(text)
|
9
|
-
if text && ([".", ",", ":", ";", "/"].include? text[-1, 1])
|
10
|
-
return text[0, text.length - 1]
|
11
|
-
end
|
9
|
+
return text[0, text.length - 1] if text && ([".", ",", ":", ";", "/"].include? text[-1, 1])
|
12
10
|
text
|
13
11
|
end
|
14
12
|
end
|
@@ -4,17 +4,13 @@ module Hyrax
|
|
4
4
|
class ChicagoFormatter < BaseFormatter
|
5
5
|
include Hyrax::CitationsBehaviors::PublicationBehavior
|
6
6
|
include Hyrax::CitationsBehaviors::TitleBehavior
|
7
|
-
|
8
|
-
# rubocop:disable Metrics/MethodLength
|
9
7
|
def format(work)
|
10
8
|
text = ""
|
11
9
|
|
12
10
|
# setup formatted author list
|
13
11
|
authors_list = all_authors(work)
|
14
12
|
text << format_authors(authors_list)
|
15
|
-
if text.present?
|
16
|
-
text = "<span class=\"citation-author\">#{text}</span>"
|
17
|
-
end
|
13
|
+
text = "<span class=\"citation-author\">#{text}</span>" if text.present?
|
18
14
|
# Get Pub Date
|
19
15
|
pub_date = setup_pub_date(work)
|
20
16
|
text << " #{pub_date}." unless pub_date.nil?
|
@@ -9,12 +9,15 @@ module Hyrax
|
|
9
9
|
end
|
10
10
|
|
11
11
|
def render_collection_links(solr_doc)
|
12
|
-
collection_list = Hyrax::CollectionMemberService.run(solr_doc)
|
12
|
+
collection_list = Hyrax::CollectionMemberService.run(solr_doc, controller.current_ability)
|
13
13
|
return if collection_list.empty?
|
14
|
-
links = collection_list.map
|
15
|
-
|
14
|
+
links = collection_list.map { |collection| link_to collection.title_or_label, collection_path(collection.id) }
|
15
|
+
collection_links = []
|
16
|
+
links.each_with_index do |link, n|
|
17
|
+
collection_links << link
|
18
|
+
collection_links << ', ' unless links[n + 1].nil?
|
16
19
|
end
|
17
|
-
content_tag :span, safe_join([t('hyrax.collection.is_part_of'), ': '] +
|
20
|
+
content_tag :span, safe_join([t('hyrax.collection.is_part_of'), ': '] + collection_links)
|
18
21
|
end
|
19
22
|
|
20
23
|
# @return [Boolean]
|