commonwealth-vlr-engine 0.0.4 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (98) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +2 -1
  3. data/app/assets/images/commonwealth-vlr-engine/vlr_mobile-icons_120x120.png +0 -0
  4. data/app/assets/images/commonwealth-vlr-engine/vlr_mobile-icons_152x152.png +0 -0
  5. data/app/assets/images/commonwealth-vlr-engine/vlr_mobile-icons_60x60.png +0 -0
  6. data/app/assets/images/commonwealth-vlr-engine/vlr_mobile-icons_76x76.png +0 -0
  7. data/app/assets/javascripts/blacklight_google_analytics/blacklight_google_analytics.js.erb +11 -0
  8. data/app/assets/javascripts/commonwealth-vlr-engine.js +3 -0
  9. data/app/assets/javascripts/commonwealth-vlr-engine/download_utils.js +4 -0
  10. data/app/assets/stylesheets/commonwealth-vlr-engine/commonwealth-vlr-engine.css +1 -0
  11. data/app/assets/stylesheets/commonwealth-vlr-engine/downloads.scss +18 -0
  12. data/app/assets/stylesheets/commonwealth-vlr-engine/facets.scss +64 -0
  13. data/app/assets/stylesheets/commonwealth-vlr-engine/vlr_dependencies.css +3 -1
  14. data/app/controllers/bookmarks_controller.rb +7 -2
  15. data/app/controllers/collections_controller.rb +1 -109
  16. data/app/controllers/concerns/commonwealth_vlr_engine/collections_controller_behavior.rb +132 -0
  17. data/app/controllers/concerns/commonwealth_vlr_engine/downloads_controller_behavior.rb +184 -0
  18. data/app/controllers/concerns/commonwealth_vlr_engine/institutions_controller_behavior.rb +70 -0
  19. data/app/controllers/downloads_controller.rb +4 -0
  20. data/app/controllers/iiif_manifest_controller.rb +2 -7
  21. data/app/controllers/image_viewer_controller.rb +3 -13
  22. data/app/controllers/institutions_controller.rb +1 -65
  23. data/app/controllers/ocr_search_controller.rb +1 -1
  24. data/app/controllers/saved_searches_controller.rb +2 -0
  25. data/app/controllers/search_history_controller.rb +2 -0
  26. data/app/helpers/commonwealth_vlr_engine/application_helper.rb +20 -2
  27. data/app/helpers/commonwealth_vlr_engine/catalog_helper.rb +36 -53
  28. data/app/helpers/commonwealth_vlr_engine/downloads_helper_behavior.rb +192 -0
  29. data/app/helpers/commonwealth_vlr_engine/facets_helper.rb +3 -1
  30. data/app/helpers/commonwealth_vlr_engine/ocr_search_helper_behavior.rb +5 -0
  31. data/app/helpers/commonwealth_vlr_engine/search_history_constraints_helper.rb +25 -0
  32. data/app/helpers/downloads_helper.rb +3 -0
  33. data/app/views/catalog/_add_this.html.erb +3 -1
  34. data/app/views/catalog/_folder_item_control.html.erb +2 -1
  35. data/app/views/catalog/_index_mapview.html.erb +9 -0
  36. data/app/views/catalog/_more_like_this.html.erb +1 -1
  37. data/app/views/catalog/_show_cite_tools.html.erb +3 -0
  38. data/app/views/catalog/_show_default.html.erb +13 -12
  39. data/app/views/catalog/_show_partials/_show_book_viewer_link.html.erb +1 -1
  40. data/app/views/catalog/_show_partials/_show_default_metadata.html.erb +3 -3
  41. data/app/views/catalog/_show_partials/_show_downloads.html.erb +1 -1
  42. data/app/views/catalog/_show_partials/_show_volumes.html.erb +1 -1
  43. data/app/views/catalog/_show_sharing_tools.html.erb +3 -0
  44. data/app/views/collections/show.html.erb +1 -0
  45. data/app/views/downloads/_terms_of_use.html.erb +29 -0
  46. data/app/views/downloads/show.html.erb +29 -0
  47. data/app/views/image_viewer/_render_book_viewer.html.erb +1 -1
  48. data/app/views/institutions/show.html.erb +2 -10
  49. data/app/views/layouts/commonwealth-vlr-engine.html.erb +1 -4
  50. data/app/views/ocr_search/_index_ocr_list.html.erb +3 -3
  51. data/app/views/shared/_mobile_icon_tags.html.erb +4 -0
  52. data/app/views/shared/_search_form_header.html.erb +1 -1
  53. data/app/views/shared/_tools.html.erb +5 -5
  54. data/commonwealth-vlr-engine.gemspec +8 -6
  55. data/config/initializers/patch_blacklight_advanced_search.rb +6 -6
  56. data/config/initializers/patch_blacklight_range_limit.rb +18 -0
  57. data/config/jetty.yml +1 -1
  58. data/config/locales/commonwealth-vlr-engine.en.yml +12 -0
  59. data/config/routes.rb +6 -0
  60. data/lib/commonwealth-vlr-engine.rb +1 -0
  61. data/lib/commonwealth-vlr-engine/controller.rb +18 -3
  62. data/lib/commonwealth-vlr-engine/controller_override.rb +79 -21
  63. data/lib/commonwealth-vlr-engine/engine.rb +1 -0
  64. data/lib/commonwealth-vlr-engine/render_constraints_override.rb +15 -14
  65. data/lib/commonwealth-vlr-engine/search_builder/collections_search_builder.rb +1 -1
  66. data/lib/commonwealth-vlr-engine/search_builder/commonwealth_search_builder_behavior.rb +13 -1
  67. data/lib/commonwealth-vlr-engine/search_builder/flagged_search_builder.rb +1 -1
  68. data/lib/commonwealth-vlr-engine/search_builder/institutions_search_builder.rb +1 -1
  69. data/lib/commonwealth-vlr-engine/search_builder/mlt_search_builder.rb +2 -1
  70. data/lib/commonwealth-vlr-engine/streaming.rb +50 -0
  71. data/lib/commonwealth-vlr-engine/version.rb +1 -1
  72. data/lib/generators/commonwealth_vlr_engine/routes_generator.rb +8 -0
  73. data/lib/generators/commonwealth_vlr_engine/templates/commonwealth_search_builder.rb +4 -3
  74. data/lib/generators/commonwealth_vlr_engine/templates/config/vlr.yml +3 -0
  75. data/solr_conf/conf/solrconfig.xml +42 -5
  76. data/spec/controllers/collections_controller_spec.rb +20 -0
  77. data/spec/controllers/downloads_controller_spec.rb +65 -0
  78. data/spec/controllers/image_viewer_controller_spec.rb +0 -18
  79. data/spec/controllers/institutions_controller_spec.rb +7 -0
  80. data/spec/features/advanced_search_date_range_spec.rb +36 -0
  81. data/spec/features/collections/index_spec.rb +6 -0
  82. data/spec/features/collections/show_spec.rb +38 -0
  83. data/spec/features/more_like_this_search_spec.rb +18 -1
  84. data/spec/fixtures/sample_solr_documents.yml +107 -19
  85. data/spec/helpers/application_helper_spec.rb +9 -2
  86. data/spec/helpers/catalog_helper_spec.rb +26 -42
  87. data/spec/helpers/downloads_helper_spec.rb +173 -0
  88. data/spec/helpers/ocr_search_helper_spec.rb +15 -7
  89. data/spec/helpers/range_limit_helper_spec.rb +20 -0
  90. data/spec/helpers/search_history_constraints_helper_spec.rb +39 -0
  91. data/spec/lib/commonwealth-vlr-engine/controller_override_spec.rb +37 -0
  92. data/spec/lib/commonwealth-vlr-engine/render_constraints_override_spec.rb +0 -10
  93. data/spec/lib/commonwealth-vlr-engine/search_builder/commonwealth_search_builder_behavior_spec.rb +21 -3
  94. data/spec/lib/commonwealth-vlr-engine/search_builder/mlt_search_builder_spec.rb +1 -1
  95. metadata +99 -12
  96. data/app/helpers/commonwealth_vlr_engine/component_helper.rb +0 -22
  97. data/app/views/catalog/_show_tools.html.erb +0 -42
  98. data/spec/helpers/component_helper_spec.rb +0 -34
@@ -1,34 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe ComponentHelper do
4
-
5
- include Blacklight::SearchHelper
6
-
7
- let(:document) { Blacklight.default_index.search({:q => 'id:"bpl-dev:h702q6403"', :rows => 1}).documents.first }
8
-
9
- before(:each) do
10
- allow(helper).to receive(:has_user_authentication_provider?).and_return(true)
11
- allow(helper).to receive(:current_or_guest_user).and_return(true)
12
- allow(helper).to receive(:current_user).and_return(User.create!({:email => "testy@test.com", :password => "password"}))
13
- @current_bookmarks = [] # have to set this for Blacklight::CatalogHelperBehavior#current_bookmarks
14
- end
15
-
16
- describe '#render_show_doc_actions' do
17
-
18
- before { @show_doc_actions = helper.render_show_doc_actions(document, {}) }
19
-
20
- it 'should create the document actions controls wrapper' do
21
- expect(@show_doc_actions).to include('<div class="documentFunctions">')
22
- end
23
-
24
- it 'should include the catalog/add_this partial' do
25
- expect(@show_doc_actions).to include('addthis')
26
- end
27
-
28
- it 'should include the catalog/folder_item_control partial' do
29
- expect(@show_doc_actions).to include('<div id="folder_item_toggle">')
30
- end
31
-
32
- end
33
-
34
- end