commonwealth-vlr-engine 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +91 -0
- data/.gitmodules +3 -0
- data/Gemfile +20 -0
- data/LICENSE +202 -0
- data/README.md +38 -0
- data/Rakefile +43 -0
- data/app/assets/images/commonwealth-vlr-engine/bplLoginButton.png +0 -0
- data/app/assets/images/commonwealth-vlr-engine/dc_audio-icon.png +0 -0
- data/app/assets/images/commonwealth-vlr-engine/dc_collection-icon.png +0 -0
- data/app/assets/images/commonwealth-vlr-engine/dc_image-icon.png +0 -0
- data/app/assets/images/commonwealth-vlr-engine/dc_institution-icon.png +0 -0
- data/app/assets/images/commonwealth-vlr-engine/dc_moving-image-icon.png +0 -0
- data/app/assets/images/commonwealth-vlr-engine/dc_text-icon.png +0 -0
- data/app/assets/images/commonwealth-vlr-engine/facebookLoginButton.png +0 -0
- data/app/assets/images/commonwealth-vlr-engine/loading-wdl-grid.gif +0 -0
- data/app/assets/images/commonwealth-vlr-engine/loading-wdl.gif +0 -0
- data/app/assets/images/commonwealth-vlr-engine/loading.gif +0 -0
- data/app/assets/images/commonwealth-vlr-engine/openseadragon/fullpage_grouphover.png +0 -0
- data/app/assets/images/commonwealth-vlr-engine/openseadragon/fullpage_hover.png +0 -0
- data/app/assets/images/commonwealth-vlr-engine/openseadragon/fullpage_pressed.png +0 -0
- data/app/assets/images/commonwealth-vlr-engine/openseadragon/fullpage_rest.png +0 -0
- data/app/assets/images/commonwealth-vlr-engine/openseadragon/home_grouphover.png +0 -0
- data/app/assets/images/commonwealth-vlr-engine/openseadragon/home_hover.png +0 -0
- data/app/assets/images/commonwealth-vlr-engine/openseadragon/home_pressed.png +0 -0
- data/app/assets/images/commonwealth-vlr-engine/openseadragon/home_rest.png +0 -0
- data/app/assets/images/commonwealth-vlr-engine/openseadragon/next_grouphover.png +0 -0
- data/app/assets/images/commonwealth-vlr-engine/openseadragon/next_hover.png +0 -0
- data/app/assets/images/commonwealth-vlr-engine/openseadragon/next_pressed.png +0 -0
- data/app/assets/images/commonwealth-vlr-engine/openseadragon/next_rest.png +0 -0
- data/app/assets/images/commonwealth-vlr-engine/openseadragon/previous_grouphover.png +0 -0
- data/app/assets/images/commonwealth-vlr-engine/openseadragon/previous_hover.png +0 -0
- data/app/assets/images/commonwealth-vlr-engine/openseadragon/previous_pressed.png +0 -0
- data/app/assets/images/commonwealth-vlr-engine/openseadragon/previous_rest.png +0 -0
- data/app/assets/images/commonwealth-vlr-engine/openseadragon/rotateleft_grouphover.png +0 -0
- data/app/assets/images/commonwealth-vlr-engine/openseadragon/rotateleft_hover.png +0 -0
- data/app/assets/images/commonwealth-vlr-engine/openseadragon/rotateleft_pressed.png +0 -0
- data/app/assets/images/commonwealth-vlr-engine/openseadragon/rotateleft_rest.png +0 -0
- data/app/assets/images/commonwealth-vlr-engine/openseadragon/rotateright_grouphover.png +0 -0
- data/app/assets/images/commonwealth-vlr-engine/openseadragon/rotateright_hover.png +0 -0
- data/app/assets/images/commonwealth-vlr-engine/openseadragon/rotateright_pressed.png +0 -0
- data/app/assets/images/commonwealth-vlr-engine/openseadragon/rotateright_rest.png +0 -0
- data/app/assets/images/commonwealth-vlr-engine/openseadragon/zoomin_grouphover.png +0 -0
- data/app/assets/images/commonwealth-vlr-engine/openseadragon/zoomin_hover.png +0 -0
- data/app/assets/images/commonwealth-vlr-engine/openseadragon/zoomin_pressed.png +0 -0
- data/app/assets/images/commonwealth-vlr-engine/openseadragon/zoomin_rest.png +0 -0
- data/app/assets/images/commonwealth-vlr-engine/openseadragon/zoomout_grouphover.png +0 -0
- data/app/assets/images/commonwealth-vlr-engine/openseadragon/zoomout_hover.png +0 -0
- data/app/assets/images/commonwealth-vlr-engine/openseadragon/zoomout_pressed.png +0 -0
- data/app/assets/images/commonwealth-vlr-engine/openseadragon/zoomout_rest.png +0 -0
- data/app/assets/images/commonwealth-vlr-engine/vlr_logo_img.png +0 -0
- data/app/assets/javascripts/blacklight_gallery.js +1 -0
- data/app/assets/javascripts/blacklight_google_analytics/blacklight_google_analytics.js.erb +165 -0
- data/app/assets/javascripts/bootstrap-accessibility-plugin/bootstrap-accessibility.js +586 -0
- data/app/assets/javascripts/commonwealth-vlr-engine.js +22 -0
- data/app/assets/javascripts/commonwealth-vlr-engine/collection_facets.js +5 -0
- data/app/assets/javascripts/commonwealth-vlr-engine/disable_dropdown_nav.js +21 -0
- data/app/assets/javascripts/commonwealth-vlr-engine/feedback_alerts.js.erb +19 -0
- data/app/assets/javascripts/commonwealth-vlr-engine/folder_tools.js +26 -0
- data/app/assets/javascripts/commonwealth-vlr-engine/multi_img_viewer.js.erb +20 -0
- data/app/assets/javascripts/commonwealth-vlr-engine/ocr_search_utils.js.erb +32 -0
- data/app/assets/javascripts/commonwealth-vlr-engine/volumes_list.js +5 -0
- data/app/assets/javascripts/openseadragon.js +2 -0
- data/app/assets/javascripts/respond/respond.min.js +6 -0
- data/app/assets/javascripts/wdl-viewer/fd-slider.js +1303 -0
- data/app/assets/javascripts/wdl-viewer/jquery-deparam.js +113 -0
- data/app/assets/javascripts/wdl-viewer/jquery.ba-throttle-debounce.min.js +9 -0
- data/app/assets/javascripts/wdl-viewer/jquery.hammer.min.js +7 -0
- data/app/assets/javascripts/wdl-viewer/modernizr-wdl.min.js +3 -0
- data/app/assets/javascripts/wdl-viewer/wdl-search.js +33 -0
- data/app/assets/javascripts/wdl-viewer/wdl-viewer_commonwealth.js +1147 -0
- data/app/assets/stylesheets/blacklight_advanced_search.css +5 -0
- data/app/assets/stylesheets/blacklight_gallery.css +1 -0
- data/app/assets/stylesheets/blacklight_maps.css +1 -0
- data/app/assets/stylesheets/bootstrap-accessibility-plugin/bootstrap-accessibility.css +105 -0
- data/app/assets/stylesheets/commonwealth-vlr-engine/advanced_search.scss +139 -0
- data/app/assets/stylesheets/commonwealth-vlr-engine/basic_search.scss +47 -0
- data/app/assets/stylesheets/commonwealth-vlr-engine/book_viewer.scss +576 -0
- data/app/assets/stylesheets/commonwealth-vlr-engine/carousel.scss +94 -0
- data/app/assets/stylesheets/commonwealth-vlr-engine/cmmnwlth_defaults.scss +45 -0
- data/app/assets/stylesheets/commonwealth-vlr-engine/cmmnwlth_shared.scss +75 -0
- data/app/assets/stylesheets/commonwealth-vlr-engine/collections.scss +563 -0
- data/app/assets/stylesheets/commonwealth-vlr-engine/commonwealth-vlr-engine.css +32 -0
- data/app/assets/stylesheets/commonwealth-vlr-engine/facets.scss +111 -0
- data/app/assets/stylesheets/commonwealth-vlr-engine/feedback.scss +10 -0
- data/app/assets/stylesheets/commonwealth-vlr-engine/folders.scss +276 -0
- data/app/assets/stylesheets/commonwealth-vlr-engine/footer.scss +47 -0
- data/app/assets/stylesheets/commonwealth-vlr-engine/header.scss +329 -0
- data/app/assets/stylesheets/commonwealth-vlr-engine/home.scss +269 -0
- data/app/assets/stylesheets/commonwealth-vlr-engine/index.scss +580 -0
- data/app/assets/stylesheets/commonwealth-vlr-engine/institutions.scss +246 -0
- data/app/assets/stylesheets/commonwealth-vlr-engine/pages.scss +31 -0
- data/app/assets/stylesheets/commonwealth-vlr-engine/search_inside.scss +172 -0
- data/app/assets/stylesheets/commonwealth-vlr-engine/searches.scss +55 -0
- data/app/assets/stylesheets/commonwealth-vlr-engine/show.scss +840 -0
- data/app/assets/stylesheets/commonwealth-vlr-engine/signin.scss +43 -0
- data/app/assets/stylesheets/commonwealth-vlr-engine/users.scss +18 -0
- data/app/assets/stylesheets/commonwealth-vlr-engine/vlr_dependencies.css +8 -0
- data/app/assets/stylesheets/ie_fixes.css +16 -0
- data/app/assets/stylesheets/openseadragon.css +1 -0
- data/app/assets/stylesheets/wdl-viewer/fd-slider.min.css +2 -0
- data/app/controllers/blacklight_advanced_search/advanced_controller.rb +66 -0
- data/app/controllers/bookmarks_controller.rb +38 -0
- data/app/controllers/collections_controller.rb +128 -0
- data/app/controllers/commonwealth_vlr_engine/application_controller.rb +8 -0
- data/app/controllers/feedback_controller.rb +39 -0
- data/app/controllers/folder_items_actions_controller.rb +72 -0
- data/app/controllers/folder_items_controller.rb +90 -0
- data/app/controllers/folders_controller.rb +132 -0
- data/app/controllers/iiif_manifest_controller.rb +74 -0
- data/app/controllers/image_viewer_controller.rb +34 -0
- data/app/controllers/institutions_controller.rb +62 -0
- data/app/controllers/ocr_search_controller.rb +78 -0
- data/app/controllers/pages_controller.rb +5 -0
- data/app/controllers/users/omniauth_callbacks_controller.rb +10 -0
- data/app/controllers/users/registrations_controller.rb +3 -0
- data/app/controllers/users/sessions_controller.rb +3 -0
- data/app/controllers/users_controller.rb +27 -0
- data/app/helpers/blacklight_maps_helper.rb +3 -0
- data/app/helpers/collections_helper.rb +3 -0
- data/app/helpers/commonwealth_vlr_engine/application_helper.rb +200 -0
- data/app/helpers/commonwealth_vlr_engine/blacklight_helper.rb +35 -0
- data/app/helpers/commonwealth_vlr_engine/blacklight_url_helper.rb +53 -0
- data/app/helpers/commonwealth_vlr_engine/catalog_helper.rb +414 -0
- data/app/helpers/commonwealth_vlr_engine/collections_helper_behavior.rb +19 -0
- data/app/helpers/commonwealth_vlr_engine/component_helper.rb +22 -0
- data/app/helpers/commonwealth_vlr_engine/facets_helper.rb +20 -0
- data/app/helpers/commonwealth_vlr_engine/feedback_helper_behavior.rb +14 -0
- data/app/helpers/commonwealth_vlr_engine/folders_helper_behavior.rb +9 -0
- data/app/helpers/commonwealth_vlr_engine/image_viewer_helper_behavior.rb +14 -0
- data/app/helpers/commonwealth_vlr_engine/institutions_helper_behavior.rb +31 -0
- data/app/helpers/commonwealth_vlr_engine/layout_helper.rb +22 -0
- data/app/helpers/commonwealth_vlr_engine/ocr_search_helper_behavior.rb +48 -0
- data/app/helpers/commonwealth_vlr_engine/pages_helper_behavior.rb +38 -0
- data/app/helpers/commonwealth_vlr_engine/vlr_blacklight_maps_helper_behavior.rb +59 -0
- data/app/helpers/feedback_helper.rb +3 -0
- data/app/helpers/folders_helper.rb +3 -0
- data/app/helpers/image_viewer_helper.rb +3 -0
- data/app/helpers/institutions_helper.rb +3 -0
- data/app/helpers/ocr_search_helper.rb +3 -0
- data/app/helpers/pages_helper.rb +3 -0
- data/app/mailers/notifier.rb +5 -0
- data/app/models/carousel_slide.rb +7 -0
- data/app/models/record_mailer.rb +18 -0
- data/app/models/user.rb +15 -0
- data/app/views/advanced/_advanced_search_date.html.erb +23 -0
- data/app/views/advanced/_advanced_search_facets.html.erb +5 -0
- data/app/views/advanced/_advanced_search_fields.html.erb +39 -0
- data/app/views/advanced/_advanced_search_form.html.erb +51 -0
- data/app/views/advanced/_advanced_search_help.html.erb +13 -0
- data/app/views/advanced/_facet_layout.html.erb +9 -0
- data/app/views/advanced/_facet_limit.html.erb +15 -0
- data/app/views/advanced/index.html.erb +29 -0
- data/app/views/blacklight_advanced_search/_facet_limit.html.erb +12 -0
- data/app/views/bookmarks/_tools.html.erb +25 -0
- data/app/views/bookmarks/index.html.erb +64 -0
- data/app/views/bookmarks/update.js.erb +1 -0
- data/app/views/bpluser/folders/_folder.html.erb +36 -0
- data/app/views/catalog/_add_this.html.erb +10 -0
- data/app/views/catalog/_az_links.html.erb +15 -0
- data/app/views/catalog/_basic_search.html.erb +67 -0
- data/app/views/catalog/_citation.html.erb +50 -0
- data/app/views/catalog/_constraints.html.erb +26 -0
- data/app/views/catalog/_document_collections_gallery.html.erb +7 -0
- data/app/views/catalog/_facet_limit_series.html.erb +21 -0
- data/app/views/catalog/_facets.html.erb +31 -0
- data/app/views/catalog/_facets_series.html.erb +4 -0
- data/app/views/catalog/_folder_item_control.html.erb +64 -0
- data/app/views/catalog/_index_collections_gallery.html.erb +12 -0
- data/app/views/catalog/_index_gallery.html.erb +11 -0
- data/app/views/catalog/_index_header_default.html.erb +22 -0
- data/app/views/catalog/_index_list_collection.html.erb +33 -0
- data/app/views/catalog/_index_list_default.html.erb +13 -0
- data/app/views/catalog/_index_map_institutions.html.erb +10 -0
- data/app/views/catalog/_index_masonry.html.erb +8 -0
- data/app/views/catalog/_index_slideshow.html.erb +18 -0
- data/app/views/catalog/_more_like_this.html.erb +9 -0
- data/app/views/catalog/_opengraph.html.erb +16 -0
- data/app/views/catalog/_previous_next_doc.html.erb +22 -0
- data/app/views/catalog/_results_pagination.html.erb +9 -0
- data/app/views/catalog/_search_form.html.erb +23 -0
- data/app/views/catalog/_search_header.html.erb +5 -0
- data/app/views/catalog/_show_default.html.erb +75 -0
- data/app/views/catalog/_show_main_content.html.erb +27 -0
- data/app/views/catalog/_show_more_like_this.html.erb +15 -0
- data/app/views/catalog/_show_partials/_show_book_viewer_link.html.erb +25 -0
- data/app/views/catalog/_show_partials/_show_default_img.html.erb +32 -0
- data/app/views/catalog/_show_partials/_show_default_metadata.html.erb +486 -0
- data/app/views/catalog/_show_partials/_show_default_simple_img_viewer.html.erb +45 -0
- data/app/views/catalog/_show_partials/_show_downloads.html.erb +14 -0
- data/app/views/catalog/_show_partials/_show_flagged_notice.html.erb +29 -0
- data/app/views/catalog/_show_partials/_show_multi_img.html.erb +42 -0
- data/app/views/catalog/_show_partials/_show_multi_img_pagination.html.erb +20 -0
- data/app/views/catalog/_show_partials/_show_oai_item_img.html.erb +5 -0
- data/app/views/catalog/_show_partials/_show_oai_item_link.html.erb +8 -0
- data/app/views/catalog/_show_partials/_show_prev_next_carousel_links.html.erb +17 -0
- data/app/views/catalog/_show_partials/_show_volumes.html.erb +52 -0
- data/app/views/catalog/_show_sidebar.html.erb +1 -0
- data/app/views/catalog/_show_tools.html.erb +42 -0
- data/app/views/catalog/_zero_results.html.erb +20 -0
- data/app/views/catalog/email.html.erb +6 -0
- data/app/views/catalog/index.html.erb +17 -0
- data/app/views/catalog/metadata_view.html.erb +7 -0
- data/app/views/catalog/show.html.erb +13 -0
- data/app/views/collections/_search_form_collection.html.erb +23 -0
- data/app/views/collections/index.html.erb +30 -0
- data/app/views/collections/show.html.erb +116 -0
- data/app/views/devise/confirmations/new.html.erb +14 -0
- data/app/views/devise/mailer/reset_password_instructions.html.erb +13 -0
- data/app/views/devise/passwords/edit.html.erb +33 -0
- data/app/views/devise/passwords/new.html.erb +31 -0
- data/app/views/devise/registrations/edit.html.erb +83 -0
- data/app/views/devise/registrations/new.html.erb +53 -0
- data/app/views/devise/sessions/new.html.erb +75 -0
- data/app/views/devise/shared/_links.erb +29 -0
- data/app/views/feedback/complete.html.erb +9 -0
- data/app/views/feedback/show.html.erb +61 -0
- data/app/views/folder_items/create.js.erb +1 -0
- data/app/views/folder_items/destroy.js.erb +1 -0
- data/app/views/folder_items/item_actions.js.erb +2 -0
- data/app/views/folder_items/update.js.erb +1 -0
- data/app/views/folders/_in_folder.html.erb +2 -0
- data/app/views/folders/_new_edit_form_fields.html.erb +36 -0
- data/app/views/folders/edit.html.erb +25 -0
- data/app/views/folders/index.html.erb +73 -0
- data/app/views/folders/new.html.erb +27 -0
- data/app/views/folders/public_list.html.erb +44 -0
- data/app/views/folders/show.html.erb +98 -0
- data/app/views/image_viewer/_book_viewer_help.html.erb +125 -0
- data/app/views/image_viewer/_render_book_viewer.html.erb +185 -0
- data/app/views/image_viewer/book_viewer.html.erb +57 -0
- data/app/views/image_viewer/show.js.erb +19 -0
- data/app/views/institutions/_intro_text.html.erb +1 -0
- data/app/views/institutions/_map_institutions_search.html.erb +9 -0
- data/app/views/institutions/_search_form_institution.html.erb +24 -0
- data/app/views/institutions/index.html.erb +31 -0
- data/app/views/institutions/show.html.erb +104 -0
- data/app/views/layouts/_google_analytics.html.erb +9 -0
- data/app/views/layouts/book_viewer.html.erb +37 -0
- data/app/views/layouts/commonwealth-vlr-engine.html.erb +59 -0
- data/app/views/notifier/feedback.text.erb +6 -0
- data/app/views/ocr_search/_index_ocr_list.html.erb +17 -0
- data/app/views/ocr_search/_search_form_ocr.html.erb +23 -0
- data/app/views/ocr_search/_snippets_more.html.erb +15 -0
- data/app/views/ocr_search/_zero_results_ocr.html.erb +9 -0
- data/app/views/ocr_search/index.html.erb +49 -0
- data/app/views/pages/_carousel.html.erb +46 -0
- data/app/views/pages/_home_partials/_banner.html.erb +23 -0
- data/app/views/pages/_home_partials/_browse.html.erb +55 -0
- data/app/views/pages/_home_partials/_context.html.erb +24 -0
- data/app/views/pages/_home_partials/_home_content.html.erb +14 -0
- data/app/views/pages/about.html.erb +10 -0
- data/app/views/pages/about_site.html.erb +6 -0
- data/app/views/pages/explore.html.erb +32 -0
- data/app/views/pages/home.html.erb +3 -0
- data/app/views/record_mailer/email_record.text.erb +7 -0
- data/app/views/saved_searches/index.html.erb +60 -0
- data/app/views/search_history/index.html.erb +59 -0
- data/app/views/shared/_error_messages.html.erb +9 -0
- data/app/views/shared/_flash_msg_maintenance.html.erb +6 -0
- data/app/views/shared/_folder_item_actions.html.erb +66 -0
- data/app/views/shared/_folder_tools.html.erb +4 -0
- data/app/views/shared/_footer.html.erb +14 -0
- data/app/views/shared/_header_navbar.html.erb +34 -0
- data/app/views/shared/_nav_links.html.erb +58 -0
- data/app/views/shared/_search_form_header.html.erb +16 -0
- data/app/views/shared/_tools.html.erb +14 -0
- data/app/views/shared/_user_util_links.html.erb +43 -0
- data/app/views/users/show.html.erb +33 -0
- data/commonwealth-vlr-engine.gemspec +47 -0
- data/config/initializers/patch_blacklight_advanced_search.rb +74 -0
- data/config/initializers/patch_blacklight_maps.rb +20 -0
- data/config/jetty.yml +7 -0
- data/config/locales/commonwealth-vlr-engine.en.yml +463 -0
- data/config/routes.rb +92 -0
- data/lib/commonwealth-vlr-engine.rb +55 -0
- data/lib/commonwealth-vlr-engine/commonwealth_search_builder.rb +66 -0
- data/lib/commonwealth-vlr-engine/controller.rb +69 -0
- data/lib/commonwealth-vlr-engine/controller_override.rb +238 -0
- data/lib/commonwealth-vlr-engine/engine.rb +40 -0
- data/lib/commonwealth-vlr-engine/finder.rb +285 -0
- data/lib/commonwealth-vlr-engine/iiif_manifest.rb +189 -0
- data/lib/commonwealth-vlr-engine/notifier.rb +33 -0
- data/lib/commonwealth-vlr-engine/pages.rb +33 -0
- data/lib/commonwealth-vlr-engine/render_constraints_override.rb +57 -0
- data/lib/commonwealth-vlr-engine/route_sets.rb +49 -0
- data/lib/commonwealth-vlr-engine/routes.rb +21 -0
- data/lib/commonwealth-vlr-engine/version.rb +3 -0
- data/lib/generators/commonwealth_vlr_engine/controller_generator.rb +92 -0
- data/lib/generators/commonwealth_vlr_engine/environment_generator.rb +49 -0
- data/lib/generators/commonwealth_vlr_engine/install_generator.rb +57 -0
- data/lib/generators/commonwealth_vlr_engine/localassets_generator.rb +29 -0
- data/lib/generators/commonwealth_vlr_engine/model_generator.rb +65 -0
- data/lib/generators/commonwealth_vlr_engine/routes_generator.rb +39 -0
- data/lib/generators/commonwealth_vlr_engine/templates/commonwealth_vlr_engine.css.scss +4 -0
- data/lib/generators/commonwealth_vlr_engine/templates/config/contact_emails.yml.sample +13 -0
- data/lib/generators/commonwealth_vlr_engine/templates/config/fedora.yml.sample +6 -0
- data/lib/generators/commonwealth_vlr_engine/templates/config/geojson_static_file.yml.sample +11 -0
- data/lib/generators/commonwealth_vlr_engine/templates/config/google_analytics.yml.sample +10 -0
- data/lib/generators/commonwealth_vlr_engine/templates/config/iiif_server.yml.sample +10 -0
- data/lib/generators/commonwealth_vlr_engine/templates/config/initializers/a_load_commonwealth_vlr_configs.rb +14 -0
- data/lib/generators/commonwealth_vlr_engine/templates/config/initializers/devise.rb +269 -0
- data/lib/generators/commonwealth_vlr_engine/templates/config/initializers/secret_token.rb +8 -0
- data/lib/generators/commonwealth_vlr_engine/templates/config/locales/blacklight.en.yml +44 -0
- data/lib/generators/commonwealth_vlr_engine/templates/config/locales/devise.en.yml +12 -0
- data/lib/generators/commonwealth_vlr_engine/templates/config/omniauth-facebook.yml.sample +14 -0
- data/lib/generators/commonwealth_vlr_engine/templates/config/omniauth-polaris.yml.sample +20 -0
- data/lib/generators/commonwealth_vlr_engine/templates/config/vlr.yml +13 -0
- data/lib/generators/commonwealth_vlr_engine/yml_generator.rb +29 -0
- data/lib/railties/commonwealth_vlr_engine.rake +6 -0
- data/solr_conf/conf/schema.xml +476 -0
- data/solr_conf/conf/solrconfig.xml +286 -0
- data/spec/controllers/catalog_controller_spec.rb +67 -0
- data/spec/controllers/collections_controller_spec.rb +127 -0
- data/spec/controllers/feedback_controller_spec.rb +51 -0
- data/spec/controllers/folder_items_actions_controller_spec.rb +99 -0
- data/spec/controllers/folder_items_controller_spec.rb +90 -0
- data/spec/controllers/folders_controller_spec.rb +368 -0
- data/spec/controllers/iiif_manifest_controller_spec.rb +85 -0
- data/spec/controllers/image_viewer_controller_spec.rb +50 -0
- data/spec/controllers/institutions_controller_spec.rb +64 -0
- data/spec/controllers/ocr_search_controller_spec.rb +71 -0
- data/spec/controllers/pages_controller_spec.rb +58 -0
- data/spec/controllers/users_controller_spec.rb +62 -0
- data/spec/features/catalog/_az_links_spec.rb +27 -0
- data/spec/features/catalog/_show_partials/_show_book_viewer_link_spec.rb +47 -0
- data/spec/features/catalog/_show_partials/_show_default_simple_img_viewer_spec.rb +19 -0
- data/spec/features/catalog/_show_partials/_show_flagged_notice_spec.rb +23 -0
- data/spec/features/catalog/_show_partials/_show_multi_img_spec.rb +18 -0
- data/spec/features/catalog/_show_partials/_show_volumes_spec.rb +24 -0
- data/spec/features/collections/index_spec.rb +35 -0
- data/spec/features/feedback/show_spec.rb +47 -0
- data/spec/features/image_viewer/book_viewer_spec.rb +67 -0
- data/spec/features/institutions/index_spec.rb +31 -0
- data/spec/features/institutions/map_view_spec.rb +37 -0
- data/spec/features/more_like_this_search_spec.rb +23 -0
- data/spec/features/ocr_search/index_spec.rb +89 -0
- data/spec/fixtures/sample_rss_feed.xml +56 -0
- data/spec/fixtures/sample_solr_documents.yml +2748 -0
- data/spec/helpers/application_helper_spec.rb +114 -0
- data/spec/helpers/catalog_helper_spec.rb +386 -0
- data/spec/helpers/collections_helper_spec.rb +28 -0
- data/spec/helpers/component_helper_spec.rb +34 -0
- data/spec/helpers/folders_helper_spec.rb +31 -0
- data/spec/helpers/image_viewer_helper_spec.rb +15 -0
- data/spec/helpers/institutions_helper_spec.rb +53 -0
- data/spec/helpers/ocr_search_helper_spec.rb +70 -0
- data/spec/helpers/pages_helper_spec.rb +21 -0
- data/spec/lib/commonwealth-vlr-engine/commonwealth_search_builder_spec.rb +101 -0
- data/spec/lib/commonwealth-vlr-engine/controller_override_spec.rb +41 -0
- data/spec/lib/commonwealth-vlr-engine/controller_spec.rb +33 -0
- data/spec/lib/commonwealth-vlr-engine/finder_spec.rb +140 -0
- data/spec/lib/commonwealth-vlr-engine/iiif_manifest_spec.rb +157 -0
- data/spec/lib/commonwealth-vlr-engine/render_constraints_override_spec.rb +97 -0
- data/spec/mailers/notifier_spec.rb +31 -0
- data/spec/models/carousel_slide_spec.rb +38 -0
- data/spec/spec_helper.rb +40 -0
- data/spec/tasks/vlr_engine_rake_spec.rb +28 -0
- data/spec/test_app_templates/lib/generators/test_app_generator.rb +23 -0
- data/tasks/vlr_engine.rake +46 -0
- metadata +788 -0
@@ -0,0 +1,19 @@
|
|
1
|
+
module CommonwealthVlrEngine
|
2
|
+
module CollectionsHelperBehavior
|
3
|
+
|
4
|
+
# link to view all items in a collection
|
5
|
+
def link_to_all_col_items(col_title, institution_name=nil, link_class)
|
6
|
+
facet_params = {blacklight_config.collection_field => [col_title]}
|
7
|
+
facet_params[blacklight_config.institution_field] = institution_name if institution_name
|
8
|
+
link_to(t('blacklight.collections.browse.all'),
|
9
|
+
catalog_index_path(:f => facet_params),
|
10
|
+
:class => link_class)
|
11
|
+
end
|
12
|
+
|
13
|
+
# whether the A-Z link menu should be displayed in collections#index
|
14
|
+
def should_render_col_az?
|
15
|
+
false
|
16
|
+
end
|
17
|
+
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
module CommonwealthVlrEngine
|
2
|
+
|
3
|
+
module ComponentHelper
|
4
|
+
include Blacklight::ComponentHelperBehavior
|
5
|
+
|
6
|
+
# add extra tools to show view -- folders, social sharing, etc.
|
7
|
+
def render_show_doc_actions(document=@document, options={})
|
8
|
+
wrapping_class = options.delete(:documentFunctions) || options.delete(:wrapping_class) || 'documentFunctions'
|
9
|
+
content = []
|
10
|
+
#content << render(:partial => 'catalog/bookmark_control', :locals => {:document=> document}.merge(options)) if render_bookmarks_control?
|
11
|
+
|
12
|
+
# social media:
|
13
|
+
content << render(:partial => 'catalog/add_this')
|
14
|
+
if has_user_authentication_provider? and current_or_guest_user
|
15
|
+
content << render(:partial => 'catalog/folder_item_control', :locals => {:document => document})
|
16
|
+
end
|
17
|
+
content_tag('div', content.join("\n").html_safe, :class=> wrapping_class)
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
module CommonwealthVlrEngine
|
3
|
+
module FacetsHelper
|
4
|
+
include Blacklight::FacetsHelperBehavior
|
5
|
+
|
6
|
+
# LOCAL OVERRIDE
|
7
|
+
# don't display 'Collections' genre_basic_ssim facet value
|
8
|
+
# on collections#index or collections#facet views
|
9
|
+
def render_facet_item(facet_field, item)
|
10
|
+
return if controller.controller_name == 'collections' && controller.action_name == 'index' && item.value == 'Collections'
|
11
|
+
if facet_in_params?(facet_field, item.value )
|
12
|
+
render_selected_facet_value(facet_field, item)
|
13
|
+
else
|
14
|
+
render_facet_value(facet_field, item)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
module CommonwealthVlrEngine
|
2
|
+
module FeedbackHelperBehavior
|
3
|
+
|
4
|
+
# returns an array of values for the message type select dropdown
|
5
|
+
def feedback_type_options
|
6
|
+
options_for_type_dropdown = []
|
7
|
+
t('blacklight.feedback.form.topic.options').each_value do |option|
|
8
|
+
options_for_type_dropdown << option[:option]
|
9
|
+
end
|
10
|
+
options_for_type_dropdown
|
11
|
+
end
|
12
|
+
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
module CommonwealthVlrEngine
|
2
|
+
module ImageViewerHelperBehavior
|
3
|
+
|
4
|
+
# return id for the book object, or parent book if @document is a volume
|
5
|
+
def book_id(document)
|
6
|
+
if document[:is_volume_of_ssim]
|
7
|
+
document[:is_volume_of_ssim].first.gsub(/info:fedora\//,'')
|
8
|
+
else
|
9
|
+
document.id
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
module CommonwealthVlrEngine
|
2
|
+
module InstitutionsHelperBehavior
|
3
|
+
|
4
|
+
# link to view all items from an institution
|
5
|
+
def link_to_all_inst_items(link_class)
|
6
|
+
link_to(t('blacklight.institutions.browse.all'),
|
7
|
+
catalog_index_path(:f => {blacklight_config.institution_field => [@institution_title]}),
|
8
|
+
:class => link_class)
|
9
|
+
end
|
10
|
+
|
11
|
+
# replaces render_document_index in institutions/index partial
|
12
|
+
# so we can use local index_map_institutions partial for map view
|
13
|
+
def render_institutions_index documents = nil, locals = {}
|
14
|
+
documents ||= @document_list
|
15
|
+
if document_index_view_type.to_s == 'maps'
|
16
|
+
render :partial => 'catalog/index_map_institutions',
|
17
|
+
:locals => {:geojson_features => serialize_geojson(map_facet_values,
|
18
|
+
nil,
|
19
|
+
{partial: 'institutions/map_institutions_search'})}
|
20
|
+
else
|
21
|
+
render_document_index_with_view(document_index_view_type, documents, locals)
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
# whether the A-Z link menu should be displayed in institutions#index
|
26
|
+
def should_render_inst_az?
|
27
|
+
false
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
module CommonwealthVlrEngine
|
2
|
+
module LayoutHelper
|
3
|
+
include Blacklight::LayoutHelperBehavior
|
4
|
+
|
5
|
+
def main_content_classes
|
6
|
+
'col-sm-9'
|
7
|
+
end
|
8
|
+
|
9
|
+
def show_content_classes
|
10
|
+
'col-sm-12 show-document'
|
11
|
+
end
|
12
|
+
|
13
|
+
def show_sidebar_classes
|
14
|
+
'col-sm-4'
|
15
|
+
end
|
16
|
+
|
17
|
+
def sidebar_classes
|
18
|
+
'col-sm-3'
|
19
|
+
end
|
20
|
+
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,48 @@
|
|
1
|
+
module CommonwealthVlrEngine
|
2
|
+
module OcrSearchHelperBehavior
|
3
|
+
|
4
|
+
# return the term frequency as an integer
|
5
|
+
# if Solr returns 0, change to 1 (most likely phrase search)
|
6
|
+
def compute_term_freq(term_freq)
|
7
|
+
term_freq > 0 ? term_freq : term_freq+1
|
8
|
+
end
|
9
|
+
|
10
|
+
# if current_search_session exists, return query_params['q'], otherwise return nil
|
11
|
+
# @current_search_session is defined in Blacklight::SearchContext
|
12
|
+
def ocr_q_params(current_search_session)
|
13
|
+
if current_search_session
|
14
|
+
current_search_session.query_params['q']
|
15
|
+
else
|
16
|
+
nil
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
# print the ocr snippets. if more than one, separate with <br/>
|
21
|
+
def render_ocr_snippets options={}
|
22
|
+
snippets = options[:value]
|
23
|
+
snippets_content = [content_tag('div',
|
24
|
+
"... #{snippets.first} ...".html_safe,
|
25
|
+
class: 'ocr_snippet first_snippet')]
|
26
|
+
if snippets.length > 1
|
27
|
+
snippets_content << render(partial: 'ocr_search/snippets_more',
|
28
|
+
locals: {snippets: snippets.drop(1),
|
29
|
+
counter: options[:counter]})
|
30
|
+
end
|
31
|
+
snippets_content.join("\n").html_safe
|
32
|
+
end
|
33
|
+
|
34
|
+
# link to the book viewer, using page number or image index
|
35
|
+
# @document = SolrDocument (page object)
|
36
|
+
# @image_pid_list = an ordered Array of image pids for the book object
|
37
|
+
# @book_id = pid of book object
|
38
|
+
def render_page_link(document, image_pid_list, book_id)
|
39
|
+
index_of_doc = image_pid_list.index(document.id)
|
40
|
+
page_num = document[blacklight_config.page_num_field.to_sym]
|
41
|
+
link_to page_num ? "Page #{page_num}" : "Image #{index_of_doc+1}",
|
42
|
+
"#{book_viewer_path(book_id)}?ocr_q=#{url_encode(params[:ocr_q])}#1/#{index_of_doc+1}",
|
43
|
+
class: 'book_page_link',
|
44
|
+
rel: 'nofollow'
|
45
|
+
end
|
46
|
+
|
47
|
+
end
|
48
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
require 'rss'
|
2
|
+
|
3
|
+
module CommonwealthVlrEngine
|
4
|
+
module PagesHelperBehavior
|
5
|
+
|
6
|
+
def render_blog_feed(source = t('blacklight.home.context.news.rss_link'))
|
7
|
+
if source.present?
|
8
|
+
feed = Rails.cache.fetch('dc_rss_feed', :expires_in => 60.minutes) do
|
9
|
+
RSS::Parser.parse(open(source).read, false).items[0..3]
|
10
|
+
end
|
11
|
+
end
|
12
|
+
if source.present? && feed.length > 0
|
13
|
+
content = []
|
14
|
+
feed.each do |item|
|
15
|
+
content << content_tag(:li,
|
16
|
+
link_to(item.title,
|
17
|
+
item.link,
|
18
|
+
:class => 'feed_item_link',
|
19
|
+
:target => '_blank'),
|
20
|
+
:class => 'feed_item')
|
21
|
+
end
|
22
|
+
content_tag(:ul, content.join().html_safe, :class => 'feed_items')
|
23
|
+
else
|
24
|
+
content_tag(:p,
|
25
|
+
'Visit ' + link_to(t('blacklight.home.context.news.blog_title'),
|
26
|
+
t('blacklight.home.context.news.blog_url'),
|
27
|
+
:target => '_blank') + ' for the latest updates.')
|
28
|
+
end
|
29
|
+
rescue
|
30
|
+
content_tag(:p, 'No news at the moment, please check back later...')
|
31
|
+
end
|
32
|
+
|
33
|
+
def render_about_site_path
|
34
|
+
about_site_path
|
35
|
+
end
|
36
|
+
|
37
|
+
end
|
38
|
+
end
|
@@ -0,0 +1,59 @@
|
|
1
|
+
module CommonwealthVlrEngine
|
2
|
+
module VlrBlacklightMapsHelperBehavior
|
3
|
+
include Blacklight::BlacklightMapsHelperBehavior
|
4
|
+
|
5
|
+
# OVERRIDE: convert state abbreviations, deal with complex locations, etc.
|
6
|
+
# create a link to a location name facet value
|
7
|
+
def link_to_placename_field field_value, field, displayvalue = nil, catalogpath = nil
|
8
|
+
search_path = catalogpath || 'catalog_index_path'
|
9
|
+
new_params = params
|
10
|
+
new_params[:view] = default_document_index_view_type
|
11
|
+
field_values = field_value.split(', ')
|
12
|
+
if field_values.last.match(/[\.\)]/) # Mass.)
|
13
|
+
field_values = [field_values.join(', ')]
|
14
|
+
end
|
15
|
+
if field_values.length > 2
|
16
|
+
new_field_values = []
|
17
|
+
new_field_values[0] = field_value.split(/[,][ \w]*\z/).first
|
18
|
+
new_field_values[1] = field_values.last
|
19
|
+
field_values = new_field_values
|
20
|
+
end
|
21
|
+
if field_values.length == 2 && field_values.last.length == 2
|
22
|
+
state_name = Madison.get_name(field_values.last)
|
23
|
+
field_values[field_values.length-1] = state_name if state_name
|
24
|
+
end
|
25
|
+
field_values.each do |val|
|
26
|
+
place = val.match(/\(county\)/) ? val : val.gsub(/\s\([a-z]*\)\z/,'')
|
27
|
+
new_params = add_facet_params(field, place, new_params) unless params[:f] && params[:f][field] && params[:f][field].include?(place)
|
28
|
+
new_params[:view] = default_document_index_view_type
|
29
|
+
end
|
30
|
+
link_to(displayvalue.presence || field_value,
|
31
|
+
self.send(search_path,new_params.except(:id, :spatial_search_type, :coordinates)))
|
32
|
+
end
|
33
|
+
|
34
|
+
# OVERRIDE: use a static file for catalog#map so page loads faster
|
35
|
+
# render the map for #index and #map views
|
36
|
+
def render_index_map
|
37
|
+
static_geojson_file_loc = "#{Rails.root.to_s}/#{GEOJSON_STATIC_FILE['filepath']}"
|
38
|
+
if Rails.env.to_s == 'production' && params[:action] == 'map' && File::exists?(static_geojson_file_loc)
|
39
|
+
geojson_for_map = File.open(static_geojson_file_loc).first
|
40
|
+
else
|
41
|
+
geojson_for_map = serialize_geojson(map_facet_values)
|
42
|
+
end
|
43
|
+
render :partial => 'catalog/index_map',
|
44
|
+
:locals => {:geojson_features => geojson_for_map}
|
45
|
+
end
|
46
|
+
|
47
|
+
|
48
|
+
# OVERRIDE: allow controller.action name to be passed, allow @controller
|
49
|
+
# pass the document or facet values to BlacklightMaps::GeojsonExport
|
50
|
+
def serialize_geojson(documents, action_name=nil, options={})
|
51
|
+
action = action_name || controller.action_name
|
52
|
+
cntrllr = @controller || controller
|
53
|
+
export = BlacklightMaps::GeojsonExport.new(cntrllr, action, documents, options)
|
54
|
+
export.to_geojson
|
55
|
+
end
|
56
|
+
|
57
|
+
end
|
58
|
+
|
59
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
2
|
+
# overriding Blacklight RecordMailer to add :from address in email
|
3
|
+
# otherwise we get error: ArgumentError (An SMTP From address is required to send a message
|
4
|
+
class RecordMailer < ActionMailer::Base
|
5
|
+
def email_record(documents, details, url_gen_params)
|
6
|
+
|
7
|
+
subject = I18n.t('blacklight.email.text.subject', :count => documents.length, :title => (documents.first.to_semantic_values[:title] rescue 'N/A') )
|
8
|
+
|
9
|
+
@documents = documents
|
10
|
+
@message = details[:message]
|
11
|
+
@url_gen_params = url_gen_params
|
12
|
+
|
13
|
+
mail(:to => details[:to],
|
14
|
+
:from => t('blacklight.email.record_mailer.name') + ' <' + t('blacklight.email.record_mailer.email') + '>',
|
15
|
+
:subject => subject)
|
16
|
+
end
|
17
|
+
|
18
|
+
end
|
data/app/models/user.rb
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
class User < ActiveRecord::Base
|
2
|
+
require 'base64'
|
3
|
+
require 'cgi'
|
4
|
+
require 'openssl'
|
5
|
+
require 'rest_client'
|
6
|
+
|
7
|
+
# Connects this user object to Blacklights Bookmarks.
|
8
|
+
include Blacklight::User
|
9
|
+
|
10
|
+
# Connects this user object to the BPL omniauth service
|
11
|
+
include Bpluser::User
|
12
|
+
|
13
|
+
self.table_name = "users"
|
14
|
+
|
15
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
<div id="date_range_limit" class="advanced_search_field">
|
2
|
+
<div class="form-group">
|
3
|
+
<label class="control-label col-sm-2 ">Year</label>
|
4
|
+
<div class="col-sm-8">
|
5
|
+
<div class="input-group col-sm-4">
|
6
|
+
<label id="date_range_start_label" class="input-group-addon" for="date_start">Start</label>
|
7
|
+
<%= text_field_tag 'date_start',
|
8
|
+
nil,
|
9
|
+
:id => 'date_range_start',
|
10
|
+
:class => 'form-control',
|
11
|
+
:maxlength => 4 %>
|
12
|
+
</div>
|
13
|
+
<div class="input-group col-sm-4">
|
14
|
+
<label id="date_range_end_label" class="input-group-addon" for="date_end">End</label>
|
15
|
+
<%= text_field_tag 'date_end',
|
16
|
+
nil,
|
17
|
+
:id => 'date_range_end',
|
18
|
+
:class => 'form-control',
|
19
|
+
:maxlength => 4 %>
|
20
|
+
</div>
|
21
|
+
</div>
|
22
|
+
</div>
|
23
|
+
</div>
|
@@ -0,0 +1,39 @@
|
|
1
|
+
<% search_fields_for_advanced_search.take(3).each_with_index do |(key, field_def), index| %>
|
2
|
+
<div class="advanced_search_field form-group">
|
3
|
+
<%= select_tag('search_index[]',
|
4
|
+
options_for_select(search_fields,
|
5
|
+
search_fields[index]),
|
6
|
+
:title => t('blacklight.search.basic_search.form.search_indexes'),
|
7
|
+
:class=> 'btn btn-default search_index_select col-sm-2 control-label') %>
|
8
|
+
<%= label_tag('input' + (index+1).to_s,
|
9
|
+
t('blacklight.search.basic_search.form.q') + ' (' + (index+1).to_s + ')',
|
10
|
+
:class => 'sr-only') %>
|
11
|
+
<div class="col-sm-6">
|
12
|
+
<%= text_field_tag 'query[]',
|
13
|
+
nil,
|
14
|
+
:class => 'advanced_input_text form-control',
|
15
|
+
:autofocus => index == 0 ? true : false %>
|
16
|
+
</div>
|
17
|
+
</div>
|
18
|
+
<% end %>
|
19
|
+
<div class="advanced_search_field">
|
20
|
+
<div id="advanced_operators" class="col-sm-offset-2 col-sm-6">
|
21
|
+
<label class="radio-inline">
|
22
|
+
<%= radio_button_tag(:op, 'AND', :checked) %> find all terms
|
23
|
+
</label>
|
24
|
+
<label class="radio-inline">
|
25
|
+
<%= radio_button_tag(:op, 'OR') %> find any terms
|
26
|
+
</label>
|
27
|
+
</div>
|
28
|
+
</div>
|
29
|
+
<div class="pull-right">
|
30
|
+
<%= submit_tag 'Search', :class=>'btn btn-primary advanced_submit', :id=>'advanced_search' %>
|
31
|
+
<%= link_to 'Start over', {:controller => 'advanced', :action => 'index'}, :class =>'reset btn btn-default' %>
|
32
|
+
</div>
|
33
|
+
|
34
|
+
<%# search_fields_for_advanced_search.each do |key, field_def| -%>
|
35
|
+
<!-- <div class="advanced_search_field"> -->
|
36
|
+
<%# label_tag key, "#{field_def.label }:" %>
|
37
|
+
<%# text_field_tag key, label_tag_default_for(key), :class => 'input-block-level' %>
|
38
|
+
<!-- </div> -->
|
39
|
+
<%# end -%>
|