sufia 4.0.0.beta2 → 4.0.0.beta3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile +3 -0
- data/README.md +6 -4
- data/SUFIA_VERSION +1 -1
- data/app/assets/images/folder.png +0 -0
- data/app/assets/javascripts/sufia.js +5 -0
- data/app/assets/javascripts/sufia/app.js +1 -0
- data/app/assets/javascripts/sufia/batch_select_all.js +1 -2
- data/app/assets/javascripts/sufia/dashboard_actions.js +13 -0
- data/app/assets/javascripts/sufia/editor.js +1 -1
- data/app/assets/javascripts/sufia/ga_events.js +10 -0
- data/app/assets/javascripts/sufia/search.js +67 -0
- data/app/assets/stylesheets/dashboard.css.scss +15 -1
- data/app/assets/stylesheets/sufia.css.scss +12 -0
- data/app/controllers/authorities_controller.rb +4 -4
- data/app/controllers/batch_controller.rb +4 -4
- data/app/controllers/collections_controller.rb +44 -0
- data/{lib → app/controllers/concerns}/sufia/batch_edits_controller_behavior.rb +1 -1
- data/app/controllers/concerns/sufia/catalog.rb +9 -45
- data/{lib → app/controllers/concerns}/sufia/controller.rb +11 -21
- data/app/controllers/concerns/sufia/dashboard_controller_behavior.rb +34 -6
- data/{lib → app/controllers/concerns}/sufia/downloads_controller_behavior.rb +0 -0
- data/app/controllers/concerns/sufia/files_controller/browse_everything.rb +35 -0
- data/{lib → app/controllers/concerns}/sufia/files_controller/local_ingest_behavior.rb +19 -7
- data/{lib → app/controllers/concerns}/sufia/files_controller/upload_complete_behavior.rb +1 -1
- data/app/controllers/concerns/sufia/files_controller_behavior.rb +219 -0
- data/app/controllers/concerns/sufia/homepage_controller.rb +41 -0
- data/app/controllers/concerns/sufia/users_controller_behavior.rb +3 -2
- data/app/controllers/dashboard/collections_controller.rb +19 -0
- data/app/controllers/dashboard/files_controller.rb +13 -0
- data/app/controllers/dashboard/highlights_controller.rb +20 -0
- data/app/controllers/dashboard/lists_controller.rb +13 -0
- data/app/controllers/dashboard/shares_controller.rb +19 -0
- data/app/controllers/directory_controller.rb +8 -8
- data/app/controllers/featured_work_lists_controller.rb +1 -1
- data/app/controllers/homepage_controller.rb +4 -0
- data/app/controllers/single_use_links_controller.rb +6 -6
- data/app/controllers/single_use_links_viewer_controller.rb +6 -6
- data/app/controllers/static_controller.rb +4 -3
- data/app/helpers/batch_edits_helper.rb +3 -6
- data/app/helpers/content_block_helper.rb +7 -2
- data/app/helpers/generic_file_helper.rb +33 -39
- data/app/helpers/records_helper.rb +4 -0
- data/app/helpers/sufia/blacklight_override.rb +11 -0
- data/app/helpers/sufia/records_helper_behavior.rb +38 -0
- data/app/helpers/sufia/sufia_helper_behavior.rb +109 -0
- data/{sufia-models/lib/sufia/models → app/models/concerns/sufia}/solr_document_behavior.rb +6 -1
- data/app/models/contact_form.rb +13 -13
- data/app/uploaders/tinymce_asset_uploader.rb +2 -2
- data/app/views/_controls.html.erb +1 -1
- data/app/views/_flash_msg.html.erb +2 -8
- data/app/views/_ga.html.erb +4 -0
- data/app/views/_user_util_links.html.erb +7 -7
- data/app/views/advanced/_advanced_search_facets.html.erb +1 -1
- data/app/views/advanced/_advanced_search_fields.html.erb +2 -2
- data/app/views/advanced/_advanced_search_form.html.erb +12 -12
- data/app/views/batch/_metadata.html.erb +12 -12
- data/app/views/batch/_more_metadata.html.erb +1 -2
- data/app/views/batch/edit.html.erb +5 -5
- data/app/views/batch_edits/_check_all.html.erb +1 -1
- data/app/views/batch_edits/_delete_selected.html.erb +2 -3
- data/app/views/batch_edits/edit.html.erb +20 -21
- data/app/views/catalog/_bookmark_control.html.erb +7 -8
- data/app/views/catalog/_constraints_element.html.erb +2 -2
- data/app/views/catalog/_delete_partials/_default.html.erb +9 -12
- data/app/views/catalog/_document.html.erb +5 -5
- data/app/views/catalog/_document_list.html.erb +2 -2
- data/app/views/catalog/_edit_partials/_default.html.erb +6 -9
- data/app/views/catalog/_edit_partials/_default_details.html.erb +2 -4
- data/app/views/catalog/_email_form.html.erb +1 -1
- data/app/views/catalog/_facet_limit.html.erb +6 -7
- data/app/views/catalog/_facet_selected.html.erb +3 -3
- data/app/views/catalog/_folder_control.html.erb +7 -8
- data/app/views/catalog/_index_default.html.erb +2 -2
- data/app/views/catalog/_index_header_default.html.erb +20 -0
- data/app/views/catalog/_index_partials/_default_group.html.erb +1 -1
- data/app/views/catalog/_index_partials/_list_files.html.erb +5 -2
- data/app/views/catalog/_refworks_form.html.erb +2 -2
- data/app/views/catalog/_results_pagination.html.erb +1 -1
- data/app/views/catalog/_search_form.html.erb +24 -9
- data/app/views/catalog/_show_default.html.erb +2 -2
- data/app/views/catalog/_show_partials/_default.html.erb +4 -5
- data/app/views/catalog/_show_partials/_default_details.html.erb +5 -5
- data/app/views/catalog/_show_partials/_facets.html.erb +7 -7
- data/app/views/catalog/_show_tools.html.erb +6 -6
- data/app/views/catalog/_sms_form.html.erb +1 -1
- data/app/views/catalog/_sort_and_per_page.html.erb +8 -14
- data/app/views/catalog/citation.html.erb +1 -1
- data/app/views/catalog/email.erb +1 -1
- data/app/views/catalog/index.html.erb +16 -27
- data/app/views/catalog/recent.js.erb +1 -1
- data/app/views/catalog/show.html.erb +2 -2
- data/app/views/catalog/sms.erb +1 -1
- data/app/views/collections/_action_menu.html.erb +24 -0
- data/app/views/collections/_batch_edits_actions.html.erb +3 -0
- data/app/views/collections/_button_for_creating_empty_collection.html.erb +3 -0
- data/app/views/collections/_dashboard_document_list.html.erb +6 -0
- data/app/views/collections/_document_list.html.erb +10 -0
- data/app/views/collections/_edit_actions.html.erb +5 -0
- data/app/views/collections/_edit_descriptions.html.erb +20 -0
- data/app/views/collections/_form.html.erb +24 -0
- data/app/views/collections/_form_for_select_collection.html.erb +34 -0
- data/app/views/collections/_media_display.html.erb +1 -0
- data/app/views/collections/_paginate.html.erb +6 -0
- data/app/views/collections/_search_collection_dashboard_form.html.erb +10 -0
- data/app/views/collections/_show_actions.html.erb +7 -0
- data/app/views/collections/_show_descriptions.html.erb +8 -0
- data/app/views/collections/_show_fields.html.erb +0 -0
- data/app/views/collections/_single_item_action_fields.html.erb +6 -0
- data/app/views/collections/_sort_and_per_page.html.erb +29 -0
- data/app/views/collections/_view_type_group.html.erb +13 -0
- data/app/views/collections/edit.html.erb +30 -0
- data/app/views/collections/show.html.erb +32 -0
- data/app/views/contact_form/new.html.erb +13 -13
- data/app/views/dashboard/_action_menu.html.erb +29 -0
- data/app/views/dashboard/_collection_action_menu.html.erb +15 -0
- data/app/views/dashboard/_document_list.html.erb +1 -1
- data/app/views/dashboard/_facet_limit.html.erb +2 -2
- data/app/views/dashboard/_facet_pagination.html.erb +12 -12
- data/app/views/dashboard/_facet_selected.html.erb +2 -2
- data/app/views/dashboard/_facets.html.erb +2 -0
- data/app/views/dashboard/_index_partials/_default_group.html.erb +9 -2
- data/app/views/dashboard/_index_partials/_list_collections.html.erb +45 -0
- data/app/views/dashboard/_index_partials/_list_files.html.erb +5 -25
- data/app/views/dashboard/_results_pagination.html.erb +1 -1
- data/app/views/dashboard/_search_form.html.erb +2 -2
- data/app/views/dashboard/_show_partials/_default.html.erb +3 -3
- data/app/views/dashboard/_show_partials/_default_details.html.erb +5 -5
- data/app/views/dashboard/_show_partials/_facets.html.erb +6 -6
- data/app/views/dashboard/_sort_and_per_page.html.erb +24 -8
- data/app/views/dashboard/facet.html.erb +3 -3
- data/app/views/dashboard/index.html.erb +18 -41
- data/app/views/dashboard/lists/index.html.erb +59 -0
- data/app/views/generic_files/_breadcrumbs.html.erb +4 -4
- data/app/views/generic_files/_descriptions.html.erb +4 -4
- data/app/views/generic_files/_field_form.html.erb +5 -5
- data/app/views/generic_files/_flot_stats.js.erb +120 -0
- data/app/views/generic_files/_media_display.html.erb +14 -4
- data/app/views/generic_files/_permission.html.erb +3 -3
- data/app/views/generic_files/_permission_form.html.erb +20 -21
- data/app/views/generic_files/_show_actions.html.erb +13 -10
- data/app/views/generic_files/_show_details.html.erb +16 -9
- data/app/views/generic_files/_versioning.html.erb +3 -3
- data/app/views/generic_files/edit.html.erb +7 -7
- data/app/views/generic_files/edit_fields/_default.html.erb +3 -4
- data/app/views/generic_files/edit_fields/_description.html.erb +3 -4
- data/app/views/generic_files/edit_fields/_resource_type.html.erb +1 -3
- data/app/views/generic_files/edit_fields/_rights.html.erb +3 -5
- data/app/views/generic_files/edit_fields/_suffix.html.erb +1 -1
- data/app/views/generic_files/show.html.erb +3 -3
- data/app/views/generic_files/stats.html.erb +8 -124
- data/app/views/generic_files/upload/_alerts.html.erb +2 -4
- data/app/views/generic_files/upload/_form.html.erb +1 -1
- data/app/views/generic_files/upload/_local_file_import_chooser.html.erb +1 -1
- data/app/views/generic_files/upload/_tos_checkbox.html.erb +1 -1
- data/app/views/homepage/_featured.html.erb +3 -1
- data/app/views/{catalog → homepage}/_featured_researcher.html.erb +0 -0
- data/app/views/{catalog → homepage}/_home.html.erb +1 -0
- data/app/views/{catalog → homepage}/_home_content.html.erb +4 -4
- data/app/views/homepage/_home_header.html.erb +12 -0
- data/app/views/homepage/_marketing.html.erb +4 -0
- data/app/views/{catalog → homepage}/_recent_document.html.erb +10 -5
- data/app/views/homepage/_recents.html.erb +15 -0
- data/app/views/homepage/_sortable_featured.html.erb +3 -1
- data/app/views/{catalog → homepage}/_tagcloud.html.erb +0 -0
- data/app/views/homepage/index.html.erb +1 -0
- data/app/views/kaminari/blacklight/_first_page.html.erb +1 -1
- data/app/views/kaminari/blacklight/_last_page.html.erb +1 -1
- data/app/views/kaminari/blacklight/_next_page.html.erb +1 -1
- data/app/views/kaminari/blacklight/_page.html.erb +1 -1
- data/app/views/kaminari/blacklight/_prev_page.html.erb +1 -1
- data/app/views/layouts/_head_tag_content.html.erb +1 -1
- data/app/views/layouts/error.html.erb +2 -2
- data/app/views/layouts/homepage.html.erb +4 -4
- data/app/views/layouts/sufia-dashboard.html.erb +7 -7
- data/app/views/layouts/sufia-one-column.html.erb +4 -4
- data/app/views/layouts/sufia-two-column.html.erb +7 -7
- data/app/views/mailbox/index.html.erb +2 -2
- data/app/views/pages/show.html.erb +1 -0
- data/app/views/records/_edit_field.html.erb +18 -0
- data/app/views/records/edit_fields/_description.html.erb +10 -0
- data/app/views/records/edit_fields/_resource_type.html.erb +7 -0
- data/app/views/records/edit_fields/_rights.html.erb +6 -0
- data/app/views/records/edit_fields/_suffix.html.erb +9 -0
- data/app/views/records/edit_fields/_type.html.erb +13 -0
- data/app/views/single_use_links/new_download.html.erb +1 -1
- data/app/views/users/_activity.html.erb +1 -1
- data/app/views/users/_contributions.html.erb +3 -1
- data/app/views/users/_left_sidebar.html.erb +1 -1
- data/app/views/users/_notify_link.html.erb +2 -2
- data/app/views/users/_profile.html.erb +2 -2
- data/app/views/users/_search_form.html.erb +3 -3
- data/app/views/users/edit.html.erb +15 -15
- data/app/views/users/index.html.erb +3 -3
- data/app/views/users/notifications_number.js.erb +1 -1
- data/config/locales/sufia.en.yml +13 -2
- data/config/routes.rb +56 -20
- data/db/seeds.rb +2 -2
- data/lib/generators/sufia/sufia_generator.rb +14 -4
- data/lib/generators/sufia/templates/catalog_controller.rb +98 -97
- data/lib/generators/sufia/templates/sufia_helper.rb +5 -0
- data/lib/sufia.rb +4 -0
- data/spec/{models/generic_file/actions_spec.rb → actors/generic_file/actor_spec.rb} +2 -2
- data/spec/controllers/authorities_controller_spec.rb +7 -7
- data/spec/controllers/batch_controller_spec.rb +22 -23
- data/spec/controllers/batch_edits_controller_spec.rb +4 -4
- data/spec/controllers/catalog_controller_spec.rb +27 -37
- data/spec/controllers/collections_controller_spec.rb +179 -0
- data/spec/controllers/dashboard/collections_controller_spec.rb +71 -0
- data/spec/controllers/dashboard/files_controller_spec.rb +71 -0
- data/spec/controllers/dashboard/highlights_controller_spec.rb +66 -0
- data/spec/controllers/dashboard/shares_controller_spec.rb +78 -0
- data/spec/controllers/dashboard_controller_spec.rb +0 -47
- data/spec/controllers/downloads_controller_spec.rb +10 -11
- data/spec/controllers/generic_files_controller_spec.rb +147 -118
- data/spec/controllers/homepage_controller_spec.rb +57 -0
- data/spec/controllers/mailbox_controller_spec.rb +3 -3
- data/spec/controllers/single_use_links_viewer_controller_spec.rb +3 -3
- data/spec/factories/generic_files.rb +4 -0
- data/spec/factories/users.rb +0 -1
- data/spec/features/browse_dashboard_files_spec.rb +5 -1
- data/spec/features/collection_spec.rb +232 -0
- data/spec/features/display_dashboard_spec.rb +1 -0
- data/spec/features/notifications_spec.rb +1 -1
- data/spec/features/search_spec.rb +22 -0
- data/spec/features/single_use_links_spec.rb +2 -2
- data/spec/features/users_spec.rb +1 -1
- data/spec/fixtures/charter.docx +0 -0
- data/spec/helpers/records_helper_spec.rb +61 -0
- data/spec/helpers/sufia_helper_spec.rb +40 -2
- data/spec/{models → jobs}/active_fedora_pid_based_job_spec.rb +0 -0
- data/spec/{models → jobs}/audit_job_spec.rb +0 -2
- data/spec/{models → jobs}/batch_update_job_spec.rb +2 -2
- data/spec/jobs/characterize_job_spec.rb +25 -0
- data/spec/jobs/create_derivatives_job_spec.rb +186 -0
- data/spec/{models → jobs}/event_jobs_spec.rb +0 -1
- data/spec/jobs/import_url_job_spec.rb +36 -14
- data/spec/jobs/ingest_local_file_job_spec.rb +2 -2
- data/spec/lib/sufia/analytics_spec.rb +29 -0
- data/spec/lib/sufia/upload_complete_behavior_spec.rb +1 -1
- data/spec/models/batch_spec.rb +3 -9
- data/spec/models/checksum_audit_log_spec.rb +5 -6
- data/spec/models/collection_spec.rb +24 -0
- data/spec/models/download_spec.rb +21 -0
- data/spec/models/featured_work_list_spec.rb +0 -1
- data/spec/models/file_content_datastream_spec.rb +8 -14
- data/spec/models/file_usage_spec.rb +91 -0
- data/spec/models/fits_datastream_spec.rb +1 -1
- data/spec/models/generic_file/web_form_spec.rb +2 -2
- data/spec/models/generic_file_rdf_datastream_spec.rb +12 -0
- data/spec/models/generic_file_spec.rb +150 -168
- data/spec/models/local_authority_spec.rb +9 -9
- data/spec/models/{pageview.rb → pageview_spec.rb} +0 -0
- data/spec/models/single_use_link_spec.rb +32 -35
- data/spec/routing/route_spec.rb +19 -3
- data/spec/spec_helper.rb +28 -6
- data/spec/support/features/session_helpers.rb +5 -6
- data/spec/support/lib/generators/test_app_generator.rb +6 -0
- data/spec/views/generic_file/edit.html.erb_spec.rb +4 -4
- data/spec/views/generic_file/show.html.erb_spec.rb +45 -17
- data/spec/views/generic_file/stats.html.erb_spec.rb +26 -7
- data/sufia-models/app/actors/sufia/generic_file/actor.rb +98 -0
- data/sufia-models/app/models/batch.rb +3 -3
- data/sufia-models/app/models/checksum_audit_log.rb +3 -3
- data/sufia-models/app/models/collection.rb +41 -0
- data/sufia-models/{lib/sufia/models → app/models/concerns/sufia}/generic_file.rb +33 -43
- data/sufia-models/{lib/sufia/models → app/models/concerns/sufia}/generic_file/accessible_attributes.rb +3 -3
- data/sufia-models/{lib/sufia/models → app/models/concerns/sufia}/generic_file/audit.rb +12 -18
- data/sufia-models/{lib/sufia/models → app/models/concerns/sufia}/generic_file/characterization.rb +1 -8
- data/sufia-models/app/models/concerns/sufia/generic_file/derivatives.rb +26 -0
- data/sufia-models/{lib/sufia/models → app/models/concerns/sufia}/generic_file/export.rb +13 -13
- data/sufia-models/{lib/sufia/models → app/models/concerns/sufia}/generic_file/featured.rb +0 -0
- data/sufia-models/{lib/sufia/models → app/models/concerns/sufia}/generic_file/metadata.rb +0 -0
- data/sufia-models/{lib/sufia/models → app/models/concerns/sufia}/generic_file/mime_types.rb +15 -1
- data/sufia-models/{lib/sufia/models → app/models/concerns/sufia}/generic_file/permissions.rb +5 -1
- data/sufia-models/{lib/sufia/models → app/models/concerns/sufia}/generic_file/reload_on_save.rb +0 -0
- data/sufia-models/{lib/sufia/models → app/models/concerns/sufia}/generic_file/trophies.rb +0 -0
- data/sufia-models/app/models/concerns/sufia/generic_file/versions.rb +16 -0
- data/sufia-models/{lib/sufia/models → app/models/concerns/sufia}/generic_file/virus_check.rb +2 -3
- data/sufia-models/{lib/sufia/models → app/models/concerns/sufia}/generic_file/web_form.rb +9 -2
- data/sufia-models/app/models/concerns/sufia/properties_datastream_behavior.rb +3 -4
- data/sufia-models/app/models/concerns/sufia/user.rb +2 -2
- data/sufia-models/app/models/datastreams/fits_datastream.rb +137 -136
- data/sufia-models/app/models/datastreams/generic_file_rdf_datastream.rb +6 -0
- data/sufia-models/app/models/datastreams/paranoid_rights_datastream.rb +3 -3
- data/sufia-models/app/models/file_usage.rb +53 -0
- data/sufia-models/app/models/follow.rb +2 -4
- data/sufia-models/app/models/geo_names_resource.rb +5 -7
- data/sufia-models/app/models/local_authority.rb +14 -14
- data/sufia-models/app/models/single_use_link.rb +1 -1
- data/sufia-models/app/models/sufia/download.rb +9 -0
- data/sufia-models/app/models/trophy.rb +1 -1
- data/sufia-models/app/services/sufia/{usage_statistics.rb → analytics.rb} +1 -24
- data/sufia-models/app/services/sufia/id_service.rb +2 -2
- data/sufia-models/lib/generators/sufia/models/install_generator.rb +5 -2
- data/sufia-models/lib/generators/sufia/models/templates/config/setup_mail.rb +1 -1
- data/sufia-models/lib/generators/sufia/models/templates/config/sufia.rb +5 -3
- data/sufia-models/lib/generators/sufia/models/templates/migrations/acts_as_follower_migration.rb +6 -6
- data/sufia-models/lib/generators/sufia/models/templates/migrations/create_checksum_audit_logs.rb +2 -3
- data/sufia-models/lib/generators/sufia/models/templates/migrations/create_local_authorities.rb +20 -20
- data/sufia-models/lib/sufia/ability.rb +1 -1
- data/sufia-models/lib/sufia/models/engine.rb +3 -9
- data/sufia-models/lib/sufia/models/file_content/versions.rb +3 -3
- data/sufia-models/lib/sufia/models/jobs/active_fedora_pid_based_job.rb +6 -2
- data/sufia-models/lib/sufia/models/jobs/batch_update_job.rb +6 -10
- data/sufia-models/lib/sufia/models/jobs/characterize_job.rb +1 -13
- data/sufia-models/lib/sufia/models/jobs/create_derivatives_job.rb +14 -0
- data/sufia-models/lib/sufia/models/jobs/import_url_job.rb +27 -23
- data/sufia-models/lib/tasks/sufia-models_tasks.rake +1 -1
- data/sufia-models/sufia-models.gemspec +1 -1
- data/sufia.gemspec +7 -2
- data/tasks/jetty.rake +4 -4
- data/tasks/release.rake +8 -8
- data/tasks/sufia-db.rake +4 -4
- data/tasks/sufia-dev.rake +11 -5
- metadata +226 -95
- data/app/helpers/sufia_helper.rb +0 -93
- data/app/views/catalog/_bookmark_form.html.erb +0 -8
- data/app/views/catalog/_home_header.html.erb +0 -15
- data/app/views/catalog/_recents.html.erb +0 -17
- data/app/views/dashboard/_index_partials/_thumbnail_display.html.erb +0 -9
- data/app/views/layouts/_homepage_sidebar2.html.erb +0 -14
- data/lib/sufia/files_controller_behavior.rb +0 -253
- data/spec/helpers/generic_file_helper_spec.rb +0 -28
- data/spec/lib/sufia/usage_statistics_spec.rb +0 -75
- data/spec/models/characterize_job_spec.rb +0 -93
- data/spec/models/transcode_audio_job_spec.rb +0 -85
- data/spec/models/transcode_video_job_spec.rb +0 -31
- data/spec/views/dashboard/index_partials/_thumbnail_display.html.erb_spec.rb +0 -22
- data/sufia-models/lib/sufia/models/generic_file/actions.rb +0 -50
- data/sufia-models/lib/sufia/models/generic_file/derivatives.rb +0 -31
- data/sufia-models/lib/sufia/models/generic_file/thumbnail.rb +0 -37
- data/sufia-models/lib/sufia/models/generic_file/versions.rb +0 -16
- data/sufia-models/lib/sufia/models/jobs/transcode_audio_job.rb +0 -15
- data/sufia-models/lib/sufia/models/jobs/transcode_video_job.rb +0 -15
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 8dc0a47a4d02bb4ce230928b4242bc02db1ae5db
|
|
4
|
+
data.tar.gz: e998ecb28e7c6b68074cc2ecf3a3ca4372fdf547
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 973bb882c5efa1463f8ccc303bd3954e09f3f781249fe504dfac14c8b4e08491895c3d70485ca5c497e91ce9e8f1de8ab16604d5b0754c3f3b394a666231210b
|
|
7
|
+
data.tar.gz: 94cde82bad64900cda91fe6d84f9cb39e75e6c8443784ba14f319dc5e3f0931088fa1669933ce5fd9b5305ea95dfa91407ba9a4dd6d2c7f42dc18cff8b0c84d8
|
data/Gemfile
CHANGED
|
@@ -15,6 +15,7 @@ group :development, :test do
|
|
|
15
15
|
gem 'launchy' unless ENV['TRAVIS']
|
|
16
16
|
gem 'byebug' unless ENV['TRAVIS']
|
|
17
17
|
gem 'capybara'
|
|
18
|
+
gem 'poltergeist'
|
|
18
19
|
gem "jettywrapper"
|
|
19
20
|
gem "factory_girl_rails"
|
|
20
21
|
gem "devise"
|
|
@@ -22,4 +23,6 @@ group :development, :test do
|
|
|
22
23
|
gem 'turbolinks'
|
|
23
24
|
gem "bootstrap-sass"
|
|
24
25
|
gem "simplecov", :require => false
|
|
26
|
+
gem "spring"
|
|
27
|
+
gem 'database_cleaner'
|
|
25
28
|
end # (leave this comment here to catch a stray line inserted by blacklight!)
|
data/README.md
CHANGED
|
@@ -24,7 +24,7 @@ Sufia has the following features:
|
|
|
24
24
|
* Activity streams
|
|
25
25
|
* Background jobs
|
|
26
26
|
* Single-use links
|
|
27
|
-
*
|
|
27
|
+
* Analytics
|
|
28
28
|
|
|
29
29
|
## Sufia needs the following software to work:
|
|
30
30
|
1. Solr
|
|
@@ -91,7 +91,7 @@ Add this line:
|
|
|
91
91
|
|
|
92
92
|
Turbolinks does not mix well with Blacklight.
|
|
93
93
|
|
|
94
|
-
###
|
|
94
|
+
### Analytics
|
|
95
95
|
|
|
96
96
|
Sufia provides support for capturing usage information via Google Analytics and for displaying usage stats in the UI.
|
|
97
97
|
|
|
@@ -101,7 +101,7 @@ To enable the Google Analytics javascript snippet, make sure that `config.google
|
|
|
101
101
|
|
|
102
102
|
#### Displaying usage
|
|
103
103
|
|
|
104
|
-
To display
|
|
104
|
+
To display data from Google Analytics in the UI, first head to the Google Developers Console and create a new project:
|
|
105
105
|
|
|
106
106
|
https://console.developers.google.com/project
|
|
107
107
|
|
|
@@ -129,7 +129,9 @@ The generator will create a configuration file at _config/analytics.yml_. Edit
|
|
|
129
129
|
* An application name (you can make this up)
|
|
130
130
|
* An application version (you can make this up)
|
|
131
131
|
|
|
132
|
-
|
|
132
|
+
Lastly, you will need to set `config.analytics = true` in _config/initializers/sufia.rb_ and ensure that the OAuth client email
|
|
133
|
+
has the proper access within your Google Analyics account. To do so, go to the _Admin_ tab for your Google Analytics account.
|
|
134
|
+
Click on _User Management_, in the _Account_ column, and add "Read & Analyze" permissions for the OAuth client email address.
|
|
133
135
|
|
|
134
136
|
### To use browse-everything
|
|
135
137
|
|
data/SUFIA_VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
4.0.0.
|
|
1
|
+
4.0.0.beta3
|
|
Binary file
|
|
@@ -27,6 +27,8 @@
|
|
|
27
27
|
|
|
28
28
|
//= require batch_edit
|
|
29
29
|
//= require terms_of_service
|
|
30
|
+
//
|
|
31
|
+
//= require sufia/app
|
|
30
32
|
//= require sufia/fileupload
|
|
31
33
|
//= require sufia/permissions
|
|
32
34
|
//= require sufia/trophy
|
|
@@ -36,8 +38,11 @@
|
|
|
36
38
|
//= require sufia/edit_metadata
|
|
37
39
|
//= require sufia/single_use_link
|
|
38
40
|
//= require sufia/audio
|
|
41
|
+
//= require sufia/search
|
|
39
42
|
//= require sufia/editor
|
|
43
|
+
//= require sufia/ga_events
|
|
40
44
|
//= require hydra/batch_select
|
|
45
|
+
//= require sufia/dashboard_actions
|
|
41
46
|
//= require hydra_collections
|
|
42
47
|
//= require browse_everything
|
|
43
48
|
//= require jquery.blacklightTagCloud
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Sufia = {};
|
|
@@ -60,8 +60,7 @@
|
|
|
60
60
|
check_all_page();
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
-
|
|
64
|
-
|
|
63
|
+
Blacklight.onLoad(function() {
|
|
65
64
|
// check the select all page cog menu item and select the entire page
|
|
66
65
|
$("[data-behavior='batch-edit-select-page']").bind('click', function(e) {
|
|
67
66
|
e.preventDefault();
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
Blacklight.onLoad(function() {
|
|
2
|
+
// toggle button on or off based on boxes being clicked
|
|
3
|
+
$(".batch_document_selector, .batch_document_selector_all").bind('click', function(e) {
|
|
4
|
+
var n = $(".batch_document_selector:checked").length;
|
|
5
|
+
if (n>0 || $('input#check_all')[0].checked) {
|
|
6
|
+
$('.sort-toggle').hide();
|
|
7
|
+
} else {
|
|
8
|
+
$('.sort-toggle').show();
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
});
|
|
12
|
+
});
|
|
13
|
+
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Blacklight.onLoad(function() {
|
|
2
2
|
// hide the editor initially
|
|
3
|
-
$(
|
|
3
|
+
$('[data-behavior="reveal-editor"]').each(function(){$($(this).data('target')).hide();});
|
|
4
4
|
|
|
5
5
|
// Show the form, hide the preview
|
|
6
6
|
$('[data-behavior="reveal-editor"]').on('click', function(evt) {
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// Callbacks for tracking events using Google Analytics
|
|
2
|
+
|
|
3
|
+
// Note: there is absence of testing here. I'm not sure how or to what extent we can test what's getting
|
|
4
|
+
// sent to Google Analytics.
|
|
5
|
+
|
|
6
|
+
$(document).on('click', '#file_download', function(e) {
|
|
7
|
+
_gaq.push(['_trackEvent', 'Files', 'Downloaded', $(this).data('label')]);
|
|
8
|
+
|
|
9
|
+
});
|
|
10
|
+
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
(function($){
|
|
2
|
+
Sufia.Search = function (element) {
|
|
3
|
+
this.$element = $(element);
|
|
4
|
+
|
|
5
|
+
this.init = function() {
|
|
6
|
+
this.$label = this.$element.find('[data-search-element="label"]');
|
|
7
|
+
this.$items = this.$element.find('[data-search-option]');
|
|
8
|
+
this.$hidden = this.$element.find('input#owner[type="hidden"]');
|
|
9
|
+
this.setDefault();
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
this.init();
|
|
13
|
+
this.attachEvents();
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
Sufia.Search.prototype = {
|
|
18
|
+
attachEvents: function() {
|
|
19
|
+
|
|
20
|
+
_this = this;
|
|
21
|
+
this.$items.on('click', function(event) {
|
|
22
|
+
event.preventDefault();
|
|
23
|
+
_this.clicked($(this))
|
|
24
|
+
});
|
|
25
|
+
},
|
|
26
|
+
|
|
27
|
+
clicked: function($anchor) {
|
|
28
|
+
this.setLabel($anchor.data('search-label'));
|
|
29
|
+
this.$hidden.val($anchor.data('search-option'));
|
|
30
|
+
},
|
|
31
|
+
|
|
32
|
+
// Grab the "owner" value out of the hidden field
|
|
33
|
+
getDefaultValue: function () {
|
|
34
|
+
return this.$hidden.val();
|
|
35
|
+
},
|
|
36
|
+
|
|
37
|
+
getLabelForValue: function(value) {
|
|
38
|
+
selected = this.$element.find('[data-search-option="'+ value +'"]');
|
|
39
|
+
return selected.data('search-label');
|
|
40
|
+
},
|
|
41
|
+
|
|
42
|
+
setDefault: function() {
|
|
43
|
+
this.setLabel(this.getLabelForValue(this.getDefaultValue()));
|
|
44
|
+
},
|
|
45
|
+
|
|
46
|
+
setLabel: function(label) {
|
|
47
|
+
this.$label.html(label);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
$.fn.search = function(option) {
|
|
53
|
+
return this.each(function() {
|
|
54
|
+
var $this = $(this);
|
|
55
|
+
var data = $this.data('search');
|
|
56
|
+
|
|
57
|
+
if (!data) $this.data('search', (data = new Sufia.Search(this)));
|
|
58
|
+
})
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
})(jQuery);
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
Blacklight.onLoad(function() {
|
|
65
|
+
$('#search-form-header').search();
|
|
66
|
+
});
|
|
67
|
+
|
|
@@ -89,4 +89,18 @@ $gray-lighter: #eee;
|
|
|
89
89
|
|
|
90
90
|
.visibility-link:hover {
|
|
91
91
|
text-decoration: none;
|
|
92
|
-
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
#collection-list-container {
|
|
95
|
+
.collection-list {
|
|
96
|
+
li {
|
|
97
|
+
list-style: none;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
.modal-footer {
|
|
101
|
+
div, form {
|
|
102
|
+
display: inline;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
@@ -14,8 +14,20 @@
|
|
|
14
14
|
*= require nestable
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
+
@import 'bootstrap';
|
|
18
|
+
|
|
19
|
+
@import 'blacklight/blacklight';
|
|
17
20
|
@import "browse_everything";
|
|
21
|
+
|
|
18
22
|
#browse-everything {
|
|
19
23
|
top:10%;
|
|
20
24
|
background-color: initial;
|
|
21
25
|
}
|
|
26
|
+
|
|
27
|
+
/* use if a label should be hidden from view but available to screen readers */
|
|
28
|
+
/* we could switch to .sr-only instead */
|
|
29
|
+
.accessible-hidden {
|
|
30
|
+
position: absolute !important;
|
|
31
|
+
clip: rect(1px 1px 1px 1px); /* IE6, IE7 */
|
|
32
|
+
clip: rect(1px, 1px, 1px, 1px);
|
|
33
|
+
}
|
|
@@ -4,11 +4,11 @@ require 'cgi'
|
|
|
4
4
|
class AuthoritiesController < ApplicationController
|
|
5
5
|
def query
|
|
6
6
|
s = params.fetch("q", "")
|
|
7
|
-
if
|
|
8
|
-
|
|
7
|
+
hits = if params[:term] == "location"
|
|
8
|
+
GeoNamesResource.find_location(s)
|
|
9
9
|
else
|
|
10
|
-
|
|
10
|
+
LocalAuthority.entries_by_term(params[:model], params[:term], s) rescue []
|
|
11
11
|
end
|
|
12
|
-
render :
|
|
12
|
+
render json: hits
|
|
13
13
|
end
|
|
14
14
|
end
|
|
@@ -4,24 +4,24 @@ class BatchController < ApplicationController
|
|
|
4
4
|
layout "sufia-one-column"
|
|
5
5
|
|
|
6
6
|
before_filter :has_access?
|
|
7
|
-
prepend_before_filter :normalize_identifier, :
|
|
7
|
+
prepend_before_filter :normalize_identifier, only: [:edit, :show, :update, :destroy]
|
|
8
8
|
|
|
9
9
|
def edit
|
|
10
10
|
@batch = Batch.find_or_create(params[:id])
|
|
11
11
|
@generic_file = GenericFile.new
|
|
12
12
|
@generic_file.creator = current_user.name
|
|
13
|
-
@generic_file.title =
|
|
13
|
+
@generic_file.title = @batch.generic_files.map(&:label)
|
|
14
14
|
@generic_file.initialize_fields
|
|
15
15
|
end
|
|
16
16
|
|
|
17
17
|
def update
|
|
18
18
|
authenticate_user!
|
|
19
|
-
@batch =
|
|
19
|
+
@batch = Batch.find_or_create(params[:id])
|
|
20
20
|
@batch.status="processing"
|
|
21
21
|
@batch.save
|
|
22
22
|
Sufia.queue.push(BatchUpdateJob.new(current_user.user_key, params))
|
|
23
23
|
flash[:notice] = 'Your files are being processed by ' + t('sufia.product_name') + ' in the background. The metadata and access controls you specified are being applied. Files will be marked <span class="label label-important" title="Private">Private</span> until this process is complete (shouldn\'t take too long, hang in there!). You may need to refresh your dashboard to see these updates.'
|
|
24
|
-
redirect_to sufia.
|
|
24
|
+
redirect_to sufia.dashboard_files_path
|
|
25
25
|
end
|
|
26
26
|
|
|
27
27
|
protected
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
class CollectionsController < ApplicationController
|
|
3
|
+
include Hydra::CollectionsControllerBehavior
|
|
4
|
+
include Blacklight::Catalog::SearchContext
|
|
5
|
+
include BlacklightAdvancedSearch::ParseBasicQ
|
|
6
|
+
include BlacklightAdvancedSearch::Controller
|
|
7
|
+
include Sufia::Noid # for normalize_identifier method
|
|
8
|
+
prepend_before_filter :normalize_identifier, except: [:index, :create, :new]
|
|
9
|
+
before_filter :filter_docs_with_read_access!, except: :show
|
|
10
|
+
before_filter :has_access?, except: :show
|
|
11
|
+
before_filter :initialize_fields_for_edit, only: [:edit, :new]
|
|
12
|
+
CollectionsController.solr_search_params_logic += [:add_access_controls_to_solr_params]
|
|
13
|
+
|
|
14
|
+
layout "sufia-one-column"
|
|
15
|
+
|
|
16
|
+
protected
|
|
17
|
+
|
|
18
|
+
def query_collection_members
|
|
19
|
+
flash[:notice]=nil if flash[:notice] == "Select something first"
|
|
20
|
+
query = params[:cq]
|
|
21
|
+
|
|
22
|
+
#merge in the user parameters and the attach the collection query
|
|
23
|
+
solr_params = (params.symbolize_keys).merge(q: query)
|
|
24
|
+
|
|
25
|
+
# run the solr query to find the collections
|
|
26
|
+
(@response, @member_docs) = get_search_results(solr_params)
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
def after_destroy(id)
|
|
30
|
+
respond_to do |format|
|
|
31
|
+
format.html { redirect_to sufia.dashboard_collections_path, notice: 'Collection was successfully deleted.' }
|
|
32
|
+
format.json { render json: {id: id}, status: :destroyed, location: @collection }
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
def initialize_fields_for_edit
|
|
37
|
+
@collection.initialize_fields
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
def _prefixes
|
|
41
|
+
@_prefixes ||= super + ['catalog']
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
end
|
|
@@ -5,52 +5,7 @@ module Sufia
|
|
|
5
5
|
self.solr_search_params_logic += [:only_generic_files]
|
|
6
6
|
end
|
|
7
7
|
|
|
8
|
-
def index
|
|
9
|
-
setup_front_page unless has_search_parameters?
|
|
10
|
-
super
|
|
11
|
-
end
|
|
12
|
-
|
|
13
8
|
protected
|
|
14
|
-
def setup_front_page
|
|
15
|
-
@featured_researcher = ContentBlock.find_or_create_by(name: 'featured_researcher')
|
|
16
|
-
@featured_work_list = FeaturedWorkList.new
|
|
17
|
-
recent
|
|
18
|
-
recent_me # also grab my recent docs too
|
|
19
|
-
end
|
|
20
|
-
|
|
21
|
-
def recent
|
|
22
|
-
if user_signed_in?
|
|
23
|
-
# grab other people's documents
|
|
24
|
-
(_, @recent_documents) = get_search_results(:q =>filter_not_mine,
|
|
25
|
-
:sort=>sort_field, :rows=>4)
|
|
26
|
-
else
|
|
27
|
-
# grab any documents we do not know who you are
|
|
28
|
-
(_, @recent_documents) = get_search_results(:q =>'', :sort=>sort_field, :rows=>4)
|
|
29
|
-
end
|
|
30
|
-
end
|
|
31
|
-
|
|
32
|
-
def recent_me
|
|
33
|
-
if user_signed_in?
|
|
34
|
-
(_, @recent_user_documents) = get_search_results(:q =>filter_mine,
|
|
35
|
-
:sort=>sort_field, :rows=>4)
|
|
36
|
-
end
|
|
37
|
-
end
|
|
38
|
-
|
|
39
|
-
def filter_not_mine
|
|
40
|
-
"{!lucene q.op=AND df=#{depositor}}-#{current_user.user_key}"
|
|
41
|
-
end
|
|
42
|
-
|
|
43
|
-
def filter_mine
|
|
44
|
-
"{!lucene q.op=AND df=#{depositor}}#{current_user.user_key}"
|
|
45
|
-
end
|
|
46
|
-
|
|
47
|
-
def depositor
|
|
48
|
-
Solrizer.solr_name('depositor', :stored_searchable, type: :string)
|
|
49
|
-
end
|
|
50
|
-
|
|
51
|
-
def sort_field
|
|
52
|
-
"#{Solrizer.solr_name('system_create', :sortable)} desc"
|
|
53
|
-
end
|
|
54
9
|
|
|
55
10
|
# Limits search results just to GenericFiles
|
|
56
11
|
# @param solr_parameters the current solr parameters
|
|
@@ -60,5 +15,14 @@ module Sufia
|
|
|
60
15
|
solr_parameters[:fq] << "#{Solrizer.solr_name("has_model", :symbol)}:\"info:fedora/afmodel:GenericFile\""
|
|
61
16
|
end
|
|
62
17
|
|
|
18
|
+
# If they've selected "owner=mine" then restrict to files I have edit access to
|
|
19
|
+
def discovery_permissions
|
|
20
|
+
if params['owner'] == 'mine'
|
|
21
|
+
["edit"]
|
|
22
|
+
else
|
|
23
|
+
super
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
|
|
63
27
|
end
|
|
64
28
|
end
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
module Sufia::Controller
|
|
2
2
|
extend ActiveSupport::Concern
|
|
3
3
|
|
|
4
|
-
included do
|
|
4
|
+
included do
|
|
5
5
|
# Adds Hydra behaviors into the application controller
|
|
6
6
|
include Hydra::Controller::ControllerBehavior
|
|
7
7
|
|
|
@@ -14,40 +14,31 @@ module Sufia::Controller
|
|
|
14
14
|
|
|
15
15
|
def render_404(exception)
|
|
16
16
|
logger.error("Rendering 404 page due to exception: #{exception.inspect} - #{exception.backtrace if exception.respond_to? :backtrace}")
|
|
17
|
-
render :
|
|
17
|
+
render template: '/error/404', layout: "error", formats: [:html], status: 404
|
|
18
18
|
end
|
|
19
19
|
|
|
20
20
|
def render_500(exception)
|
|
21
21
|
logger.error("Rendering 500 page due to exception: #{exception.inspect} - #{exception.backtrace if exception.respond_to? :backtrace}")
|
|
22
|
-
render :
|
|
22
|
+
render template: '/error/500', layout: "error", formats: [:html], status: 500
|
|
23
23
|
end
|
|
24
24
|
|
|
25
25
|
def render_single_use_error(exception)
|
|
26
26
|
logger.error("Rendering PAGE due to exception: #{exception.inspect} - #{exception.backtrace if exception.respond_to? :backtrace}")
|
|
27
|
-
render :
|
|
27
|
+
render template: '/error/single_use_error', layout: "error", formats: [:html], status: 404
|
|
28
28
|
end
|
|
29
29
|
|
|
30
30
|
def notifications_number
|
|
31
|
-
@notify_number=0
|
|
32
|
-
@batches=[]
|
|
31
|
+
@notify_number = 0
|
|
32
|
+
@batches = []
|
|
33
33
|
return if action_name == "index" && controller_name == "mailbox"
|
|
34
|
-
if user_signed_in?
|
|
35
|
-
@notify_number= current_user.mailbox.inbox(:
|
|
36
|
-
@batches=current_user.mailbox.inbox.map {|msg| msg.last_message.body[/<span class="batchid ui-helper-hidden">(.*)<\/span>The file(.*)/,1]}.select{|val| !val.blank?}
|
|
34
|
+
if user_signed_in?
|
|
35
|
+
@notify_number = current_user.mailbox.inbox(unread: true).count
|
|
36
|
+
@batches = current_user.mailbox.inbox.map { |msg| msg.last_message.body[/<span class="batchid ui-helper-hidden">(.*)<\/span>The file(.*)/,1] }.select{ |val| !val.blank? }
|
|
37
37
|
end
|
|
38
38
|
end
|
|
39
|
-
|
|
39
|
+
|
|
40
40
|
def search_layout
|
|
41
|
-
|
|
42
|
-
"sufia-two-column"
|
|
43
|
-
else
|
|
44
|
-
"homepage"
|
|
45
|
-
end
|
|
46
|
-
end
|
|
47
|
-
|
|
48
|
-
# This repeats has_search_parameters? method from Blacklight::CatalogHelperBehavior
|
|
49
|
-
def has_search_parameters?
|
|
50
|
-
!params[:q].blank? or !params[:f].blank? or !params[:search_field].blank?
|
|
41
|
+
"sufia-two-column"
|
|
51
42
|
end
|
|
52
43
|
|
|
53
44
|
protected
|
|
@@ -56,5 +47,4 @@ module Sufia::Controller
|
|
|
56
47
|
def has_access?
|
|
57
48
|
true
|
|
58
49
|
end
|
|
59
|
-
|
|
60
50
|
end
|