blacklight 5.0.0.pre3 → 5.0.0.pre4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +9 -16
- data/Gemfile +4 -0
- data/README.md +15 -1
- data/VERSION +1 -1
- data/app/assets/stylesheets/blacklight/_bookmark.css.scss +1 -1
- data/app/assets/stylesheets/blacklight/_catalog.css.scss +2 -12
- data/app/assets/stylesheets/blacklight/_facets.css.scss +1 -1
- data/app/assets/stylesheets/blacklight/_header.css.scss +1 -0
- data/app/assets/stylesheets/blacklight/_modal.css.scss +4 -2
- data/app/assets/stylesheets/blacklight/blacklight_defaults.css.scss +0 -5
- data/app/controllers/bookmarks_controller.rb +4 -0
- data/app/helpers/blacklight/blacklight_helper_behavior.rb +26 -187
- data/app/helpers/blacklight/catalog_helper_behavior.rb +20 -8
- data/app/helpers/blacklight/facets_helper_behavior.rb +0 -83
- data/app/helpers/blacklight/hash_as_hidden_fields_helper_behavior.rb +1 -1
- data/app/helpers/blacklight/url_helper_behavior.rb +201 -0
- data/app/helpers/blacklight_url_helper.rb +3 -0
- data/app/views/bookmarks/_tools.html.erb +4 -7
- data/app/views/catalog/_citation.html.erb +1 -1
- data/app/views/catalog/_did_you_mean.html.erb +1 -1
- data/app/views/catalog/_document.html.erb +1 -1
- data/app/views/catalog/_search_form.html.erb +1 -1
- data/app/views/catalog/_show_more_like_this.html.erb +1 -1
- data/app/views/catalog/_view_type_group.html.erb +4 -4
- data/app/views/catalog/email.html.erb +2 -2
- data/app/views/catalog/facet.html.erb +1 -1
- data/app/views/catalog/show.html.erb +1 -1
- data/app/views/catalog/sms.html.erb +1 -1
- data/blacklight.gemspec +2 -2
- data/config/jetty.yml +4 -1
- data/config/locales/blacklight.en.yml +3 -0
- data/config/locales/blacklight.fr.yml +3 -0
- data/{lib/generators/blacklight/templates/migrations/create_searches.rb → db/migrate/20140202020201_create_searches.rb} +2 -0
- data/{lib/generators/blacklight/templates/migrations/create_bookmarks.rb → db/migrate/20140202020202_create_bookmarks.rb} +1 -2
- data/gemfiles/rails3.gemfile +2 -0
- data/gemfiles/rails4.gemfile +2 -0
- data/lib/blacklight.rb +1 -40
- data/lib/blacklight/base.rb +3 -9
- data/lib/blacklight/catalog.rb +3 -16
- data/lib/blacklight/catalog/search_context.rb +8 -1
- data/lib/blacklight/configurable.rb +1 -2
- data/lib/blacklight/configuration.rb +13 -3
- data/lib/blacklight/configuration/view_config.rb +71 -0
- data/lib/blacklight/engine.rb +1 -0
- data/lib/blacklight/routes.rb +0 -1
- data/lib/blacklight/solr/document.rb +0 -4
- data/lib/blacklight/solr_helper.rb +8 -2
- data/lib/blacklight/user.rb +1 -16
- data/lib/blacklight/utils.rb +72 -1
- data/lib/generators/blacklight/install_generator.rb +92 -0
- data/lib/generators/blacklight/models_generator.rb +1 -25
- data/lib/generators/blacklight/templates/catalog_controller.rb +28 -32
- data/spec/helpers/blacklight_helper_spec.rb +24 -417
- data/spec/helpers/catalog_helper_spec.rb +13 -13
- data/spec/helpers/facets_helper_spec.rb +0 -127
- data/spec/helpers/hash_as_hidden_fields_spec.rb +1 -1
- data/spec/helpers/url_helper_spec.rb +360 -0
- data/spec/lib/blacklight/configuration_spec.rb +2 -3
- data/spec/lib/blacklight/solr_helper_spec.rb +11 -17
- data/spec/lib/blacklight/user_spec.rb +0 -41
- data/spec/lib/blacklight_spec.rb +0 -22
- data/spec/lib/utils_spec.rb +35 -4
- data/spec/spec_helper.rb +4 -3
- data/spec/test_app_templates/lib/generators/test_app_generator.rb +2 -2
- data/spec/views/catalog/_constraints.html.erb_spec.rb +4 -2
- data/spec/views/catalog/_index_default.erb_spec.rb +1 -1
- data/spec/views/catalog/_paginate_compact.html.erb_spec.rb +1 -5
- data/spec/views/catalog/_show_default.erb_spec.rb +1 -1
- data/spec/views/catalog/_view_type_group.html.erb_spec.rb +11 -3
- data/tasks/blacklight.rake +1 -5
- metadata +14 -16
- data/.gitmodules +0 -0
- data/app/views/catalog/endnote.endnote.erb +0 -1
- data/app/views/catalog/show.endnote.erb +0 -1
- data/lib/generators/blacklight/blacklight_generator.rb +0 -97
- data/lib/generators/blacklight/templates/migrations/add_user_types_to_bookmarks_searches.rb +0 -16
- data/lib/generators/blacklight/templates/migrations/remove_editable_fields_from_bookmarks.rb +0 -12
- data/lib/railties/all_tests.rake +0 -39
- data/lib/railties/blacklight_rspec.rake +0 -128
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bf405f02c6be2140ca50f003ba8f9b39f7a0db26
|
4
|
+
data.tar.gz: c8bf97338f9612b578826b97cea817a7c8e9f5ab
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 576d597de0b7541de63349e3f99e46a0c9a84fa9425108a0e33c91b91a7f00dac8693635430ffc11df7deb1990bc353536de33808baa9fc6cbd4d8eeeaf4dee1
|
7
|
+
data.tar.gz: 56a327ccf26e7d3eade183580e1d75d85e3aaf4d6840e98fa8eaa4839bd2659098ef3e04840cf6e80692bbf3cad480f2454429967f7e7e1e728883562555ae81
|
data/.gitignore
CHANGED
@@ -1,22 +1,15 @@
|
|
1
1
|
.DS_Store
|
2
|
-
|
3
|
-
|
2
|
+
*.sw[pon]
|
3
|
+
.bundle
|
4
|
+
.rvmrc
|
5
|
+
*.log
|
6
|
+
Gemfile.lock
|
4
7
|
coverage/
|
5
|
-
|
6
|
-
|
7
|
-
jetty
|
8
|
+
gemfiles/*.gemfile.lock
|
9
|
+
jetty/
|
8
10
|
log/*
|
9
|
-
webrat-*
|
10
|
-
config/SolrMarc/*.log*
|
11
|
-
rerun.txt
|
12
11
|
solr_marc/solrmarc.log
|
13
12
|
lib/solrmarc.log.*
|
14
13
|
tmp/*
|
15
|
-
|
16
|
-
|
17
|
-
Gemfile.lock
|
18
|
-
spec/internal
|
19
|
-
.rvmrc
|
20
|
-
pkg/*
|
21
|
-
*.sw[pon]
|
22
|
-
gemfiles/*.gemfile.lock
|
14
|
+
spec/internal/
|
15
|
+
pkg/*
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -9,6 +9,20 @@ to search full text and/or metadata. Blacklight has a highly
|
|
9
9
|
configurable Ruby on Rails front-end. Blacklight was originally developed at
|
10
10
|
the University of Virginia Library and is made public under an Apache 2.0 license.
|
11
11
|
|
12
|
+
## Installation
|
13
|
+
|
14
|
+
Add Blacklight to your `Gemfile`:
|
15
|
+
|
16
|
+
```ruby
|
17
|
+
gem "blacklight"
|
18
|
+
```
|
19
|
+
|
20
|
+
Run the install generator which will copy over some initial templates, migrations, routes, and configuration:
|
21
|
+
|
22
|
+
```
|
23
|
+
rails generate blacklight:install
|
24
|
+
```
|
25
|
+
|
12
26
|
|
13
27
|
## Documentation, Information and Support
|
14
28
|
|
@@ -16,7 +30,7 @@ the University of Virginia Library and is made public under an Apache 2.0 licens
|
|
16
30
|
* [Developer Documentation](https://github.com/projectblacklight/blacklight/wiki)
|
17
31
|
* [Quickstart Guide](https://github.com/projectblacklight/blacklight/wiki/Quickstart)
|
18
32
|
* [Issue Tracker](https://github.com/projectblacklight/blacklight/issues)
|
19
|
-
* [Support](
|
33
|
+
* [Support](https://github.com/projectblacklight/blacklight/wiki/Support)
|
20
34
|
|
21
35
|
## Dependencies
|
22
36
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
5.0.0.
|
1
|
+
5.0.0.pre4
|
@@ -24,7 +24,7 @@
|
|
24
24
|
.ind1, .ind2
|
25
25
|
{
|
26
26
|
display:inline;
|
27
|
-
padding:0
|
27
|
+
padding:0 $padding-xs-horizontal;
|
28
28
|
}
|
29
29
|
|
30
30
|
.subfields
|
@@ -114,16 +114,6 @@ span.constraints-label {
|
|
114
114
|
text-align: center ;
|
115
115
|
}
|
116
116
|
|
117
|
-
|
118
|
-
.solrQuery
|
119
|
-
{
|
120
|
-
background-color: $search_ui_bg_color;
|
121
|
-
border:1px dotted $search_ui_border_color;
|
122
|
-
font-size:90%;
|
123
|
-
margin:2em;
|
124
|
-
padding:.5em;
|
125
|
-
}
|
126
|
-
|
127
117
|
.dl-horizontal
|
128
118
|
{
|
129
119
|
dd {
|
@@ -185,7 +175,7 @@ label.toggle_bookmark
|
|
185
175
|
|
186
176
|
.document-thumbnail {
|
187
177
|
float: right;
|
188
|
-
padding-left:
|
178
|
+
padding-left: $line-height-computed;
|
189
179
|
margin-bottom: $line-height-computed;
|
190
180
|
}
|
191
181
|
|
@@ -2,11 +2,6 @@
|
|
2
2
|
|
3
3
|
$logo_image: 'blacklight/logo.png' !default;
|
4
4
|
|
5
|
-
/* Various elements of search customization share these colors */
|
6
|
-
|
7
|
-
$search_ui_border_color: #FFFFFF !default;
|
8
|
-
$search_ui_bg_color: #FFFFFF !default;
|
9
|
-
|
10
5
|
/* label (field names) */
|
11
6
|
$field_name_color: $text-muted !default;
|
12
7
|
|
@@ -97,4 +97,8 @@ class BookmarksController < CatalogController
|
|
97
97
|
def verify_user
|
98
98
|
flash[:notice] = I18n.t('blacklight.bookmarks.need_login') and raise Blacklight::Exceptions::AccessDenied unless current_or_guest_user
|
99
99
|
end
|
100
|
+
|
101
|
+
def start_new_search_session?
|
102
|
+
action_name == "index"
|
103
|
+
end
|
100
104
|
end
|
@@ -4,22 +4,17 @@
|
|
4
4
|
# Methods added to this helper will be available to all templates in the hosting application
|
5
5
|
#
|
6
6
|
module Blacklight::BlacklightHelperBehavior
|
7
|
+
include BlacklightUrlHelper
|
7
8
|
include HashAsHiddenFieldsHelper
|
8
9
|
include RenderConstraintsHelper
|
9
10
|
include FacetsHelper
|
10
11
|
|
11
|
-
|
12
12
|
def application_name
|
13
13
|
return Rails.application.config.application_name if Rails.application.config.respond_to? :application_name
|
14
14
|
|
15
15
|
t('blacklight.application_name')
|
16
16
|
end
|
17
17
|
|
18
|
-
# Provide the full, absolute url for an image
|
19
|
-
def asset_url(*args)
|
20
|
-
"#{request.protocol}#{request.host_with_port}#{asset_path(*args)}"
|
21
|
-
end
|
22
|
-
|
23
18
|
# Create <link rel="alternate"> links from a documents dynamically
|
24
19
|
# provided export formats. Currently not used by standard BL layouts,
|
25
20
|
# but available for your custom layouts to provide link rel alternates.
|
@@ -105,8 +100,8 @@ module Blacklight::BlacklightHelperBehavior
|
|
105
100
|
solr_field.accessor
|
106
101
|
end
|
107
102
|
|
108
|
-
def
|
109
|
-
|
103
|
+
def should_show_spellcheck_suggestions? response
|
104
|
+
response.total <= spell_check_max and response.spelling.words.size > 0
|
110
105
|
end
|
111
106
|
|
112
107
|
##
|
@@ -127,7 +122,7 @@ module Blacklight::BlacklightHelperBehavior
|
|
127
122
|
document = args.first
|
128
123
|
|
129
124
|
field = options[:field]
|
130
|
-
html_escape index_fields(document)[field].label
|
125
|
+
html_escape t(:'blacklight.search.index.label', label: index_fields(document)[field].label)
|
131
126
|
end
|
132
127
|
|
133
128
|
##
|
@@ -168,7 +163,18 @@ module Blacklight::BlacklightHelperBehavior
|
|
168
163
|
# Used in the show view for displaying the main solr document heading
|
169
164
|
def document_heading document=nil
|
170
165
|
document ||= @document
|
171
|
-
document[blacklight_config.show.
|
166
|
+
render_field_value document[blacklight_config.view_config(:show).title_field] || document.id
|
167
|
+
end
|
168
|
+
|
169
|
+
# Used in the show view for setting the main html document title
|
170
|
+
def document_show_html_title document=nil
|
171
|
+
document ||= @document
|
172
|
+
|
173
|
+
if blacklight_config.view_config(:show).html_title_field
|
174
|
+
render_field_value(document[blacklight_config.view_config(:show).html_title_field])
|
175
|
+
else
|
176
|
+
document_heading document
|
177
|
+
end
|
172
178
|
end
|
173
179
|
|
174
180
|
##
|
@@ -193,17 +199,6 @@ module Blacklight::BlacklightHelperBehavior
|
|
193
199
|
content_tag(tag, render_field_value(document_heading(document)), :itemprop => "name")
|
194
200
|
end
|
195
201
|
|
196
|
-
# Used in the show view for setting the main html document title
|
197
|
-
def document_show_html_title document=nil
|
198
|
-
document ||= @document
|
199
|
-
render_field_value(document[blacklight_config.show.html_title])
|
200
|
-
end
|
201
|
-
|
202
|
-
# Used in citation view for displaying the title
|
203
|
-
def citation_title(document)
|
204
|
-
document[blacklight_config.show.html_title]
|
205
|
-
end
|
206
|
-
|
207
202
|
# Used in the document_list partial (search view) for building a select element
|
208
203
|
def sort_fields
|
209
204
|
blacklight_config.sort_fields.map { |key, x| [x.label, x.key] }
|
@@ -211,7 +206,7 @@ module Blacklight::BlacklightHelperBehavior
|
|
211
206
|
|
212
207
|
# Used in the document list partial (search view) for creating a link to the document show action
|
213
208
|
def document_show_link_field document=nil
|
214
|
-
blacklight_config.
|
209
|
+
blacklight_config.view_config(document_index_view_type).title_field.to_sym
|
215
210
|
end
|
216
211
|
|
217
212
|
# Used in the search form partial for building a select tag
|
@@ -243,7 +238,7 @@ module Blacklight::BlacklightHelperBehavior
|
|
243
238
|
|
244
239
|
field = options[:field]
|
245
240
|
|
246
|
-
html_escape document_show_fields(document)[field].label
|
241
|
+
html_escape t(:'blacklight.search.show.label', label: document_show_fields(document)[field].label)
|
247
242
|
end
|
248
243
|
|
249
244
|
##
|
@@ -356,15 +351,15 @@ module Blacklight::BlacklightHelperBehavior
|
|
356
351
|
end
|
357
352
|
|
358
353
|
def document_index_view_type query_params=params
|
359
|
-
if blacklight_config.
|
360
|
-
query_params[:view]
|
354
|
+
if query_params[:view] and blacklight_config.view.keys.include? query_params[:view].to_sym
|
355
|
+
query_params[:view].to_sym
|
361
356
|
else
|
362
357
|
default_document_index_view_type
|
363
358
|
end
|
364
359
|
end
|
365
360
|
|
366
361
|
def default_document_index_view_type
|
367
|
-
blacklight_config.
|
362
|
+
blacklight_config.view.keys.first
|
368
363
|
end
|
369
364
|
|
370
365
|
def render_document_index documents = nil, locals = {}
|
@@ -399,7 +394,7 @@ module Blacklight::BlacklightHelperBehavior
|
|
399
394
|
# .to_s is necessary otherwise the default return value is not always a string
|
400
395
|
# using "_" as sep. to more closely follow the views file naming conventions
|
401
396
|
# parameterize uses "-" as the default sep. which throws errors
|
402
|
-
display_type = document[blacklight_config.show.
|
397
|
+
display_type = document[blacklight_config.view_config(:show).display_type_field]
|
403
398
|
|
404
399
|
return 'default' unless display_type
|
405
400
|
display_type = display_type.join(" ") if display_type.respond_to?(:join)
|
@@ -442,35 +437,6 @@ module Blacklight::BlacklightHelperBehavior
|
|
442
437
|
end
|
443
438
|
|
444
439
|
|
445
|
-
# Search History and Saved Searches display
|
446
|
-
def link_to_previous_search(params)
|
447
|
-
link_to(raw(render_search_to_s(params)), catalog_index_path(params)).html_safe
|
448
|
-
end
|
449
|
-
|
450
|
-
#
|
451
|
-
# link based helpers ->
|
452
|
-
#
|
453
|
-
|
454
|
-
# create link to query (e.g. spelling suggestion)
|
455
|
-
def link_to_query(query)
|
456
|
-
p = params.dup
|
457
|
-
p.delete :page
|
458
|
-
p.delete :action
|
459
|
-
p[:q]=query
|
460
|
-
link_url = catalog_index_path(p)
|
461
|
-
link_to(query, link_url)
|
462
|
-
end
|
463
|
-
|
464
|
-
##
|
465
|
-
# Get the path to the search action with any parameters (e.g. view type)
|
466
|
-
# that should be persisted across search sessions.
|
467
|
-
def start_over_path query_params = params
|
468
|
-
h = { }
|
469
|
-
current_index_view_type = document_index_view_type(query_params)
|
470
|
-
h[:view] = current_index_view_type unless current_index_view_type == default_document_index_view_type
|
471
|
-
|
472
|
-
search_action_url(h)
|
473
|
-
end
|
474
440
|
|
475
441
|
def render_document_index_label doc, opts
|
476
442
|
label = nil
|
@@ -481,115 +447,6 @@ module Blacklight::BlacklightHelperBehavior
|
|
481
447
|
render_field_value label
|
482
448
|
end
|
483
449
|
|
484
|
-
# link_to_document(doc, :label=>'VIEW', :counter => 3)
|
485
|
-
# Use the catalog_path RESTful route to create a link to the show page for a specific item.
|
486
|
-
# catalog_path accepts a HashWithIndifferentAccess object. The solr query params are stored in the session,
|
487
|
-
# so we only need the +counter+ param here. We also need to know if we are viewing to document as part of search results.
|
488
|
-
def link_to_document(doc, opts={:label=>nil, :counter => nil})
|
489
|
-
opts[:label] ||= blacklight_config.index.show_link.to_sym
|
490
|
-
label = render_document_index_label doc, opts
|
491
|
-
link_to label, doc, search_session_params(opts[:counter]).merge(opts.reject { |k,v| [:label, :counter].include? k })
|
492
|
-
end
|
493
|
-
|
494
|
-
def search_session_params counter
|
495
|
-
{ :'data-counter' => counter, :'data-search_id' => current_search_session.try(:id) }
|
496
|
-
end
|
497
|
-
|
498
|
-
# Create a link back to the index screen, keeping the user's facet, query and paging choices intact by using session.
|
499
|
-
# @example
|
500
|
-
# link_back_to_catalog(label: 'Back to Search')
|
501
|
-
# link_back_to_catalog(label: 'Back to Search', route_set: my_engine)
|
502
|
-
def link_back_to_catalog(opts={:label=>nil})
|
503
|
-
scope = opts.delete(:route_set) || self
|
504
|
-
query_params = current_search_session.try(:query_params) || {}
|
505
|
-
link_url = scope.url_for(query_params)
|
506
|
-
label = opts.delete(:label)
|
507
|
-
|
508
|
-
if link_url =~ /bookmarks/
|
509
|
-
label ||= t('blacklight.back_to_bookmarks')
|
510
|
-
end
|
511
|
-
|
512
|
-
label ||= t('blacklight.back_to_search')
|
513
|
-
|
514
|
-
link_to label, link_url, opts
|
515
|
-
end
|
516
|
-
|
517
|
-
def params_for_search(options={})
|
518
|
-
# special keys
|
519
|
-
# params hash to mutate
|
520
|
-
source_params = options.delete(:params) || params
|
521
|
-
omit_keys = options.delete(:omit_keys) || []
|
522
|
-
|
523
|
-
# params hash we'll return
|
524
|
-
my_params = source_params.dup.merge(options.dup)
|
525
|
-
|
526
|
-
|
527
|
-
# remove items from our params hash that match:
|
528
|
-
# - a key
|
529
|
-
# - a key and a value
|
530
|
-
omit_keys.each do |omit_key|
|
531
|
-
case omit_key
|
532
|
-
when Hash
|
533
|
-
omit_key.each do |key, values|
|
534
|
-
next unless my_params.has_key? key
|
535
|
-
|
536
|
-
# make sure to dup the source key, we don't want to accidentally alter the original
|
537
|
-
my_params[key] = my_params[key].dup
|
538
|
-
|
539
|
-
values = [values] unless values.respond_to? :each
|
540
|
-
values.each { |v| my_params[key].delete(v) }
|
541
|
-
|
542
|
-
if my_params[key].empty?
|
543
|
-
my_params.delete(key)
|
544
|
-
end
|
545
|
-
end
|
546
|
-
|
547
|
-
else
|
548
|
-
my_params.delete(omit_key)
|
549
|
-
end
|
550
|
-
end
|
551
|
-
|
552
|
-
if my_params[:page] and (my_params[:per_page] != source_params[:per_page] or my_params[:sort] != source_params[:sort] )
|
553
|
-
my_params[:page] = 1
|
554
|
-
end
|
555
|
-
|
556
|
-
my_params.reject! { |k,v| v.nil? }
|
557
|
-
|
558
|
-
# removing action, controller, and id from duplicate params so that we don't get hidden fields for them.
|
559
|
-
my_params.delete(:action)
|
560
|
-
my_params.delete(:controller)
|
561
|
-
my_params.delete(:id)
|
562
|
-
# commit is just an artifact of submit button, we don't need it, and
|
563
|
-
# don't want it to pile up with another every time we press submit again!
|
564
|
-
my_params.delete(:commit)
|
565
|
-
|
566
|
-
my_params
|
567
|
-
end
|
568
|
-
|
569
|
-
# Create form input type=hidden fields representing the entire search context,
|
570
|
-
# for inclusion in a form meant to change some aspect of it, like
|
571
|
-
# re-sort or change records per page. Can pass in params hash
|
572
|
-
# as :params => hash, otherwise defaults to #params. Can pass
|
573
|
-
# in certain top-level params keys to _omit_, defaults to :page
|
574
|
-
def search_as_hidden_fields(options={})
|
575
|
-
my_params = params_for_search({:omit_keys => [:page]}.merge(options))
|
576
|
-
|
577
|
-
# hash_as_hidden_fields in hash_as_hidden_fields.rb
|
578
|
-
return hash_as_hidden_fields(my_params)
|
579
|
-
end
|
580
|
-
|
581
|
-
def link_to_previous_document(previous_document)
|
582
|
-
link_to_unless previous_document.nil?, raw(t('views.pagination.previous')), previous_document, search_session_params(search_session[:counter].to_i - 1).merge(:class => "previous", :rel => 'prev') do
|
583
|
-
content_tag :span, raw(t('views.pagination.previous')), :class => 'previous'
|
584
|
-
end
|
585
|
-
end
|
586
|
-
|
587
|
-
def link_to_next_document(next_document)
|
588
|
-
link_to_unless next_document.nil?, raw(t('views.pagination.next')), next_document, search_session_params(search_session[:counter].to_i + 1).merge(:class => "next", :rel => 'next') do
|
589
|
-
content_tag :span, raw(t('views.pagination.next')), :class => 'next'
|
590
|
-
end
|
591
|
-
end
|
592
|
-
|
593
450
|
# Use case, you want to render an html partial from an XML (say, atom)
|
594
451
|
# template. Rails API kind of lets us down, we need to hack Rails internals
|
595
452
|
# a bit. code taken from:
|
@@ -602,28 +459,6 @@ module Blacklight::BlacklightHelperBehavior
|
|
602
459
|
nil
|
603
460
|
end
|
604
461
|
|
605
|
-
# puts together a collection of documents into one refworks export string
|
606
|
-
def render_refworks_texts(documents)
|
607
|
-
val = ''
|
608
|
-
documents.each do |doc|
|
609
|
-
if doc.respond_to?(:to_marc)
|
610
|
-
val += doc.export_as_refworks_marc_txt + "\n"
|
611
|
-
end
|
612
|
-
end
|
613
|
-
val
|
614
|
-
end
|
615
|
-
|
616
|
-
# puts together a collection of documents into one endnote export string
|
617
|
-
def render_endnote_texts(documents)
|
618
|
-
val = ''
|
619
|
-
documents.each do |doc|
|
620
|
-
if doc.respond_to?(:to_marc)
|
621
|
-
val += doc.export_as_endnote + "\n"
|
622
|
-
end
|
623
|
-
end
|
624
|
-
val
|
625
|
-
end
|
626
|
-
|
627
462
|
##
|
628
463
|
# Should we render a grouped response (because the response
|
629
464
|
# contains a grouped response instead of the normal response)
|
@@ -641,4 +476,8 @@ module Blacklight::BlacklightHelperBehavior
|
|
641
476
|
has_user_authentication_provider? and current_or_guest_user.present?
|
642
477
|
end
|
643
478
|
|
479
|
+
def spell_check_max
|
480
|
+
blacklight_config.spell_max
|
481
|
+
end
|
482
|
+
|
644
483
|
end
|