blacklight 4.9.0 → 5.0.0.pre1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +0 -1
- data/.travis.yml +22 -12
- data/Gemfile +3 -40
- data/LICENSE +1 -2
- data/README.md +1 -2
- data/Rakefile +0 -4
- data/VERSION +1 -1
- data/app/assets/images/blacklight/logo.png +0 -0
- data/app/assets/javascripts/blacklight/ajax_modal.js +190 -0
- data/app/assets/javascripts/blacklight/blacklight.js +7 -17
- data/app/assets/javascripts/blacklight/checkbox_submit.js +1 -1
- data/app/assets/stylesheets/blacklight/{_blacklight_base.scss → _blacklight_base.css.scss} +0 -21
- data/app/assets/stylesheets/blacklight/_bookmark.css.scss +4 -0
- data/app/assets/stylesheets/blacklight/_catalog.css.scss +192 -0
- data/app/assets/stylesheets/blacklight/_facets.css.scss +141 -0
- data/app/assets/stylesheets/blacklight/{_group.scss → _group.css.scss} +1 -1
- data/app/assets/stylesheets/blacklight/_header.css.scss +44 -0
- data/app/assets/stylesheets/blacklight/_layout.css.scss +5 -0
- data/app/assets/stylesheets/blacklight/{_modal.scss → _modal.css.scss} +7 -7
- data/app/assets/stylesheets/blacklight/_search_history.css.scss +20 -0
- data/app/assets/stylesheets/blacklight/{blacklight.scss → blacklight.css.scss} +0 -0
- data/app/assets/stylesheets/blacklight/blacklight_defaults.css.scss +14 -0
- data/app/controllers/bookmarks_controller.rb +0 -4
- data/app/controllers/feedback_controller.rb +0 -4
- data/app/helpers/blacklight/blacklight_helper_behavior.rb +45 -155
- data/app/helpers/blacklight/catalog_helper_behavior.rb +8 -41
- data/app/helpers/blacklight/facets_helper_behavior.rb +20 -43
- data/app/helpers/blacklight/hash_as_hidden_fields_helper_behavior.rb +2 -9
- data/app/helpers/blacklight/render_constraints_helper_behavior.rb +9 -14
- data/app/helpers/blacklight/search_history_constraints_helper_behavior.rb +6 -6
- data/app/views/_flash_msg.html.erb +9 -2
- data/app/views/_user_util_links.html.erb +29 -15
- data/app/views/bookmarks/_tools.html.erb +4 -7
- data/app/views/bookmarks/index.html.erb +3 -2
- data/app/views/catalog/_citation.html.erb +1 -1
- data/app/views/catalog/_constraints.html.erb +1 -1
- data/app/views/catalog/_constraints_element.html.erb +12 -8
- data/app/views/catalog/_did_you_mean.html.erb +2 -2
- data/app/views/catalog/_document_header.html.erb +3 -3
- data/app/views/catalog/_email_form.html.erb +10 -10
- data/app/views/catalog/_facet_layout.html.erb +11 -3
- data/app/views/catalog/_facet_limit.html.erb +7 -7
- data/app/views/catalog/_facet_pagination.html.erb +8 -7
- data/app/views/catalog/_facet_pivot.html.erb +3 -1
- data/app/views/catalog/_facets.html.erb +12 -9
- data/app/views/catalog/_paginate_compact.html.erb +1 -7
- data/app/views/catalog/_per_page_widget.html.erb +5 -8
- data/app/views/catalog/_previous_next_doc.html.erb +11 -9
- data/app/views/catalog/_refworks_form.html.erb +3 -4
- data/app/views/catalog/_results_pagination.html.erb +1 -1
- data/app/views/catalog/_search_form.html.erb +16 -14
- data/app/views/catalog/_show_sidebar.html.erb +7 -9
- data/app/views/catalog/_show_tools.html.erb +13 -7
- data/app/views/catalog/_sms_form.html.erb +8 -8
- data/app/views/catalog/_sort_and_per_page.html.erb +4 -6
- data/app/views/catalog/_sort_widget.html.erb +5 -6
- data/app/views/catalog/email.html.erb +1 -1
- data/app/views/catalog/facet.html.erb +2 -8
- data/app/views/catalog/index.html.erb +11 -6
- data/app/views/catalog/show.html.erb +5 -5
- data/app/views/catalog/sms.html.erb +1 -1
- data/app/views/catalog/sms_sent.html.erb +1 -1
- data/app/views/feedback/complete.html.erb +2 -2
- data/app/views/feedback/show.html.erb +1 -1
- data/app/views/kaminari/blacklight/_paginator.html.erb +1 -1
- data/app/views/kaminari/blacklight_compact/_paginator.html.erb +25 -5
- data/app/views/layouts/blacklight.html.erb +23 -23
- data/app/views/saved_searches/index.html.erb +2 -2
- data/app/views/search_history/index.html.erb +5 -7
- data/app/views/shared/_header_navbar.html.erb +23 -23
- data/blacklight.gemspec +10 -13
- data/config/locales/blacklight.en.yml +1 -12
- data/config/locales/blacklight.fr.yml +1 -12
- data/gemfiles/rails3.gemfile +21 -0
- data/gemfiles/rails4.gemfile +20 -0
- data/lib/blacklight.rb +0 -8
- data/lib/blacklight/base.rb +0 -2
- data/lib/blacklight/catalog.rb +6 -32
- data/lib/blacklight/catalog/search_context.rb +8 -48
- data/lib/blacklight/configurable.rb +2 -1
- data/lib/blacklight/configuration.rb +1 -2
- data/lib/blacklight/configuration/facet_field.rb +0 -2
- data/lib/blacklight/engine.rb +3 -3
- data/lib/blacklight/legacy_controller_methods.rb +1 -64
- data/lib/blacklight/rails/routes.rb +17 -0
- data/lib/blacklight/routes.rb +46 -40
- data/lib/blacklight/solr.rb +1 -0
- data/lib/blacklight/solr/document.rb +21 -42
- data/lib/blacklight/solr/facet_paginator.rb +30 -54
- data/lib/blacklight/solr/request.rb +45 -0
- data/lib/blacklight/solr_helper.rb +16 -53
- data/lib/blacklight/solr_response.rb +0 -6
- data/lib/blacklight/user.rb +2 -7
- data/lib/blacklight/utils.rb +1 -9
- data/lib/generators/blacklight/assets_generator.rb +0 -14
- data/lib/generators/blacklight/blacklight_generator.rb +17 -14
- data/lib/generators/blacklight/templates/blacklight.css.scss +3 -0
- data/lib/generators/blacklight/templates/catalog_controller.rb +4 -1
- data/lib/railties/blacklight.rake +3 -1
- data/solr/sample_solr_documents.yml +641 -0
- data/spec/controllers/application_controller_spec.rb +5 -21
- data/spec/controllers/bookmarks_controller_spec.rb +11 -11
- data/spec/controllers/catalog_controller_spec.rb +122 -119
- data/spec/controllers/search_history_controller_spec.rb +8 -8
- data/spec/features/alternate_controller_spec.rb +5 -5
- data/spec/features/facets_spec.rb +9 -0
- data/spec/features/record_view_spec.rb +1 -1
- data/spec/features/search_filters_spec.rb +97 -41
- data/spec/features/search_results_spec.rb +14 -17
- data/spec/features/search_sort_spec.rb +1 -1
- data/spec/helpers/blacklight_helper_spec.rb +170 -285
- data/spec/helpers/catalog_helper_spec.rb +57 -96
- data/spec/helpers/facets_helper_spec.rb +130 -152
- data/spec/helpers/hash_as_hidden_fields_spec.rb +9 -15
- data/spec/helpers/render_constraints_helper_spec.rb +5 -5
- data/spec/helpers/search_history_constraints_helper_spec.rb +21 -21
- data/spec/lib/blacklight/routes_spec.rb +25 -0
- data/spec/lib/blacklight/solr/request_spec.rb +37 -0
- data/spec/lib/blacklight/solr_response/group_response_spec.rb +2 -2
- data/spec/lib/blacklight_configurable_spec.rb +16 -16
- data/spec/lib/blacklight_configuration_spec.rb +132 -132
- data/spec/lib/blacklight_email_spec.rb +4 -4
- data/spec/lib/blacklight_sms_spec.rb +4 -4
- data/spec/lib/blacklight_solr_document_dublin_core_spec.rb +6 -6
- data/spec/lib/blacklight_solr_document_more_like_this_spec.rb +4 -4
- data/spec/lib/blacklight_solr_document_spec.rb +36 -36
- data/spec/lib/blacklight_solr_response_spec.rb +43 -48
- data/spec/lib/blacklight_spec.rb +6 -14
- data/spec/lib/blacklight_user_spec.rb +5 -9
- data/spec/lib/facet_paginator_spec.rb +59 -51
- data/spec/lib/search_fields_spec.rb +13 -13
- data/spec/lib/solr_helper_spec.rb +258 -304
- data/spec/lib/tasks/blacklight_task_spec.rb +1 -1
- data/spec/lib/utils_spec.rb +16 -46
- data/spec/models/bookmark_spec.rb +6 -7
- data/spec/models/record_mailer_spec.rb +16 -16
- data/spec/models/search_spec.rb +8 -8
- data/spec/models/solr_document_spec.rb +6 -77
- data/spec/routing/catalog_routing_spec.rb +16 -10
- data/spec/spec_helper.rb +7 -7
- data/spec/support/assert_difference.rb +2 -2
- data/spec/support/features.rb +0 -11
- data/spec/support/features/session_helpers.rb +3 -3
- data/spec/support/include_text.rb +2 -2
- data/spec/test_app_templates/Gemfile.extra +10 -2
- data/spec/test_app_templates/lib/generators/test_app_generator.rb +12 -18
- data/spec/views/catalog/_constraints_element.html.erb_spec.rb +13 -13
- data/spec/views/catalog/_document.html.erb_spec.rb +1 -1
- data/spec/views/catalog/_document_list.html.erb_spec.rb +1 -1
- data/spec/views/catalog/_facets.html.erb_spec.rb +13 -14
- data/spec/views/catalog/_index_default.erb_spec.rb +21 -21
- data/spec/views/catalog/_search_header.erb_spec.rb +1 -1
- data/spec/views/catalog/_show_default.erb_spec.rb +21 -21
- data/spec/views/catalog/_show_sidebar.erb_spec.rb +7 -7
- data/spec/views/catalog/_thumbnail_default.erb_spec.rb +3 -3
- data/spec/views/catalog/index.atom.builder_spec.rb +29 -29
- data/spec/views/catalog/index.html.erb_spec.rb +6 -7
- data/tasks/blacklight.rake +8 -2
- metadata +84 -180
- data/app/assets/javascripts/blacklight/css_dropdowns.js +0 -10
- data/app/assets/javascripts/blacklight/facet_expand_contract.js +0 -41
- data/app/assets/javascripts/blacklight/lightbox_dialog.js +0 -70
- data/app/assets/javascripts/blacklight/select_submit.js +0 -27
- data/app/assets/javascripts/blacklight/zebra_stripe.js +0 -13
- data/app/assets/javascripts/improved-modal/bootstrap-modal.js +0 -355
- data/app/assets/javascripts/improved-modal/bootstrap-modalmanager.js +0 -370
- data/app/assets/stylesheets/blacklight/_bookmark.scss +0 -33
- data/app/assets/stylesheets/blacklight/_catalog.scss +0 -255
- data/app/assets/stylesheets/blacklight/_dropdown.scss +0 -57
- data/app/assets/stylesheets/blacklight/_facets.scss +0 -197
- data/app/assets/stylesheets/blacklight/_footer.scss +0 -0
- data/app/assets/stylesheets/blacklight/_header.scss +0 -53
- data/app/assets/stylesheets/blacklight/_layout.scss +0 -10
- data/app/assets/stylesheets/blacklight/_mixins.scss +0 -0
- data/app/assets/stylesheets/blacklight/_print.scss +0 -0
- data/app/assets/stylesheets/blacklight/_responsive.scss +0 -3
- data/app/assets/stylesheets/blacklight/_search_history.scss +0 -42
- data/app/assets/stylesheets/blacklight/blacklight_defaults.scss +0 -49
- data/app/assets/stylesheets/blacklight/responsive_partials/_catalog.scss +0 -5
- data/app/assets/stylesheets/blacklight/responsive_partials/_facets.scss +0 -37
- data/app/assets/stylesheets/blacklight/responsive_partials/_header.scss +0 -30
- data/app/assets/stylesheets/improved-modal/bootstrap-modal.css +0 -217
- data/app/helpers/blacklight/html_head_helper_behavior.rb +0 -118
- data/app/helpers/html_head_helper.rb +0 -3
- data/app/views/catalog/_bookmark_form.html.erb +0 -7
- data/app/views/catalog/_marc_view.html.erb +0 -32
- data/app/views/catalog/librarian_view.html.erb +0 -10
- data/config/routes.rb +0 -17
- data/doc/Atom-Responses.md +0 -90
- data/doc/Blacklight-3.0-Release-Notes-And-Upgrade-Guide.md +0 -107
- data/doc/Blacklight-3.2-Release-Notes-and-Upgrade-Guide.md +0 -191
- data/doc/Blacklight-3.3-release-notes-and-upgrade-guide.md +0 -37
- data/doc/Blacklight-3.4-release-notes-and-upgrade-guide.md +0 -27
- data/doc/Blacklight-3.5-release-notes-and-upgrade-guide.md +0 -44
- data/doc/Blacklight-3.6-release-notes-and-upgrade-guide.md +0 -25
- data/doc/Blacklight-3.7-release-notes-and-upgrade-guide.md +0 -80
- data/doc/Blacklight-3.8-release-notes-and-upgrade-guide.md +0 -11
- data/doc/Blacklight-4.0-release-notes-and-upgrade-guide.md +0 -135
- data/doc/Blacklight-4.1-release-notes-and-upgrade-guide.md +0 -17
- data/doc/Blacklight-4.2-release-notes-and-upgrade-guide.md +0 -25
- data/doc/Blacklight-4.3-release-notes-and-upgrade-guide.md +0 -21
- data/doc/Blacklight-4.4-release-notes-and-upgrade-guide.md +0 -41
- data/doc/Blacklight-Add-ons.md +0 -28
- data/doc/Blacklight-configuration.md +0 -411
- data/doc/Blacklight-on-Heroku.md +0 -135
- data/doc/Code4Lib-2014.md +0 -48
- data/doc/Community-principles.md +0 -44
- data/doc/Configuring-and-Customizing-Blacklight.md +0 -271
- data/doc/Configuring-rails-routes.md +0 -13
- data/doc/Contributing-to-Blacklight.md +0 -25
- data/doc/Examples.md +0 -94
- data/doc/Extending-or-Modifying-Blacklight-Search-Behavior.md +0 -141
- data/doc/FAQs.md +0 -1
- data/doc/Home.md +0 -80
- data/doc/How-to-release-a-version.md +0 -29
- data/doc/Indexing-your-data-into-solr.md +0 -32
- data/doc/Integration-with-Rails-Footnotes.md +0 -20
- data/doc/Internationalization.md +0 -32
- data/doc/JSON-API.md +0 -17
- data/doc/Pagination.md +0 -51
- data/doc/Providing-your-own-view-templates.md +0 -109
- data/doc/Quickstart.md +0 -115
- data/doc/README_SOLR.md +0 -245
- data/doc/Release-Notes-And-Upgrade-Guides.md +0 -20
- data/doc/Roadmap.md +0 -43
- data/doc/Sunspot-for-indexing.md +0 -46
- data/doc/Theming.md +0 -64
- data/doc/User-Authentication.md +0 -60
- data/doc/testing.md +0 -57
- data/lib/SolrMarc.jar +0 -0
- data/lib/blacklight/mash.rb +0 -19
- data/lib/blacklight/solr/document/marc.rb +0 -71
- data/lib/blacklight/solr/document/marc_export.rb +0 -590
- data/lib/generators/blacklight/marc_generator.rb +0 -66
- data/lib/generators/blacklight/templates/blacklight.scss +0 -4
- data/lib/generators/blacklight/templates/config/SolrMarc/config-test.properties +0 -37
- data/lib/generators/blacklight/templates/config/SolrMarc/config.properties +0 -37
- data/lib/generators/blacklight/templates/config/SolrMarc/index.properties +0 -97
- data/lib/generators/blacklight/templates/config/SolrMarc/index_scripts/dewey.bsh +0 -47
- data/lib/generators/blacklight/templates/config/SolrMarc/index_scripts/format.bsh +0 -126
- data/lib/generators/blacklight/templates/config/SolrMarc/translation_maps/README_MAPS +0 -1
- data/lib/generators/blacklight/templates/config/SolrMarc/translation_maps/callnumber_map.properties +0 -407
- data/lib/generators/blacklight/templates/config/SolrMarc/translation_maps/composition_era_map.properties +0 -56
- data/lib/generators/blacklight/templates/config/SolrMarc/translation_maps/country_map.properties +0 -379
- data/lib/generators/blacklight/templates/config/SolrMarc/translation_maps/format_map.properties +0 -50
- data/lib/generators/blacklight/templates/config/SolrMarc/translation_maps/instrument_map.properties +0 -101
- data/lib/generators/blacklight/templates/config/SolrMarc/translation_maps/language_map.properties +0 -490
- data/lib/railties/solr_marc.rake +0 -162
- data/spec/data/test_data.utf8.mrc +0 -1
- data/spec/features/librarian_view_spec.rb +0 -13
- data/spec/helpers/html_head_helper_spec.rb +0 -164
- data/spec/lib/blacklight_solr_document_marc_spec.rb +0 -89
- data/spec/lib/marc_export_spec.rb +0 -746
- data/spec/lib/tasks/solr_marc_task_spec.rb +0 -60
- data/spec/requests/alternate_controller_spec.rb +0 -16
- data/spec/routing/routes_spec.rb +0 -20
- data/spec/views/catalog/_constraints.html.erb_spec.rb +0 -33
- data/spec/views/catalog/_paginate_compact.html.erb_spec.rb +0 -49
- data/test_support/data/test_data.utf8.mrc +0 -1
@@ -34,9 +34,6 @@ fr:
|
|
34
34
|
or: 'ou'
|
35
35
|
|
36
36
|
bookmarks:
|
37
|
-
collection:
|
38
|
-
add:
|
39
|
-
button: 'Panier'
|
40
37
|
title: 'Favoris'
|
41
38
|
no_bookmarks: 'Accédez à votre compte pour conserver des références dans votre panier'
|
42
39
|
add:
|
@@ -116,7 +113,6 @@ fr:
|
|
116
113
|
refworks: 'Exporter vers Refworks'
|
117
114
|
email: 'Envoyer'
|
118
115
|
sms: 'SMS'
|
119
|
-
librarian_view: 'Vue UNIMARC'
|
120
116
|
clear: 'Effacer'
|
121
117
|
|
122
118
|
citation:
|
@@ -181,7 +177,7 @@ fr:
|
|
181
177
|
request_error: "Pardon, nous n'avons pas compris votre recherche."
|
182
178
|
invalid_solr_id: "Vous avez demandé une notice qui n'existe pas."
|
183
179
|
per_page:
|
184
|
-
label: '%{count}<span class="
|
180
|
+
label: '%{count}<span class="sr-only"> par page</span>'
|
185
181
|
button_label: '%{count} par page'
|
186
182
|
title: 'Nombre de résultats à afficher par page'
|
187
183
|
submit: 'mettre à jour'
|
@@ -228,16 +224,9 @@ fr:
|
|
228
224
|
remove:
|
229
225
|
value: 'Supprimer la restriction %{value}'
|
230
226
|
label_value: 'Supprimer la restriction %{label}: %{value}'
|
231
|
-
librarian_view:
|
232
|
-
title: 'Vue UNIMARC'
|
233
|
-
leader: 'LABEL %{leader}'
|
234
|
-
empty: 'Pas MARC trouvé.'
|
235
227
|
start_over: 'Accueil'
|
236
|
-
index:
|
237
|
-
label: '%{label}'
|
238
228
|
show:
|
239
229
|
title: '%{document_title} - %{application_name}'
|
240
|
-
label: '%{label}'
|
241
230
|
rss_feed: 'RSS pour les résultats'
|
242
231
|
atom_feed: 'Atom pour les résultats'
|
243
232
|
fields:
|
@@ -0,0 +1,21 @@
|
|
1
|
+
source 'http://rubygems.org'
|
2
|
+
|
3
|
+
# Please see blacklight.gemspec for dependency information.
|
4
|
+
gemspec :path=>"../"
|
5
|
+
|
6
|
+
gem 'rails', "~> 3.2"
|
7
|
+
|
8
|
+
gem 'activerecord-jdbcsqlite3-adapter', :platform => :jruby
|
9
|
+
|
10
|
+
group :test do
|
11
|
+
gem 'devise'
|
12
|
+
gem 'devise-guests'
|
13
|
+
gem "bootstrap-sass"
|
14
|
+
gem 'turbolinks'
|
15
|
+
gem 'uglifier'
|
16
|
+
end
|
17
|
+
|
18
|
+
f = File.expand_path(File.dirname(__FILE__) + '/../spec/test_app_templates/Gemfile.extra')
|
19
|
+
if File.exists?(f)
|
20
|
+
eval File.read(f), nil, f
|
21
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
source 'http://rubygems.org'
|
2
|
+
|
3
|
+
# Please see blacklight.gemspec for dependency information.
|
4
|
+
gemspec :path=>"../"
|
5
|
+
|
6
|
+
gem 'rails', '~> 4.0.0'
|
7
|
+
|
8
|
+
gem 'activerecord-jdbcsqlite3-adapter', :platform => :jruby
|
9
|
+
|
10
|
+
group :test do
|
11
|
+
gem 'devise'
|
12
|
+
gem 'devise-guests'
|
13
|
+
gem "bootstrap-sass"
|
14
|
+
gem 'turbolinks'
|
15
|
+
end
|
16
|
+
|
17
|
+
f = File.expand_path(File.dirname(__FILE__) + '/../spec/test_app_templates/Gemfile.extra')
|
18
|
+
if File.exists?(f)
|
19
|
+
eval File.read(f), nil, f
|
20
|
+
end
|
data/lib/blacklight.rb
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
# -*- encoding : utf-8 -*-
|
2
2
|
require 'kaminari'
|
3
3
|
require 'rsolr'
|
4
|
-
require 'deprecation'
|
5
4
|
|
6
5
|
module Blacklight
|
7
6
|
|
@@ -10,7 +9,6 @@ module Blacklight
|
|
10
9
|
autoload :SearchFields, 'blacklight/search_fields'
|
11
10
|
|
12
11
|
autoload :Solr, 'blacklight/solr'
|
13
|
-
autoload :Marc, 'blacklight/marc'
|
14
12
|
|
15
13
|
autoload :SolrHelper, 'blacklight/solr_helper'
|
16
14
|
|
@@ -30,7 +28,6 @@ module Blacklight
|
|
30
28
|
autoload :Facet, 'blacklight/facet'
|
31
29
|
|
32
30
|
extend SearchFields
|
33
|
-
extend Deprecation
|
34
31
|
|
35
32
|
require 'blacklight/version'
|
36
33
|
require 'blacklight/engine' if defined?(Rails)
|
@@ -41,7 +38,6 @@ module Blacklight
|
|
41
38
|
|
42
39
|
# Adding a little jruby support
|
43
40
|
def self.jruby?
|
44
|
-
Deprecation.warn(Blacklight, "Blacklight.jruby? is deprecated")
|
45
41
|
defined?(RUBY_ENGINE) && RUBY_ENGINE == "jruby"
|
46
42
|
end
|
47
43
|
|
@@ -54,7 +50,6 @@ module Blacklight
|
|
54
50
|
end
|
55
51
|
|
56
52
|
def self.solr
|
57
|
-
Deprecation.warn Blacklight, "Blacklight.solr is deprecated and will be removed in Blacklight 5.0"
|
58
53
|
@solr ||= RSolr.connect(Blacklight.solr_config)
|
59
54
|
end
|
60
55
|
|
@@ -119,12 +114,10 @@ module Blacklight
|
|
119
114
|
# BE AWARE - When you do this, you are monkey patching Blacklight
|
120
115
|
# we should eventually find a better way - such as the acts_as pattern
|
121
116
|
def self.models_dir
|
122
|
-
Deprecation.warn(Blacklight, "Blacklight.models_dir is deprecated")
|
123
117
|
"#{root}/app/models"
|
124
118
|
end
|
125
119
|
|
126
120
|
def self.controllers_dir
|
127
|
-
Deprecation.warn(Blacklight, "Blacklight.controllers_dir is deprecated")
|
128
121
|
"#{root}/app/controllers"
|
129
122
|
end
|
130
123
|
|
@@ -138,7 +131,6 @@ module Blacklight
|
|
138
131
|
# full_path_to_solr_marc_jar = Blacklight.locate_path 'solr_marc', 'SolrMarc.jar'
|
139
132
|
|
140
133
|
def self.locate_path(*subpath_fragments)
|
141
|
-
Deprecation.warn(Blacklight, "Blacklight.locate_path is deprecated")
|
142
134
|
subpath = subpath_fragments.join('/')
|
143
135
|
base_match = [Rails.root, self.root].find do |base|
|
144
136
|
File.exists? File.join(base, subpath)
|
data/lib/blacklight/base.rb
CHANGED
@@ -5,8 +5,6 @@ module Blacklight::Base
|
|
5
5
|
include Blacklight::Configurable
|
6
6
|
include Blacklight::SolrHelper
|
7
7
|
|
8
|
-
require 'blacklight/catalog/search_context'
|
9
|
-
include Blacklight::Catalog::SearchContext
|
10
8
|
|
11
9
|
included do
|
12
10
|
# When RSolr::RequestError is raised, the rsolr_request_error method is executed.
|
data/lib/blacklight/catalog.rb
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
# -*- encoding : utf-8 -*-
|
2
2
|
module Blacklight::Catalog
|
3
|
-
extend Deprecation
|
4
|
-
self.deprecation_horizon = 'Blacklight 5.x'
|
5
|
-
|
6
3
|
extend ActiveSupport::Concern
|
7
4
|
|
8
5
|
include Blacklight::Base
|
6
|
+
|
7
|
+
require 'blacklight/catalog/search_context'
|
8
|
+
include Blacklight::Catalog::SearchContext
|
9
9
|
|
10
10
|
SearchHistoryWindow = 100 # how many searches to save in session history
|
11
11
|
|
@@ -27,12 +27,7 @@ module Blacklight::Catalog
|
|
27
27
|
@filters = params[:f] || []
|
28
28
|
|
29
29
|
respond_to do |format|
|
30
|
-
format.html {
|
31
|
-
Deprecation.silence(Blacklight::LegacyControllerMethods) do
|
32
|
-
extra_head_content << view_context.auto_discovery_link_tag(:rss, url_for(params.merge(:format => 'rss')), :title => t('blacklight.search.rss_feed') )
|
33
|
-
extra_head_content << view_context.auto_discovery_link_tag(:atom, url_for(params.merge(:format => 'atom')), :title => t('blacklight.search.atom_feed') )
|
34
|
-
end
|
35
|
-
}
|
30
|
+
format.html { }
|
36
31
|
format.rss { render :layout => false }
|
37
32
|
format.atom { render :layout => false }
|
38
33
|
|
@@ -65,8 +60,8 @@ module Blacklight::Catalog
|
|
65
60
|
|
66
61
|
# updates the search counter (allows the show view to paginate)
|
67
62
|
def update
|
68
|
-
search_session[
|
69
|
-
redirect_to :action => "show"
|
63
|
+
search_session[:counter] = params[:counter]
|
64
|
+
redirect_to :action => "show", :status => 303
|
70
65
|
end
|
71
66
|
|
72
67
|
# displays values and pagination links for a single facet field
|
@@ -158,16 +153,6 @@ module Blacklight::Catalog
|
|
158
153
|
end
|
159
154
|
end
|
160
155
|
|
161
|
-
def librarian_view
|
162
|
-
@response, @document = get_solr_response_for_doc_id
|
163
|
-
|
164
|
-
respond_to do |format|
|
165
|
-
format.html
|
166
|
-
format.js { render :layout => false }
|
167
|
-
end
|
168
|
-
end
|
169
|
-
|
170
|
-
|
171
156
|
protected
|
172
157
|
#
|
173
158
|
# non-routable methods ->
|
@@ -199,13 +184,6 @@ module Blacklight::Catalog
|
|
199
184
|
url_for(options.merge(:action => 'index', :only_path => true))
|
200
185
|
end
|
201
186
|
|
202
|
-
# we need to know if we are viewing the item as part of search results so we know whether to
|
203
|
-
# include certain partials or not
|
204
|
-
def adjust_for_results_view
|
205
|
-
# deprecated in blacklight 4.x
|
206
|
-
Deprecation.warn(self, "#adjust_for_results_view helper was deprecated in Blacklight 4.x")
|
207
|
-
end
|
208
|
-
|
209
187
|
# extract the pagination info from the response object
|
210
188
|
def pagination_info response
|
211
189
|
h = {}
|
@@ -264,10 +242,6 @@ module Blacklight::Catalog
|
|
264
242
|
render "index", :status => 404
|
265
243
|
end
|
266
244
|
|
267
|
-
def start_new_search_session?
|
268
|
-
action_name == "index"
|
269
|
-
end
|
270
|
-
|
271
245
|
def blacklight_solr
|
272
246
|
@solr ||= RSolr.connect(blacklight_solr_config)
|
273
247
|
end
|
@@ -26,9 +26,9 @@ module Blacklight::Catalog::SearchContext
|
|
26
26
|
# The current search session
|
27
27
|
def current_search_session
|
28
28
|
|
29
|
-
@current_search_session ||= if
|
29
|
+
@current_search_session ||= if action_name == "index"
|
30
30
|
find_or_initialize_search_session_from_params params
|
31
|
-
elsif params[:search_context]
|
31
|
+
elsif params[:search_context].present?
|
32
32
|
find_or_initialize_search_session_from_params JSON.load(params[:search_context])
|
33
33
|
elsif params[:search_id].present?
|
34
34
|
begin
|
@@ -37,28 +37,19 @@ module Blacklight::Catalog::SearchContext
|
|
37
37
|
rescue ActiveRecord::RecordNotFound
|
38
38
|
nil
|
39
39
|
end
|
40
|
-
elsif search_session[
|
40
|
+
elsif search_session[:id]
|
41
41
|
begin
|
42
|
-
searches_from_history.find(search_session[
|
42
|
+
searches_from_history.find(search_session[:id])
|
43
43
|
rescue ActiveRecord::RecordNotFound
|
44
44
|
nil
|
45
45
|
end
|
46
46
|
end
|
47
47
|
|
48
|
-
if @current_search_session
|
49
|
-
search_session['id'] = @current_search_session.id
|
50
|
-
end
|
48
|
+
search_session[:id] = @current_search_session.id if @current_search_session
|
51
49
|
|
52
50
|
@current_search_session
|
53
51
|
end
|
54
52
|
|
55
|
-
##
|
56
|
-
# If the current action should start a new search session, this should be
|
57
|
-
# set to true
|
58
|
-
def start_new_search_session?
|
59
|
-
false
|
60
|
-
end
|
61
|
-
|
62
53
|
def find_or_initialize_search_session_from_params params
|
63
54
|
params_copy = params.reject { |k,v| blacklisted_search_session_params.include?(k.to_sym) or v.blank? }
|
64
55
|
|
@@ -94,46 +85,15 @@ module Blacklight::Catalog::SearchContext
|
|
94
85
|
# calls setup_previous_document then setup_next_document.
|
95
86
|
# used in the show action for single view pagination.
|
96
87
|
def setup_next_and_previous_documents
|
97
|
-
if search_session[
|
98
|
-
index = search_session[
|
88
|
+
if search_session[:counter] and current_search_session
|
89
|
+
index = search_session[:counter].to_i - 1
|
99
90
|
response, documents = get_previous_and_next_documents_for_search index, current_search_session.query_params
|
100
91
|
|
101
|
-
search_session[
|
92
|
+
search_session[:total] = response.total
|
102
93
|
@search_context_response = response
|
103
94
|
@previous_document = documents.first
|
104
95
|
@next_document = documents.last
|
105
96
|
end
|
106
97
|
end
|
107
98
|
|
108
|
-
# gets a document based on its position within a resultset
|
109
|
-
def setup_document_by_counter(counter)
|
110
|
-
ActiveSupport::Deprecation.warn("#setup_document_by_counter helper is deprecated in Blacklight 4.x and will be removed")
|
111
|
-
|
112
|
-
return if counter < 1 or current_search_session.nil?
|
113
|
-
get_single_doc_via_search(counter, current_search_session.query_params)
|
114
|
-
end
|
115
|
-
|
116
|
-
def setup_previous_document
|
117
|
-
ActiveSupport::Deprecation.warn("#setup_previous_document helper was deprecated in Blacklight 4.x; now happens automatically as part of #setup_next_and_previous_documents")
|
118
|
-
end
|
119
|
-
|
120
|
-
def setup_next_document
|
121
|
-
ActiveSupport::Deprecation.warn("#setup_next_document helper was deprecated in Blacklight 4.x; now happens automatically as part of #setup_next_and_previous_documents")
|
122
|
-
end
|
123
|
-
|
124
|
-
def delete_or_assign_search_session_params
|
125
|
-
# deprecated in blacklight 4.x
|
126
|
-
ActiveSupport::Deprecation.warn("#delete_or_assign_search_session_params helper was deprecated in Blacklight 4.x; now happens automatically as part of #current_search_session")
|
127
|
-
end
|
128
|
-
|
129
|
-
def save_current_search_params
|
130
|
-
# deprecated in blacklight 4.x
|
131
|
-
ActiveSupport::Deprecation.warn("#save_current_search_params helper was deprecated in Blacklight 4.x; now happens automatically as part of #current_search_session")
|
132
|
-
end
|
133
|
-
|
134
|
-
# sets some additional search metadata so that the show view can display it.
|
135
|
-
def set_additional_search_session_values
|
136
|
-
ActiveSupport::Deprecation.warn("#set_additional_search_session_values helper was deprecated in Blacklight 4.x")
|
137
|
-
end
|
138
|
-
|
139
99
|
end
|
@@ -41,7 +41,8 @@ module Blacklight::Configurable
|
|
41
41
|
end
|
42
42
|
|
43
43
|
##
|
44
|
-
# The default configuration object
|
44
|
+
# The default configuration object, by default it reads from Blacklight.config for backwards
|
45
|
+
# compatibility with Blacklight <= 3.1
|
45
46
|
def default_configuration
|
46
47
|
Blacklight::Configurable.default_configuration.inheritable_copy
|
47
48
|
end
|
@@ -25,8 +25,7 @@ module Blacklight
|
|
25
25
|
:search_history_window => Blacklight::Catalog::SearchHistoryWindow,
|
26
26
|
:document_index_view_types => ['list'],
|
27
27
|
:add_facet_fields_to_solr_request => false,
|
28
|
-
:add_field_configuration_to_solr_request => false
|
29
|
-
:http_method => :get
|
28
|
+
:add_field_configuration_to_solr_request => false
|
30
29
|
}
|
31
30
|
end
|
32
31
|
end
|
data/lib/blacklight/engine.rb
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
# -*- encoding : utf-8 -*-
|
2
|
-
# lib/blacklight/engine.rb
|
3
|
-
require "blacklight"
|
4
|
-
require "rails"
|
5
2
|
|
6
3
|
module Blacklight
|
7
4
|
class Engine < Rails::Engine
|
8
5
|
|
6
|
+
require 'bootstrap-sass'
|
7
|
+
require 'blacklight/rails/routes'
|
8
|
+
|
9
9
|
# BlacklightHelper is needed by all helpers, so we inject it
|
10
10
|
# into action view base here.
|
11
11
|
initializer 'blacklight.helpers' do |app|
|
@@ -6,63 +6,6 @@
|
|
6
6
|
# in here, but you may find them useful.
|
7
7
|
module Blacklight
|
8
8
|
module LegacyControllerMethods
|
9
|
-
extend ActiveSupport::Concern
|
10
|
-
|
11
|
-
extend Deprecation
|
12
|
-
self.deprecation_horizon = 'Blacklight 5.x'
|
13
|
-
|
14
|
-
|
15
|
-
included do
|
16
|
-
|
17
|
-
before_filter :default_html_head_without_deprecation # add JS/stylesheet stuff
|
18
|
-
|
19
|
-
helper_method :extra_head_content, :stylesheet_links, :javascript_includes
|
20
|
-
end
|
21
|
-
|
22
|
-
#############
|
23
|
-
# Display-related methods.
|
24
|
-
#############
|
25
|
-
|
26
|
-
# before filter to set up our default html HEAD content. Sub-class
|
27
|
-
# controllers can over-ride this method, or instead turn off the before_filter
|
28
|
-
# if they like. See:
|
29
|
-
# http://api.rubyonrails.org/classes/ActionController/Filters/ClassMethods.html
|
30
|
-
# for how to turn off a filter in a sub-class and such.
|
31
|
-
def default_html_head
|
32
|
-
Deprecation.warn Blacklight::LegacyControllerMethods, "#default_html_head is deprecated"
|
33
|
-
end
|
34
|
-
|
35
|
-
def default_html_head_without_deprecation
|
36
|
-
Deprecation.silence(Blacklight::LegacyControllerMethods) do
|
37
|
-
default_html_head
|
38
|
-
end
|
39
|
-
end
|
40
|
-
|
41
|
-
# An array of strings to be added to HTML HEAD section of view.
|
42
|
-
# See ApplicationHelper#render_head_content for details.
|
43
|
-
def extra_head_content
|
44
|
-
Deprecation.warn Blacklight::LegacyControllerMethods, "#extra_head_content is deprecated"
|
45
|
-
|
46
|
-
@extra_head_content ||= []
|
47
|
-
end
|
48
|
-
|
49
|
-
# Array, where each element is an array of arguments to
|
50
|
-
# Rails stylesheet_link_tag helper. See
|
51
|
-
# ApplicationHelper#render_head_content for details.
|
52
|
-
def stylesheet_links
|
53
|
-
Deprecation.warn Blacklight::LegacyControllerMethods, "#stylesheet_links is deprecated"
|
54
|
-
|
55
|
-
@stylesheet_links ||= []
|
56
|
-
end
|
57
|
-
|
58
|
-
# Array, where each element is an array of arguments to
|
59
|
-
# Rails javascript_include_tag helper. See
|
60
|
-
# ApplicationHelper#render_head_content for details.
|
61
|
-
def javascript_includes
|
62
|
-
Deprecation.warn Blacklight::LegacyControllerMethods, "#javascript_includes is deprecated"
|
63
|
-
|
64
|
-
@javascript_includes ||= []
|
65
|
-
end
|
66
9
|
|
67
10
|
protected
|
68
11
|
#
|
@@ -71,18 +14,12 @@ module Blacklight
|
|
71
14
|
# don't use a layout, otherwise use the "application.html.erb" layout
|
72
15
|
#
|
73
16
|
def choose_layout
|
74
|
-
|
75
|
-
|
76
|
-
Deprecation.silence(Blacklight::LegacyControllerMethods) do
|
77
|
-
layout_name unless request.xml_http_request? || ! params[:no_layout].blank?
|
78
|
-
end
|
17
|
+
layout_name unless request.xml_http_request? || ! params[:no_layout].blank?
|
79
18
|
end
|
80
19
|
|
81
20
|
#over-ride this one locally to change what layout BL controllers use, usually
|
82
21
|
#by defining it in your own application_controller.rb
|
83
22
|
def layout_name
|
84
|
-
Deprecation.warn Blacklight::LegacyControllerMethods, "#layout_name is deprecated"
|
85
|
-
|
86
23
|
'blacklight'
|
87
24
|
end
|
88
25
|
end
|