blacklight 6.0.0.pre5 → 6.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +8 -8
- data/Gemfile +11 -2
- data/VERSION +1 -1
- data/app/assets/stylesheets/blacklight/_facets.scss +1 -10
- data/app/controllers/bookmarks_controller.rb +1 -0
- data/app/controllers/catalog_controller.rb +1 -0
- data/app/controllers/concerns/blacklight/base.rb +1 -0
- data/app/controllers/concerns/blacklight/bookmarks.rb +13 -1
- data/app/controllers/concerns/blacklight/catalog.rb +7 -1
- data/app/controllers/concerns/blacklight/controller.rb +7 -6
- data/app/controllers/concerns/blacklight/default_component_configuration.rb +1 -0
- data/app/controllers/concerns/blacklight/facet.rb +1 -0
- data/app/controllers/concerns/blacklight/request_builders.rb +1 -0
- data/app/controllers/concerns/blacklight/search_context.rb +8 -12
- data/app/controllers/concerns/blacklight/search_fields.rb +1 -0
- data/app/controllers/concerns/blacklight/search_helper.rb +2 -1
- data/app/controllers/concerns/blacklight/search_history.rb +32 -0
- data/app/controllers/concerns/blacklight/suggest.rb +1 -0
- data/app/controllers/concerns/blacklight/suggest_search.rb +1 -0
- data/app/controllers/concerns/blacklight/token_based_user.rb +1 -0
- data/app/controllers/saved_searches_controller.rb +20 -9
- data/app/controllers/search_history_controller.rb +2 -18
- data/app/controllers/suggest_controller.rb +1 -0
- data/app/helpers/blacklight/blacklight_helper_behavior.rb +1 -0
- data/app/helpers/blacklight/catalog_helper_behavior.rb +15 -1
- data/app/helpers/blacklight/component_helper_behavior.rb +1 -0
- data/app/helpers/blacklight/configuration_helper_behavior.rb +1 -0
- data/app/helpers/blacklight/deprecated_url_helper_behavior.rb +1 -0
- data/app/helpers/blacklight/facets_helper_behavior.rb +1 -0
- data/app/helpers/blacklight/hash_as_hidden_fields_helper_behavior.rb +1 -0
- data/app/helpers/blacklight/layout_helper_behavior.rb +1 -0
- data/app/helpers/blacklight/render_constraints_helper_behavior.rb +9 -6
- data/app/helpers/blacklight/render_partials_helper.rb +15 -4
- data/app/helpers/blacklight/search_history_constraints_helper_behavior.rb +1 -0
- data/app/helpers/blacklight/suggest_helper_behavior.rb +1 -0
- data/app/helpers/blacklight/url_helper_behavior.rb +6 -6
- data/app/helpers/blacklight_configuration_helper.rb +1 -0
- data/app/helpers/blacklight_helper.rb +1 -0
- data/app/helpers/blacklight_url_helper.rb +1 -0
- data/app/helpers/catalog_helper.rb +1 -0
- data/app/helpers/component_helper.rb +1 -0
- data/app/helpers/facets_helper.rb +1 -0
- data/app/helpers/hash_as_hidden_fields_helper.rb +1 -0
- data/app/helpers/layout_helper.rb +1 -0
- data/app/helpers/render_constraints_helper.rb +1 -0
- data/app/helpers/search_history_constraints_helper.rb +1 -0
- data/app/helpers/suggest_helper.rb +1 -0
- data/app/models/blacklight/facet_paginator.rb +6 -2
- data/app/models/blacklight/solr/facet_paginator.rb +1 -0
- data/app/models/bookmark.rb +1 -0
- data/app/models/concerns/blacklight/configurable.rb +1 -0
- data/app/models/concerns/blacklight/document.rb +1 -0
- data/app/models/concerns/blacklight/document/active_model_shim.rb +1 -0
- data/app/models/concerns/blacklight/document/cache_key.rb +1 -0
- data/app/models/concerns/blacklight/document/dublin_core.rb +1 -0
- data/app/models/concerns/blacklight/document/email.rb +1 -0
- data/app/models/concerns/blacklight/document/export.rb +1 -0
- data/app/models/concerns/blacklight/document/extensions.rb +1 -0
- data/app/models/concerns/blacklight/document/schema_org.rb +1 -0
- data/app/models/concerns/blacklight/document/semantic_fields.rb +1 -0
- data/app/models/concerns/blacklight/document/sms.rb +1 -0
- data/app/models/concerns/blacklight/solr/document.rb +1 -0
- data/app/models/concerns/blacklight/solr/document/more_like_this.rb +1 -0
- data/app/models/concerns/blacklight/suggest/response.rb +1 -0
- data/app/models/concerns/blacklight/user.rb +1 -0
- data/app/models/record_mailer.rb +1 -0
- data/app/models/search.rb +4 -1
- data/app/models/solr_document.rb +1 -0
- data/app/presenters/blacklight/document_presenter.rb +17 -1
- data/app/presenters/blacklight/json_presenter.rb +1 -0
- data/app/views/bookmarks/_tools.html.erb +1 -1
- data/app/views/catalog/_facet_index_navigation.html.erb +2 -2
- data/app/views/catalog/_facet_pagination.html.erb +4 -4
- data/app/views/catalog/_search_results.html.erb +3 -5
- data/app/views/catalog/_view_type_group.html.erb +1 -1
- data/app/views/catalog/index.atom.builder +7 -7
- data/app/views/catalog/index.json.jbuilder +0 -1
- data/app/views/catalog/index.rss.builder +1 -4
- data/config/locales/blacklight.de.yml +0 -2
- data/config/locales/blacklight.es.yml +0 -2
- data/config/locales/blacklight.it.yml +0 -2
- data/config/locales/blacklight.pt-BR.yml +0 -6
- data/config/routes.rb +1 -0
- data/db/migrate/20140202020201_create_searches.rb +1 -0
- data/db/migrate/20140202020202_create_bookmarks.rb +1 -0
- data/db/migrate/20140320000000_add_polymorphic_type_to_bookmarks.rb +1 -0
- data/lib/blacklight.rb +3 -1
- data/lib/blacklight/abstract_repository.rb +1 -0
- data/lib/blacklight/configuration.rb +1 -0
- data/lib/blacklight/configuration/context.rb +1 -0
- data/lib/blacklight/configuration/facet_field.rb +1 -0
- data/lib/blacklight/configuration/field.rb +1 -0
- data/lib/blacklight/configuration/fields.rb +1 -0
- data/lib/blacklight/configuration/search_field.rb +1 -0
- data/lib/blacklight/configuration/sort_field.rb +1 -0
- data/lib/blacklight/configuration/tool_config.rb +1 -0
- data/lib/blacklight/configuration/view_config.rb +1 -0
- data/lib/blacklight/engine.rb +1 -0
- data/lib/blacklight/exceptions.rb +1 -0
- data/lib/blacklight/parameters.rb +4 -4
- data/lib/blacklight/routes.rb +1 -0
- data/lib/blacklight/routes/exportable.rb +1 -0
- data/lib/blacklight/routes/searchable.rb +1 -0
- data/lib/blacklight/search_builder.rb +1 -0
- data/lib/blacklight/search_state.rb +22 -5
- data/lib/blacklight/solr.rb +1 -0
- data/lib/blacklight/solr/repository.rb +1 -0
- data/lib/blacklight/solr/request.rb +1 -0
- data/lib/blacklight/solr/response.rb +7 -1
- data/lib/blacklight/solr/response/facets.rb +1 -0
- data/lib/blacklight/solr/response/group.rb +1 -0
- data/lib/blacklight/solr/response/group_response.rb +1 -0
- data/lib/blacklight/solr/response/more_like_this.rb +1 -0
- data/lib/blacklight/solr/response/pagination_methods.rb +1 -0
- data/lib/blacklight/solr/response/response.rb +1 -0
- data/lib/blacklight/solr/response/spelling.rb +1 -0
- data/lib/blacklight/solr/search_builder_behavior.rb +19 -14
- data/lib/blacklight/utils.rb +1 -0
- data/lib/blacklight/version.rb +1 -0
- data/lib/generators/blacklight/assets_generator.rb +1 -0
- data/lib/generators/blacklight/controller_generator.rb +1 -0
- data/lib/generators/blacklight/document_generator.rb +1 -0
- data/lib/generators/blacklight/install_generator.rb +1 -0
- data/lib/generators/blacklight/models_generator.rb +1 -0
- data/lib/generators/blacklight/search_builder_generator.rb +1 -0
- data/lib/generators/blacklight/solr4_generator.rb +1 -0
- data/lib/generators/blacklight/solr5_generator.rb +2 -2
- data/lib/generators/blacklight/templates/alternate_controller.rb +1 -0
- data/lib/generators/blacklight/templates/catalog_controller.rb +1 -0
- data/lib/generators/blacklight/templates/search_builder.rb +1 -0
- data/lib/generators/blacklight/templates/solr_document.rb +1 -0
- data/lib/generators/blacklight/test_support_generator.rb +1 -0
- data/lib/generators/blacklight/user_generator.rb +10 -6
- data/lib/railties/blacklight.rake +3 -3
- data/spec/controllers/alternate_controller_spec.rb +1 -0
- data/spec/controllers/application_controller_spec.rb +1 -0
- data/spec/controllers/blacklight/base_spec.rb +5 -3
- data/spec/controllers/blacklight/catalog/component_configuration_spec.rb +1 -0
- data/spec/controllers/blacklight/facet_spec.rb +1 -0
- data/spec/controllers/blacklight/search_fields_spec.rb +1 -0
- data/spec/controllers/blacklight/search_helper_spec.rb +1 -0
- data/spec/controllers/blacklight/suggest_search_spec.rb +1 -0
- data/spec/controllers/bookmarks_controller_spec.rb +1 -0
- data/spec/controllers/catalog_controller_spec.rb +17 -14
- data/spec/controllers/saved_searches_controller_spec.rb +1 -0
- data/spec/controllers/search_history_controller_spec.rb +1 -0
- data/spec/controllers/suggest_controller_spec.rb +1 -0
- data/spec/features/alternate_controller_spec.rb +1 -0
- data/spec/features/bookmarks_spec.rb +1 -0
- data/spec/features/did_you_mean_spec.rb +1 -0
- data/spec/features/facets_spec.rb +1 -0
- data/spec/features/record_view_spec.rb +1 -0
- data/spec/features/saved_searches_spec.rb +1 -0
- data/spec/features/search_context_spec.rb +1 -0
- data/spec/features/search_filters_spec.rb +2 -1
- data/spec/features/search_formats_spec.rb +1 -0
- data/spec/features/search_history_spec.rb +1 -0
- data/spec/features/search_pagination_spec.rb +1 -0
- data/spec/features/search_results_spec.rb +1 -0
- data/spec/features/search_sort_spec.rb +1 -0
- data/spec/features/search_spec.rb +1 -0
- data/spec/features/sitelinks_search_box.rb +1 -0
- data/spec/helpers/blacklight_helper_spec.rb +3 -2
- data/spec/helpers/catalog_helper_spec.rb +11 -16
- data/spec/helpers/configuration_helper_spec.rb +1 -0
- data/spec/helpers/deprecated_url_helper_behavior_spec.rb +18 -9
- data/spec/helpers/facets_helper_spec.rb +1 -0
- data/spec/helpers/hash_as_hidden_fields_spec.rb +1 -0
- data/spec/helpers/layout_helper_spec.rb +1 -0
- data/spec/helpers/render_constraints_helper_spec.rb +18 -8
- data/spec/helpers/search_history_constraints_helper_spec.rb +1 -0
- data/spec/helpers/suggest_helper_spec.rb +1 -0
- data/spec/helpers/url_helper_spec.rb +72 -68
- data/spec/lib/blacklight/parameters_spec.rb +3 -2
- data/spec/lib/blacklight/search_state_spec.rb +44 -32
- data/spec/lib/blacklight/utils_spec.rb +1 -0
- data/spec/lib/blacklight_spec.rb +11 -3
- data/spec/lib/tasks/blacklight_task_spec.rb +1 -0
- data/spec/models/blacklight/configurable_spec.rb +1 -0
- data/spec/models/blacklight/configuration/context_spec.rb +1 -0
- data/spec/models/blacklight/configuration_spec.rb +1 -0
- data/spec/models/blacklight/document/active_model_shim_spec.rb +1 -0
- data/spec/models/blacklight/document/cache_key_spec.rb +1 -0
- data/spec/models/blacklight/document/dublin_core_spec.rb +1 -0
- data/spec/models/blacklight/document/email_spec.rb +1 -0
- data/spec/models/blacklight/document/sms_spec.rb +1 -0
- data/spec/models/blacklight/document_spec.rb +1 -0
- data/spec/models/blacklight/facet_paginator_spec.rb +21 -8
- data/spec/models/blacklight/search_builder_spec.rb +1 -0
- data/spec/models/blacklight/solr/document/more_like_this_spec.rb +1 -0
- data/spec/models/blacklight/solr/document_spec.rb +1 -0
- data/spec/models/blacklight/solr/facet_paginator_spec.rb +1 -0
- data/spec/models/blacklight/solr/repository_spec.rb +1 -0
- data/spec/models/blacklight/solr/request_spec.rb +1 -0
- data/spec/models/blacklight/solr/response/facets_spec.rb +1 -0
- data/spec/models/blacklight/solr/response/group_response_spec.rb +1 -0
- data/spec/models/blacklight/solr/response/group_spec.rb +1 -0
- data/spec/models/blacklight/solr/response_spec.rb +1 -0
- data/spec/models/blacklight/solr/search_builder_spec.rb +21 -30
- data/spec/models/blacklight/suggest/response_spec.rb +1 -0
- data/spec/models/blacklight/user_spec.rb +1 -0
- data/spec/models/bookmark_spec.rb +4 -3
- data/spec/models/record_mailer_spec.rb +1 -0
- data/spec/models/search_spec.rb +22 -38
- data/spec/models/solr_document_spec.rb +1 -0
- data/spec/presenters/document_presenter_spec.rb +7 -3
- data/spec/routing/catalog_routing_spec.rb +1 -0
- data/spec/spec_helper.rb +1 -0
- data/spec/support/controller_level_helpers.rb +2 -1
- data/spec/support/features.rb +1 -0
- data/spec/support/features/session_helpers.rb +1 -0
- data/spec/test_app_templates/Gemfile.extra +14 -0
- data/spec/test_app_templates/lib/generators/test_app_generator.rb +1 -0
- data/spec/views/_user_util_links.html.erb_spec.rb +1 -0
- data/spec/views/catalog/_constraints.html.erb_spec.rb +1 -0
- data/spec/views/catalog/_constraints_element.html.erb_spec.rb +1 -0
- data/spec/views/catalog/_document.html.erb_spec.rb +1 -0
- data/spec/views/catalog/_document_list.html.erb_spec.rb +1 -0
- data/spec/views/catalog/_facet_index_navigation.html.erb_spec.rb +4 -1
- data/spec/views/catalog/_facet_layout.html.erb_spec.rb +1 -0
- data/spec/views/catalog/_facets.html.erb_spec.rb +1 -0
- data/spec/views/catalog/_index_default.erb_spec.rb +1 -0
- data/spec/views/catalog/_index_header_default.html.erb_spec.rb +1 -0
- data/spec/views/catalog/_paginate_compact.html.erb_spec.rb +1 -0
- data/spec/views/catalog/_search_header.erb_spec.rb +1 -0
- data/spec/views/catalog/_show_default.erb_spec.rb +1 -0
- data/spec/views/catalog/_show_sidebar.erb_spec.rb +1 -0
- data/spec/views/catalog/_show_tools.html.erb_spec.rb +1 -0
- data/spec/views/catalog/_sort_and_per_page.html.erb_spec.rb +1 -0
- data/spec/views/catalog/_thumbnail_default.erb_spec.rb +1 -0
- data/spec/views/catalog/_view_type_group.html.erb_spec.rb +1 -0
- data/spec/views/catalog/facet.html.erb_spec.rb +1 -0
- data/spec/views/catalog/facet.json.jbuilder_spec.rb +1 -0
- data/spec/views/catalog/index.atom.builder_spec.rb +19 -27
- data/spec/views/catalog/index.html.erb_spec.rb +1 -0
- data/spec/views/catalog/index.json.jbuilder_spec.rb +1 -0
- data/spec/views/catalog/opensearch.xml.builder_spec.rb +1 -0
- data/spec/views/catalog/show.html.erb_spec.rb +1 -0
- data/template.demo.rb +1 -0
- metadata +7 -5
- data/app/views/catalog/show.refworks.erb +0 -1
@@ -1,20 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
class SearchHistoryController < ApplicationController
|
2
|
-
include Blacklight::
|
3
|
-
|
4
|
-
copy_blacklight_config_from(CatalogController)
|
5
|
-
|
6
|
-
def index
|
7
|
-
@searches = searches_from_history
|
8
|
-
end
|
9
|
-
|
10
|
-
|
11
|
-
#TODO we may want to remove unsaved (those without user_id) items from the database when removed from history
|
12
|
-
def clear
|
13
|
-
if session[:history].clear
|
14
|
-
flash[:notice] = I18n.t('blacklight.search_history.clear.success')
|
15
|
-
else
|
16
|
-
flash[:error] = I18n.t('blacklight.search_history.clear.failure')
|
17
|
-
end
|
18
|
-
redirect_to :back
|
19
|
-
end
|
3
|
+
include Blacklight::SearchHistory
|
20
4
|
end
|
@@ -1,5 +1,14 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
module Blacklight::CatalogHelperBehavior
|
2
3
|
|
4
|
+
def rss_feed_link_tag
|
5
|
+
auto_discovery_link_tag(:rss, feed_link_url('rss'), title: t('blacklight.search.rss_feed'))
|
6
|
+
end
|
7
|
+
|
8
|
+
def atom_feed_link_tag
|
9
|
+
auto_discovery_link_tag(:atom, feed_link_url('atom'), title: t('blacklight.search.atom_feed'))
|
10
|
+
end
|
11
|
+
|
3
12
|
##
|
4
13
|
# Override the Kaminari page_entries_info helper with our own, blacklight-aware
|
5
14
|
# implementation.
|
@@ -257,10 +266,15 @@ module Blacklight::CatalogHelperBehavior
|
|
257
266
|
end
|
258
267
|
|
259
268
|
if params['f'].present?
|
260
|
-
constraints += params['f'].collect{ |key, value| render_search_to_page_title_filter(key, value) }
|
269
|
+
constraints += params['f'].to_unsafe_h.collect { |key, value| render_search_to_page_title_filter(key, value) }
|
261
270
|
end
|
262
271
|
|
263
272
|
constraints.join(' / ')
|
264
273
|
end
|
265
274
|
|
275
|
+
private
|
276
|
+
|
277
|
+
def feed_link_url(format)
|
278
|
+
url_for search_state.to_h.merge(format: format)
|
279
|
+
end
|
266
280
|
end
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
# All methods in here are 'api' that may be over-ridden by plugins and local
|
2
3
|
# code, so method signatures and semantics should not be changed casually.
|
3
4
|
# implementations can be of course.
|
@@ -17,17 +18,17 @@ module Blacklight::RenderConstraintsHelperBehavior
|
|
17
18
|
|
18
19
|
##
|
19
20
|
# Render the actual constraints, not including header or footer
|
20
|
-
# info.
|
21
|
-
#
|
21
|
+
# info.
|
22
|
+
#
|
22
23
|
# @param [Hash] query parameters
|
23
24
|
# @return [String]
|
24
25
|
def render_constraints(localized_params = params)
|
25
26
|
render_constraints_query(localized_params) + render_constraints_filters(localized_params)
|
26
27
|
end
|
27
|
-
|
28
|
+
|
28
29
|
##
|
29
30
|
# Render the query constraints
|
30
|
-
#
|
31
|
+
#
|
31
32
|
# @param [Hash] query parameters
|
32
33
|
# @return [String]
|
33
34
|
def render_constraints_query(localized_params = params)
|
@@ -35,10 +36,12 @@ module Blacklight::RenderConstraintsHelperBehavior
|
|
35
36
|
scope = localized_params.delete(:route_set) || self
|
36
37
|
return "".html_safe if localized_params[:q].blank?
|
37
38
|
|
39
|
+
options = localized_params.merge(:q=>nil, :action=>'index')
|
40
|
+
options.permit!
|
38
41
|
render_constraint_element(constraint_query_label(localized_params),
|
39
42
|
localized_params[:q],
|
40
|
-
:
|
41
|
-
:
|
43
|
+
classes: ["query"],
|
44
|
+
remove: scope.url_for(options))
|
42
45
|
end
|
43
46
|
|
44
47
|
##
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
module Blacklight::RenderPartialsHelper
|
2
3
|
##
|
3
4
|
# Render the document index view
|
@@ -102,10 +103,20 @@ module Blacklight::RenderPartialsHelper
|
|
102
103
|
# @example
|
103
104
|
# type_field_to_partial_name(['a book-article'])
|
104
105
|
# => 'a_book_article'
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
106
|
+
if Rails.version >= '5.0.0'
|
107
|
+
def type_field_to_partial_name(document, display_type)
|
108
|
+
# using "_" as sep. to more closely follow the views file naming conventions
|
109
|
+
# parameterize uses "-" as the default sep. which throws errors
|
110
|
+
underscore = '_'.freeze
|
111
|
+
Array(display_type).join(' '.freeze).tr('-'.freeze, underscore).parameterize(separator: underscore)
|
112
|
+
end
|
113
|
+
else
|
114
|
+
def type_field_to_partial_name(document, display_type)
|
115
|
+
# using "_" as sep. to more closely follow the views file naming conventions
|
116
|
+
# parameterize uses "-" as the default sep. which throws errors
|
117
|
+
underscore = '_'.freeze
|
118
|
+
Array(display_type).join(' '.freeze).tr('-'.freeze, underscore).parameterize(underscore)
|
119
|
+
end
|
109
120
|
end
|
110
121
|
|
111
122
|
##
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
##
|
2
3
|
# URL helper methods
|
3
4
|
module Blacklight::UrlHelperBehavior
|
@@ -90,10 +91,9 @@ module Blacklight::UrlHelperBehavior
|
|
90
91
|
|
91
92
|
# create link to query (e.g. spelling suggestion)
|
92
93
|
def link_to_query(query)
|
93
|
-
p =
|
94
|
-
p[:q]=query
|
95
|
-
|
96
|
-
link_to(query, link_url)
|
94
|
+
p = search_state.to_h.except(:page, :action)
|
95
|
+
p[:q] = query
|
96
|
+
link_to(query, search_action_path(p))
|
97
97
|
end
|
98
98
|
|
99
99
|
##
|
@@ -113,8 +113,8 @@ module Blacklight::UrlHelperBehavior
|
|
113
113
|
# link_back_to_catalog(label: 'Back to Search', route_set: my_engine)
|
114
114
|
def link_back_to_catalog(opts={:label=>nil})
|
115
115
|
scope = opts.delete(:route_set) || self
|
116
|
-
query_params = current_search_session.try(:query_params) ||
|
117
|
-
|
116
|
+
query_params = current_search_session.try(:query_params) || ActionController::Parameters.new
|
117
|
+
|
118
118
|
if search_session['counter']
|
119
119
|
per_page = (search_session['per_page'] || default_per_page).to_i
|
120
120
|
counter = search_session['counter'].to_i
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
module Blacklight
|
2
3
|
# Pagination for facet values -- works by setting the limit to max
|
3
4
|
# displayable. You have to ask Solr for limit+1, to get enough
|
@@ -28,7 +29,7 @@ module Blacklight
|
|
28
29
|
# :sort => 'count' or 'index', solr tokens for facet value sorting, default 'count'.
|
29
30
|
def initialize(all_facet_values, arguments = {})
|
30
31
|
# to_s.to_i will conveniently default to 0 if nil
|
31
|
-
@offset = arguments[:offset].to_s.to_i
|
32
|
+
@offset = arguments[:offset].to_s.to_i
|
32
33
|
@limit = arguments[:limit]
|
33
34
|
@sort = arguments[:sort]
|
34
35
|
@prefix = arguments[:prefix]
|
@@ -50,7 +51,8 @@ module Blacklight
|
|
50
51
|
end
|
51
52
|
|
52
53
|
def current_page
|
53
|
-
|
54
|
+
# A nil limit is unlimited, thus only one page.
|
55
|
+
if limit.nil? || limit == 0 #check for divide by zero
|
54
56
|
1
|
55
57
|
else
|
56
58
|
@offset / limit + 1
|
@@ -81,6 +83,8 @@ module Blacklight
|
|
81
83
|
# under facet.sort ), and your current request params.
|
82
84
|
# Get back params suitable to passing to an ActionHelper method for
|
83
85
|
# creating a url, to resort by that method.
|
86
|
+
# @param [String] sort_method
|
87
|
+
# @param [HashWithIndifferentAccess] params
|
84
88
|
def params_for_resort_url(sort_method, params = {})
|
85
89
|
# When resorting, we've got to reset the offset to start at beginning,
|
86
90
|
# no way to make it make sense otherwise.
|
data/app/models/bookmark.rb
CHANGED
data/app/models/record_mailer.rb
CHANGED
data/app/models/search.rb
CHANGED