blacklight 3.7.0 → 3.7.1

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 3.7.0
1
+ 3.7.1
@@ -9,8 +9,11 @@
9
9
 
10
10
  .label
11
11
  {
12
- left:-100000000px;
13
- position:absolute;
12
+ position: absolute !important;
13
+ height: 1px; width: 1px;
14
+ overflow: hidden;
15
+ clip: rect(1px 1px 1px 1px); /* IE6, IE7 */
16
+ clip: rect(1px, 1px, 1px, 1px);
14
17
  }
15
18
  }
16
19
 
@@ -10,7 +10,7 @@ module Blacklight::Controller
10
10
  base.send :before_filter, :default_html_head # add JS/stylesheet stuff
11
11
  # now in application.rb file under config.filter_parameters
12
12
  # filter_parameter_logging :password, :password_confirmation
13
- base.send :helper_method, :current_user_session, :current_user
13
+ base.send :helper_method, :current_user_session, :current_user, :current_or_guest_user
14
14
  base.send :after_filter, :discard_flash_if_xhr
15
15
 
16
16
  # handle basic authorization exception with #access_denied
@@ -32,17 +32,6 @@ module Blacklight::Controller
32
32
 
33
33
  end
34
34
 
35
- def method_missing(meth, *args, &block)
36
- if meth.to_s == "current_or_guest_user"
37
- # Add the method
38
- define_method(meth) { blacklight_current_or_guest_user }
39
-
40
- blacklight_current_or_guest_user
41
- else
42
- super
43
- end
44
- end
45
-
46
35
  # test for exception notifier plugin
47
36
  def error
48
37
  raise RuntimeError, "Generating a test error..."
@@ -119,9 +108,14 @@ module Blacklight::Controller
119
108
  # end
120
109
 
121
110
  # Here's a stub implementation we'll add if it isn't provided for us
122
- def blacklight_current_or_guest_user
123
- current_user if has_user_authentication_provider?
111
+ def current_or_guest_user
112
+ if defined? super
113
+ super
114
+ else
115
+ current_user if has_user_authentication_provider?
116
+ end
124
117
  end
118
+ alias_method :blacklight_current_or_guest_user, :current_or_guest_user
125
119
 
126
120
  ##
127
121
  # We discard flash messages generated by the xhr requests to avoid
@@ -446,8 +446,8 @@ module Blacklight::SolrHelper
446
446
  else
447
447
  20 + 1
448
448
  end
449
- solr_params['facet.offset'] = input[ Blacklight::Solr::FacetPaginator.request_keys[:offset] ].to_i # will default to 0 if nil
450
- solr_params['facet.sort'] = input[ Blacklight::Solr::FacetPaginator.request_keys[:sort] ]
449
+ solr_params[:"f.#{facet_field}.facet.offset"] = input[ Blacklight::Solr::FacetPaginator.request_keys[:offset] ].to_i # will default to 0 if nil
450
+ solr_params[:"f.#{facet_field}.facet.sort"] = input[ Blacklight::Solr::FacetPaginator.request_keys[:sort] ] if input[ Blacklight::Solr::FacetPaginator.request_keys[:sort] ]
451
451
  solr_params[:rows] = 0
452
452
 
453
453
  return solr_params
@@ -434,6 +434,12 @@ describe 'Blacklight::SolrHelper' do
434
434
 
435
435
  @sort_key = Blacklight::Solr::FacetPaginator.request_keys[:sort]
436
436
  @offset_key = Blacklight::Solr::FacetPaginator.request_keys[:offset]
437
+ @config = Blacklight::Configuration.new do |config|
438
+ config.add_facet_fields_to_solr_request!
439
+ config.add_facet_field 'format'
440
+ config.add_facet_field 'format_ordered', :sort => :count
441
+
442
+ end
437
443
  end
438
444
  it 'sets rows to 0' do
439
445
  @generated_solr_facet_params[:rows].should == 0
@@ -442,16 +448,17 @@ describe 'Blacklight::SolrHelper' do
442
448
  @generated_solr_facet_params["facet.field".to_sym].should == @facet_field
443
449
  end
444
450
  it 'defaults offset to 0' do
445
- @generated_solr_facet_params['facet.offset'].should == 0
451
+ @generated_solr_facet_params[:"f.#{@facet_field}.facet.offset"].should == 0
446
452
  end
447
453
  it 'uses offset manually set, and converts it to an integer' do
448
454
  solr_params = solr_facet_params(@facet_field, @offset_key => "100")
449
- solr_params['facet.offset'].should == 100
455
+ solr_params[:"f.#{@facet_field}.facet.offset"].should == 100
450
456
  end
451
457
  it 'defaults limit to 20' do
452
458
  solr_params = solr_facet_params(@facet_field)
453
459
  solr_params[:"f.#{@facet_field}.facet.limit"].should == 21
454
460
  end
461
+
455
462
  describe 'if facet_list_limit is defined in controller' do
456
463
  def facet_list_limit
457
464
  1000
@@ -461,9 +468,20 @@ describe 'Blacklight::SolrHelper' do
461
468
  solr_params[:"f.#{@facet_field}.facet.limit"].should == 1001
462
469
  end
463
470
  end
464
- it 'uses sort set manually' do
471
+ it 'uses the default sort' do
472
+ solr_params = solr_facet_params(@facet_field)
473
+ solr_params[:"f.#{@facet_field}.facet.sort"].should be_blank
474
+ end
475
+
476
+ it "uses the field-specific sort" do
477
+ @facet_field = 'format_ordered'
478
+ solr_params = solr_facet_params(@facet_field)
479
+ solr_params[:"f.#{@facet_field}.facet.sort"].should == :count
480
+ end
481
+
482
+ it 'uses sort provided in the parameters' do
465
483
  solr_params = solr_facet_params(@facet_field, @sort_key => "index")
466
- solr_params['facet.sort'].should == 'index'
484
+ solr_params[:"f.#{@facet_field}.facet.sort"].should == 'index'
467
485
  end
468
486
  it "comes up with the same params as #solr_search_params to constrain context for facet list" do
469
487
  search_params = {:q => 'tibetan history', :f=> {:format=>'Book', :language_facet=>'Tibetan'}}
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blacklight
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.7.0
4
+ version: 3.7.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -17,7 +17,7 @@ authors:
17
17
  autorequire:
18
18
  bindir: bin
19
19
  cert_chain: []
20
- date: 2012-09-25 00:00:00.000000000 Z
20
+ date: 2012-10-09 00:00:00.000000000 Z
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency
23
23
  name: rails
@@ -508,7 +508,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
508
508
  version: '0'
509
509
  segments:
510
510
  - 0
511
- hash: -1006739623696902057
511
+ hash: -2496092326738603899
512
512
  required_rubygems_version: !ruby/object:Gem::Requirement
513
513
  none: false
514
514
  requirements:
@@ -517,7 +517,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
517
517
  version: '0'
518
518
  segments:
519
519
  - 0
520
- hash: -1006739623696902057
520
+ hash: -2496092326738603899
521
521
  requirements: []
522
522
  rubyforge_project: blacklight
523
523
  rubygems_version: 1.8.23