blacklight 3.0.0pre7 → 3.0.0pre8
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/{lib/generators/blacklight/templates/public → app/assets}/images/blacklight/bg.png +0 -0
- data/{lib/generators/blacklight/templates/public → app/assets}/images/blacklight/border.png +0 -0
- data/{lib/generators/blacklight/templates/public → app/assets}/images/blacklight/bul_sq_gry.gif +0 -0
- data/{lib/generators/blacklight/templates/public → app/assets}/images/blacklight/checkmark.gif +0 -0
- data/{lib/generators/blacklight/templates/public → app/assets}/images/blacklight/logo.png +0 -0
- data/{lib/generators/blacklight/templates/public → app/assets}/images/blacklight/magnifying_glass.gif +0 -0
- data/{lib/generators/blacklight/templates/public → app/assets}/images/blacklight/remove.gif +0 -0
- data/{lib/generators/blacklight/templates/public → app/assets}/images/blacklight/separator.gif +0 -0
- data/{lib/generators/blacklight/templates/public → app/assets}/images/blacklight/start_over.gif +0 -0
- data/{lib/generators/blacklight/templates/public → app/assets}/javascripts/blacklight/blacklight.js +0 -0
- data/{lib/generators/blacklight/templates/public → app/assets}/javascripts/jquery-1.4.2.min.js +0 -0
- data/{lib/generators/blacklight/templates/public → app/assets}/javascripts/jquery-ui-1.8.1.custom.min.js +0 -0
- data/{lib/generators/blacklight/templates/public → app/assets}/stylesheets/blacklight/blacklight.css +0 -0
- data/{lib/generators/blacklight/templates/public → app/assets}/stylesheets/jquery/ui-lightness/images/ui-anim_basic_16x16.gif +0 -0
- data/{lib/generators/blacklight/templates/public → app/assets}/stylesheets/jquery/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png +0 -0
- data/{lib/generators/blacklight/templates/public → app/assets}/stylesheets/jquery/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png +0 -0
- data/{lib/generators/blacklight/templates/public → app/assets}/stylesheets/jquery/ui-lightness/images/ui-bg_flat_10_000000_40x100.png +0 -0
- data/{lib/generators/blacklight/templates/public → app/assets}/stylesheets/jquery/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png +0 -0
- data/{lib/generators/blacklight/templates/public → app/assets}/stylesheets/jquery/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png +0 -0
- data/{lib/generators/blacklight/templates/public → app/assets}/stylesheets/jquery/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/{lib/generators/blacklight/templates/public → app/assets}/stylesheets/jquery/ui-lightness/images/ui-bg_gloss-wave_35_558fd0_500x100.png +0 -0
- data/{lib/generators/blacklight/templates/public → app/assets}/stylesheets/jquery/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png +0 -0
- data/{lib/generators/blacklight/templates/public → app/assets}/stylesheets/jquery/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png +0 -0
- data/{lib/generators/blacklight/templates/public → app/assets}/stylesheets/jquery/ui-lightness/images/ui-icons_222222_256x240.png +0 -0
- data/{lib/generators/blacklight/templates/public → app/assets}/stylesheets/jquery/ui-lightness/images/ui-icons_228ef1_256x240.png +0 -0
- data/{lib/generators/blacklight/templates/public → app/assets}/stylesheets/jquery/ui-lightness/images/ui-icons_2e4f81_256x240.png +0 -0
- data/{lib/generators/blacklight/templates/public → app/assets}/stylesheets/jquery/ui-lightness/images/ui-icons_ffd27a_256x240.png +0 -0
- data/{lib/generators/blacklight/templates/public → app/assets}/stylesheets/jquery/ui-lightness/images/ui-icons_ffffff_256x240.png +0 -0
- data/{lib/generators/blacklight/templates/public → app/assets}/stylesheets/jquery/ui-lightness/jquery-ui-1.8.1.custom.css +0 -0
- data/{lib/generators/blacklight/templates/public → app/assets}/stylesheets/yui.css +0 -0
- data/app/controllers/search_history_controller.rb +0 -9
- data/app/helpers/blacklight_helper.rb +11 -9
- data/app/views/search_history/index.html.erb +0 -1
- data/lib/blacklight/catalog.rb +8 -1
- data/lib/blacklight/controller.rb +13 -3
- data/lib/blacklight/routes.rb +1 -2
- data/lib/blacklight/solr_helper.rb +4 -3
- data/lib/generators/blacklight/assets_generator.rb +32 -5
- data/lib/generators/blacklight/blacklight_generator.rb +2 -2
- data/test_support/bin/test.sh +2 -1
- data/test_support/features/search_history.feature +0 -9
- data/test_support/features/step_definitions/saved_searches_steps.rb +1 -1
- data/test_support/spec/controllers/application_controller_spec.rb +10 -3
- data/test_support/spec/controllers/search_history_controller_spec.rb +10 -15
- data/test_support/spec/helpers/blacklight_helper_spec.rb +4 -2
- data/test_support/spec/helpers/catalog_helper_spec.rb +1 -0
- metadata +34 -34
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.0.
|
1
|
+
3.0.0pre8
|
File without changes
|
File without changes
|
data/{lib/generators/blacklight/templates/public → app/assets}/images/blacklight/bul_sq_gry.gif
RENAMED
File without changes
|
data/{lib/generators/blacklight/templates/public → app/assets}/images/blacklight/checkmark.gif
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/{lib/generators/blacklight/templates/public → app/assets}/images/blacklight/separator.gif
RENAMED
File without changes
|
data/{lib/generators/blacklight/templates/public → app/assets}/images/blacklight/start_over.gif
RENAMED
File without changes
|
data/{lib/generators/blacklight/templates/public → app/assets}/javascripts/blacklight/blacklight.js
RENAMED
File without changes
|
data/{lib/generators/blacklight/templates/public → app/assets}/javascripts/jquery-1.4.2.min.js
RENAMED
File without changes
|
File without changes
|
data/{lib/generators/blacklight/templates/public → app/assets}/stylesheets/blacklight/blacklight.css
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -4,15 +4,6 @@ class SearchHistoryController < ApplicationController
|
|
4
4
|
@searches = searches_from_history
|
5
5
|
end
|
6
6
|
|
7
|
-
#TODO we may want to remove unsaved (those without user_id) items from the database when removed from history
|
8
|
-
def destroy
|
9
|
-
if session[:history].delete(params[:id].to_i)
|
10
|
-
flash[:notice] = "Successfully removed that search history item."
|
11
|
-
else
|
12
|
-
flash[:error] = "Couldn't remove that search history item."
|
13
|
-
end
|
14
|
-
redirect_to :back
|
15
|
-
end
|
16
7
|
|
17
8
|
#TODO we may want to remove unsaved (those without user_id) items from the database when removed from history
|
18
9
|
def clear
|
@@ -297,13 +297,11 @@ module BlacklightHelper
|
|
297
297
|
# using "_" as sep. to more closely follow the views file naming conventions
|
298
298
|
# parameterize uses "-" as the default sep. which throws errors
|
299
299
|
display_type = document[Blacklight.config[:show][:display_type]]
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
end
|
306
|
-
end
|
300
|
+
|
301
|
+
return 'default' unless display_type
|
302
|
+
display_type = display_type.join(" ") if display_type.respond_to?(:join)
|
303
|
+
|
304
|
+
"#{display_type.gsub("-"," ")}".parameterize("_").to_s
|
307
305
|
end
|
308
306
|
|
309
307
|
# given a doc and action_name, this method attempts to render a partial template
|
@@ -358,8 +356,8 @@ module BlacklightHelper
|
|
358
356
|
# add_facet_params_and_redirect
|
359
357
|
def add_facet_params(field, value)
|
360
358
|
p = params.dup
|
361
|
-
p[:f] =
|
362
|
-
p[:f][field]
|
359
|
+
p[:f] = (p[:f] || {}).dup # the command above is not deep in rails3, !@#$!@#$
|
360
|
+
p[:f][field] = (p[:f][field] || []).dup
|
363
361
|
p[:f][field].push(value)
|
364
362
|
p
|
365
363
|
end
|
@@ -398,6 +396,7 @@ module BlacklightHelper
|
|
398
396
|
# if the values aren't dup'd, then the values
|
399
397
|
# from the session will get remove in the show view...
|
400
398
|
p[:f] = p[:f].dup
|
399
|
+
p[:f][field] = p[:f][field].nil? ? [] : p[:f][field].dup
|
401
400
|
p.delete :page
|
402
401
|
p.delete :id
|
403
402
|
p.delete :counter
|
@@ -472,6 +471,9 @@ module BlacklightHelper
|
|
472
471
|
# removing action and controller from duplicate params so that we don't get hidden fields for them.
|
473
472
|
my_params.delete(:action)
|
474
473
|
my_params.delete(:controller)
|
474
|
+
# commit is just an artifact of submit button, we don't need it, and
|
475
|
+
# don't want it to pile up with another every time we press submit again!
|
476
|
+
my_params.delete(:commit)
|
475
477
|
# hash_as_hidden_fields in hash_as_hidden_fields.rb
|
476
478
|
return hash_as_hidden_fields(my_params)
|
477
479
|
end
|
@@ -15,7 +15,6 @@
|
|
15
15
|
<%- else -%>
|
16
16
|
<%= button_to "save", save_search_path(search.id), :method => :put %>
|
17
17
|
<%- end -%></td>
|
18
|
-
<td class="actions"><%= button_to "delete", delete_search_path(search.id), :confirm => "Delete item?" %></td>
|
19
18
|
<% end #content_tag %>
|
20
19
|
<%- end -%>
|
21
20
|
</table>
|
data/lib/blacklight/catalog.rb
CHANGED
@@ -2,6 +2,8 @@
|
|
2
2
|
module Blacklight::Catalog
|
3
3
|
extend ActiveSupport::Concern
|
4
4
|
include Blacklight::SolrHelper
|
5
|
+
|
6
|
+
SearchHistoryWindow = 12 # how many searches to save in session history
|
5
7
|
|
6
8
|
# The following code is executed when someone includes blacklight::catalog in their
|
7
9
|
# own controller.
|
@@ -234,13 +236,18 @@ module Blacklight::Catalog
|
|
234
236
|
def save_current_search_params
|
235
237
|
# If it's got anything other than controller, action, total, we
|
236
238
|
# consider it an actual search to be saved. Can't predict exactly
|
237
|
-
# what the keys for a search will be, due to possible extra plugins.
|
239
|
+
# what the keys for a search will be, due to possible extra plugins.
|
238
240
|
return if (search_session.keys - [:controller, :action, :total, :counter, :commit ]) == []
|
239
241
|
params_copy = search_session.clone # don't think we need a deep copy for this
|
240
242
|
params_copy.delete(:page)
|
243
|
+
|
241
244
|
unless @searches.collect { |search| search.query_params }.include?(params_copy)
|
245
|
+
|
242
246
|
new_search = Search.create(:query_params => params_copy)
|
243
247
|
session[:history].unshift(new_search.id)
|
248
|
+
# Only keep most recent X searches in history, for performance.
|
249
|
+
# both database (fetching em all), and cookies (session is in cookie)
|
250
|
+
session[:history] = session[:history].slice(0, Blacklight::Catalog::SearchHistoryWindow )
|
244
251
|
end
|
245
252
|
end
|
246
253
|
|
@@ -40,9 +40,14 @@ module Blacklight::Controller
|
|
40
40
|
# http://api.rubyonrails.org/classes/ActionController/Filters/ClassMethods.html
|
41
41
|
# for how to turn off a filter in a sub-class and such.
|
42
42
|
def default_html_head
|
43
|
-
|
43
|
+
if use_asset_pipeline?
|
44
|
+
stylesheet_links << ["application"]
|
45
|
+
javascript_includes << ["application"]
|
46
|
+
else
|
47
|
+
stylesheet_links << ['yui', 'jquery/ui-lightness/jquery-ui-1.8.1.custom.css', 'blacklight/blacklight', {:media=>'all'}]
|
44
48
|
|
45
|
-
|
49
|
+
javascript_includes << ['jquery-1.4.2.min.js', 'jquery-ui-1.8.1.custom.min.js', 'blacklight/blacklight' ]
|
50
|
+
end
|
46
51
|
end
|
47
52
|
|
48
53
|
|
@@ -71,7 +76,7 @@ module Blacklight::Controller
|
|
71
76
|
|
72
77
|
# Returns a list of Searches from the ids in the user's history.
|
73
78
|
def searches_from_history
|
74
|
-
session[:history].blank? ? [] : Search.
|
79
|
+
session[:history].blank? ? [] : Search.where(:id => session[:history]).order("updated_at desc")
|
75
80
|
end
|
76
81
|
|
77
82
|
#
|
@@ -124,5 +129,10 @@ module Blacklight::Controller
|
|
124
129
|
redirect_to new_user_session_url(:referer => request.fullpath)
|
125
130
|
end
|
126
131
|
|
132
|
+
private
|
133
|
+
# Detect if the Rails asset pipeline is enabled
|
134
|
+
def use_asset_pipeline?
|
135
|
+
Rails.application.config.respond_to?(:assets) and Rails.application.config.assets.enabled
|
136
|
+
end
|
127
137
|
end
|
128
138
|
|
data/lib/blacklight/routes.rb
CHANGED
@@ -47,8 +47,7 @@ module Blacklight
|
|
47
47
|
def search_history
|
48
48
|
add_routes do |options|
|
49
49
|
match "search_history", :to => "search_history#index", :as => "search_history"
|
50
|
-
match "search_history/clear", :to => "search_history#clear", :as => "clear_search_history"
|
51
|
-
match "search_history/destroy/:id", :to => "search_history#destroy", :as => "delete_search"
|
50
|
+
match "search_history/clear", :to => "search_history#clear", :as => "clear_search_history"
|
52
51
|
end
|
53
52
|
end
|
54
53
|
|
@@ -391,13 +391,14 @@ module Blacklight::SolrHelper
|
|
391
391
|
# the Blacklight app-level request params that define the search.
|
392
392
|
def get_single_doc_via_search(index, request_params)
|
393
393
|
solr_params = solr_search_params(request_params)
|
394
|
-
solr_params[:start] = index - 1 # start at 0 to get 1st doc, 1 to get 2nd.
|
394
|
+
# solr_params[:start] = index - 1 # start at 0 to get 1st doc, 1 to get 2nd.
|
395
395
|
# FIXME: we must set page because of a bug posted here: https://github.com/mwmitchell/rsolr-ext/issues/16
|
396
|
-
solr_params[:page] = index
|
396
|
+
solr_params[:page] = index # start at 1 to get 1st 1-doc page with RSolr::Ext :page
|
397
397
|
solr_params[:per_page] = 1
|
398
398
|
solr_params[:rows] = 1
|
399
399
|
solr_params[:fl] = '*'
|
400
|
-
solr_response = find(solr_params)
|
400
|
+
solr_response = find(solr_params)
|
401
|
+
SolrDocument.new(solr_response.docs.first, solr_response) unless solr_response.docs.empty?
|
401
402
|
end
|
402
403
|
|
403
404
|
# returns a solr params hash
|
@@ -5,7 +5,7 @@
|
|
5
5
|
# generally you'd only want to do this in 'development', and can
|
6
6
|
# add it to environments/development.rb:
|
7
7
|
# require File.join(Blacklight.root, "lib", "generators", "blacklight", "assets_generator.rb")
|
8
|
-
# Blacklight::
|
8
|
+
# Blacklight::Assets.start(["--force", "--quiet"])
|
9
9
|
|
10
10
|
|
11
11
|
# Need the requires here so we can call the generator from environment.rb
|
@@ -13,13 +13,40 @@
|
|
13
13
|
require 'rails/generators'
|
14
14
|
require 'rails/generators/base'
|
15
15
|
module Blacklight
|
16
|
-
class
|
16
|
+
class Assets < Rails::Generators::Base
|
17
17
|
source_root File.expand_path('../templates', __FILE__)
|
18
18
|
|
19
19
|
def assets
|
20
|
-
|
21
|
-
|
22
|
-
|
20
|
+
if use_asset_pipeline?
|
21
|
+
insert_into_file "app/assets/stylesheets/application.css", :after => " *= require_self" do
|
22
|
+
%q{
|
23
|
+
*
|
24
|
+
* Required by Blacklight
|
25
|
+
*= require 'yui'
|
26
|
+
*= require 'jquery/ui-lightness/jquery-ui-1.8.1.custom.css'
|
27
|
+
*= require 'blacklight/blacklight'
|
28
|
+
}
|
29
|
+
end
|
30
|
+
|
31
|
+
insert_into_file "app/assets/javascripts/application.js", :after => "//= require jquery_ujs" do
|
32
|
+
%q{
|
33
|
+
// Required by Blacklight
|
34
|
+
//= require jquery-ui
|
35
|
+
//= require blacklight/blacklight
|
36
|
+
}
|
37
|
+
end
|
38
|
+
directory("../../../../app/assets/images/blacklight", "public/images/blacklight")
|
39
|
+
else
|
40
|
+
# directories are relative to the source_root
|
41
|
+
directory("../../../../app/assets/images/blacklight", "public/images/blacklight")
|
42
|
+
directory("../../../../app/assets/stylesheets", "public/stylesheets")
|
43
|
+
directory("../../../../app/assets/javascripts", "public/javascripts")
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
private
|
48
|
+
def use_asset_pipeline?
|
49
|
+
(Rails::VERSION::MAJOR >= 3 and Rails::VERSION::MINOR >= 1) and Rails.application.config.assets.enabled
|
23
50
|
end
|
24
51
|
|
25
52
|
end
|
@@ -83,6 +83,7 @@ EOF
|
|
83
83
|
end
|
84
84
|
}
|
85
85
|
end
|
86
|
+
gsub_file("config/initializers/devise.rb", "config.sign_out_via = :delete", "config.sign_out_via = :get")
|
86
87
|
end
|
87
88
|
end
|
88
89
|
|
@@ -93,12 +94,11 @@ EOF
|
|
93
94
|
directory("config/SolrMarc")
|
94
95
|
end
|
95
96
|
|
96
|
-
require File.expand_path('../assets_generator.rb', __FILE__)
|
97
97
|
# Copy all files in templates/public/ directory to public/
|
98
98
|
# Call external generator in AssetsGenerator, so we can
|
99
99
|
# leave that callable seperately too.
|
100
100
|
def copy_public_assets
|
101
|
-
|
101
|
+
generate "blacklight:assets"
|
102
102
|
end
|
103
103
|
|
104
104
|
# Setup the database migrations
|
data/test_support/bin/test.sh
CHANGED
@@ -74,11 +74,12 @@ platforms :ruby do
|
|
74
74
|
gem 'sqlite3-ruby', :require => 'sqlite3'
|
75
75
|
end
|
76
76
|
gem 'blacklight', :path => '../../'
|
77
|
+
gem 'jquery-rails'
|
77
78
|
|
78
79
|
# For testing
|
79
80
|
group :development, :test do
|
80
81
|
gem 'rspec'
|
81
|
-
gem 'rspec-rails', '
|
82
|
+
gem 'rspec-rails', '>=2.5.0'
|
82
83
|
gem 'generator_spec'
|
83
84
|
gem 'cucumber-rails'
|
84
85
|
gem 'database_cleaner'
|
@@ -27,15 +27,6 @@ Feature: Search History Page
|
|
27
27
|
Then I should see "dang"
|
28
28
|
And I should see "book"
|
29
29
|
|
30
|
-
Scenario: Deleting a Search
|
31
|
-
Given I have done a search with term "book"
|
32
|
-
And I am on the search history page
|
33
|
-
Then I should see a "delete" button
|
34
|
-
And I should see "book"
|
35
|
-
When I press "delete"
|
36
|
-
Then I should see "Successfully removed that search history item."
|
37
|
-
Then I should not see "book"
|
38
|
-
|
39
30
|
Scenario: Clearing Search History
|
40
31
|
Given I have done a search with term "book"
|
41
32
|
And I have done a search with term "dang"
|
@@ -7,7 +7,7 @@ Given /^I am logged in as "([^\"]*)"$/ do |login|
|
|
7
7
|
visit new_user_session_path
|
8
8
|
fill_in("user_email", :with => email)
|
9
9
|
fill_in("user_password", :with => "password")
|
10
|
-
click_button("
|
10
|
+
click_button("Sign in")
|
11
11
|
# response.body.should =~ /Logged/m
|
12
12
|
Then 'I should see "Log Out"'
|
13
13
|
end
|
@@ -6,16 +6,23 @@ describe ApplicationController do
|
|
6
6
|
describe "head content from variables" do
|
7
7
|
|
8
8
|
describe "#default_html_head" do
|
9
|
-
before(:each) do
|
10
|
-
controller.send(:default_html_head)
|
11
|
-
end
|
12
9
|
it "should setup js and css defaults" do
|
10
|
+
|
11
|
+
controller.should_receive(:use_asset_pipeline?).any_number_of_times.and_return(false)
|
12
|
+
controller.send(:default_html_head)
|
13
13
|
controller.javascript_includes.should include(["jquery-1.4.2.min.js", "jquery-ui-1.8.1.custom.min.js", "blacklight/blacklight"])#find do |item|
|
14
14
|
# item == ["jquery-1.4.2.min.js", "jquery-ui-1.7.2.custom.min.js", "blacklight", "application", "accordion", "lightbox", {:plugin=>:blacklight}]
|
15
15
|
#end
|
16
16
|
|
17
17
|
controller.stylesheet_links.should include(["yui", "jquery/ui-lightness/jquery-ui-1.8.1.custom.css", "blacklight/blacklight", {:media=>"all"}])
|
18
18
|
end
|
19
|
+
|
20
|
+
it "should support rails 3.1 asset pipeline js and css defaults" do
|
21
|
+
controller.should_receive(:use_asset_pipeline?).any_number_of_times.and_return(true)
|
22
|
+
controller.send(:default_html_head)
|
23
|
+
controller.javascript_includes.should include(["application"])
|
24
|
+
controller.stylesheet_links.should include(["application"])
|
25
|
+
end
|
19
26
|
end
|
20
27
|
end
|
21
28
|
|
@@ -19,6 +19,15 @@ describe SearchHistoryController do
|
|
19
19
|
@searches.should_not include(@two)
|
20
20
|
end
|
21
21
|
|
22
|
+
it "should tolerate bad ids in session" do
|
23
|
+
session[:history] = [@one.id, @three.id, "NOT_IN_DB"]
|
24
|
+
get :index
|
25
|
+
@searches = assigns(:searches)
|
26
|
+
@searches.length.should == 2
|
27
|
+
@searches.should include(@one)
|
28
|
+
@searches.should include(@three)
|
29
|
+
end
|
30
|
+
|
22
31
|
it "should not fetch any searches if there is no history" do
|
23
32
|
session[:history] = []
|
24
33
|
get :index
|
@@ -27,20 +36,6 @@ describe SearchHistoryController do
|
|
27
36
|
end
|
28
37
|
end
|
29
38
|
|
30
|
-
|
31
|
-
it "should delete the search by id from the search history not by array index" do
|
32
|
-
session[:history] = [1,2,2]
|
33
|
-
request.env["HTTP_REFERER"] = "/search_history"
|
34
|
-
get :destroy, :id=>1
|
35
|
-
session[:history].length.should == 2
|
36
|
-
end
|
37
|
-
it "should return a flash error if an id that is not in the users search history is deleted" do
|
38
|
-
session[:history] = [1,2,3]
|
39
|
-
request.env["HTTP_REFERER"] = "/search_history"
|
40
|
-
get :destroy, :id=>4
|
41
|
-
request.flash[:error].should_not == ""
|
42
|
-
end
|
43
|
-
|
44
|
-
end
|
39
|
+
|
45
40
|
|
46
41
|
end
|
@@ -63,6 +63,7 @@ def exportable_record
|
|
63
63
|
</record>"
|
64
64
|
end
|
65
65
|
describe BlacklightHelper do
|
66
|
+
include ERB::Util
|
66
67
|
include BlacklightHelper
|
67
68
|
|
68
69
|
describe "link_back_to_catalog" do
|
@@ -123,16 +124,17 @@ describe BlacklightHelper do
|
|
123
124
|
|
124
125
|
describe "search_as_hidden_fields" do
|
125
126
|
def params
|
126
|
-
{:q => "query", :sort => "sort", :per_page => "20", :search_field => "search_field", :page => 100, :arbitrary_key => "arbitrary_value", :f => {"field" => ["value1", "value2"]}, :controller => "catalog", :action => "index"}
|
127
|
+
{:q => "query", :sort => "sort", :per_page => "20", :search_field => "search_field", :page => 100, :arbitrary_key => "arbitrary_value", :f => {"field" => ["value1", "value2"]}, :controller => "catalog", :action => "index", :commit => "search"}
|
127
128
|
end
|
128
129
|
describe "for default arguments" do
|
129
130
|
it "should default to omitting :page" do
|
130
131
|
search_as_hidden_fields.should have_selector("input[type='hidden']", :count =>7)
|
131
132
|
search_as_hidden_fields.should_not have_selector("input[name='page']")
|
132
133
|
end
|
133
|
-
it "should not return
|
134
|
+
it "should not return blacklisted elements" do
|
134
135
|
search_as_hidden_fields.should_not have_selector("input[name='action']")
|
135
136
|
search_as_hidden_fields.should_not have_selector("input[name='controller']")
|
137
|
+
search_as_hidden_fields.should_not have_selector("input[name='commit']")
|
136
138
|
end
|
137
139
|
describe "for omit_keys parameter" do
|
138
140
|
it "should not include those keys" do
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 3
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
version: 3.0.
|
8
|
+
- 0pre8
|
9
|
+
version: 3.0.0pre8
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Jonathan Rochkind
|
@@ -21,7 +21,7 @@ autorequire:
|
|
21
21
|
bindir: bin
|
22
22
|
cert_chain: []
|
23
23
|
|
24
|
-
date: 2011-
|
24
|
+
date: 2011-07-01 00:00:00 -04:00
|
25
25
|
default_executable:
|
26
26
|
dependencies:
|
27
27
|
- !ruby/object:Gem::Dependency
|
@@ -142,6 +142,36 @@ files:
|
|
142
142
|
- README.md
|
143
143
|
- Rakefile
|
144
144
|
- VERSION
|
145
|
+
- app/assets/images/blacklight/bg.png
|
146
|
+
- app/assets/images/blacklight/border.png
|
147
|
+
- app/assets/images/blacklight/bul_sq_gry.gif
|
148
|
+
- app/assets/images/blacklight/checkmark.gif
|
149
|
+
- app/assets/images/blacklight/logo.png
|
150
|
+
- app/assets/images/blacklight/magnifying_glass.gif
|
151
|
+
- app/assets/images/blacklight/remove.gif
|
152
|
+
- app/assets/images/blacklight/separator.gif
|
153
|
+
- app/assets/images/blacklight/start_over.gif
|
154
|
+
- app/assets/javascripts/blacklight/blacklight.js
|
155
|
+
- app/assets/javascripts/jquery-1.4.2.min.js
|
156
|
+
- app/assets/javascripts/jquery-ui-1.8.1.custom.min.js
|
157
|
+
- app/assets/stylesheets/blacklight/blacklight.css
|
158
|
+
- app/assets/stylesheets/jquery/ui-lightness/images/ui-anim_basic_16x16.gif
|
159
|
+
- app/assets/stylesheets/jquery/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png
|
160
|
+
- app/assets/stylesheets/jquery/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png
|
161
|
+
- app/assets/stylesheets/jquery/ui-lightness/images/ui-bg_flat_10_000000_40x100.png
|
162
|
+
- app/assets/stylesheets/jquery/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png
|
163
|
+
- app/assets/stylesheets/jquery/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png
|
164
|
+
- app/assets/stylesheets/jquery/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png
|
165
|
+
- app/assets/stylesheets/jquery/ui-lightness/images/ui-bg_gloss-wave_35_558fd0_500x100.png
|
166
|
+
- app/assets/stylesheets/jquery/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png
|
167
|
+
- app/assets/stylesheets/jquery/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png
|
168
|
+
- app/assets/stylesheets/jquery/ui-lightness/images/ui-icons_222222_256x240.png
|
169
|
+
- app/assets/stylesheets/jquery/ui-lightness/images/ui-icons_228ef1_256x240.png
|
170
|
+
- app/assets/stylesheets/jquery/ui-lightness/images/ui-icons_2e4f81_256x240.png
|
171
|
+
- app/assets/stylesheets/jquery/ui-lightness/images/ui-icons_ffd27a_256x240.png
|
172
|
+
- app/assets/stylesheets/jquery/ui-lightness/images/ui-icons_ffffff_256x240.png
|
173
|
+
- app/assets/stylesheets/jquery/ui-lightness/jquery-ui-1.8.1.custom.css
|
174
|
+
- app/assets/stylesheets/yui.css
|
145
175
|
- app/controllers/bookmarks_controller.rb
|
146
176
|
- app/controllers/feedback_controller.rb
|
147
177
|
- app/controllers/folder_controller.rb
|
@@ -274,36 +304,6 @@ files:
|
|
274
304
|
- lib/generators/blacklight/templates/migrations/create_bookmarks.rb
|
275
305
|
- lib/generators/blacklight/templates/migrations/create_searches.rb
|
276
306
|
- lib/generators/blacklight/templates/migrations/remove_editable_fields_from_bookmarks.rb
|
277
|
-
- lib/generators/blacklight/templates/public/images/blacklight/bg.png
|
278
|
-
- lib/generators/blacklight/templates/public/images/blacklight/border.png
|
279
|
-
- lib/generators/blacklight/templates/public/images/blacklight/bul_sq_gry.gif
|
280
|
-
- lib/generators/blacklight/templates/public/images/blacklight/checkmark.gif
|
281
|
-
- lib/generators/blacklight/templates/public/images/blacklight/logo.png
|
282
|
-
- lib/generators/blacklight/templates/public/images/blacklight/magnifying_glass.gif
|
283
|
-
- lib/generators/blacklight/templates/public/images/blacklight/remove.gif
|
284
|
-
- lib/generators/blacklight/templates/public/images/blacklight/separator.gif
|
285
|
-
- lib/generators/blacklight/templates/public/images/blacklight/start_over.gif
|
286
|
-
- lib/generators/blacklight/templates/public/javascripts/blacklight/blacklight.js
|
287
|
-
- lib/generators/blacklight/templates/public/javascripts/jquery-1.4.2.min.js
|
288
|
-
- lib/generators/blacklight/templates/public/javascripts/jquery-ui-1.8.1.custom.min.js
|
289
|
-
- lib/generators/blacklight/templates/public/stylesheets/blacklight/blacklight.css
|
290
|
-
- lib/generators/blacklight/templates/public/stylesheets/jquery/ui-lightness/images/ui-anim_basic_16x16.gif
|
291
|
-
- lib/generators/blacklight/templates/public/stylesheets/jquery/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png
|
292
|
-
- lib/generators/blacklight/templates/public/stylesheets/jquery/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png
|
293
|
-
- lib/generators/blacklight/templates/public/stylesheets/jquery/ui-lightness/images/ui-bg_flat_10_000000_40x100.png
|
294
|
-
- lib/generators/blacklight/templates/public/stylesheets/jquery/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png
|
295
|
-
- lib/generators/blacklight/templates/public/stylesheets/jquery/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png
|
296
|
-
- lib/generators/blacklight/templates/public/stylesheets/jquery/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png
|
297
|
-
- lib/generators/blacklight/templates/public/stylesheets/jquery/ui-lightness/images/ui-bg_gloss-wave_35_558fd0_500x100.png
|
298
|
-
- lib/generators/blacklight/templates/public/stylesheets/jquery/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png
|
299
|
-
- lib/generators/blacklight/templates/public/stylesheets/jquery/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png
|
300
|
-
- lib/generators/blacklight/templates/public/stylesheets/jquery/ui-lightness/images/ui-icons_222222_256x240.png
|
301
|
-
- lib/generators/blacklight/templates/public/stylesheets/jquery/ui-lightness/images/ui-icons_228ef1_256x240.png
|
302
|
-
- lib/generators/blacklight/templates/public/stylesheets/jquery/ui-lightness/images/ui-icons_2e4f81_256x240.png
|
303
|
-
- lib/generators/blacklight/templates/public/stylesheets/jquery/ui-lightness/images/ui-icons_ffd27a_256x240.png
|
304
|
-
- lib/generators/blacklight/templates/public/stylesheets/jquery/ui-lightness/images/ui-icons_ffffff_256x240.png
|
305
|
-
- lib/generators/blacklight/templates/public/stylesheets/jquery/ui-lightness/jquery-ui-1.8.1.custom.css
|
306
|
-
- lib/generators/blacklight/templates/public/stylesheets/yui.css
|
307
307
|
- lib/generators/blacklight/templates/solr_conf/schema.xml
|
308
308
|
- lib/generators/blacklight/templates/solr_conf/solrconfig.xml
|
309
309
|
- lib/generators/blacklight/templates/solr_document.rb
|
@@ -402,7 +402,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
402
402
|
requirements:
|
403
403
|
- - ">="
|
404
404
|
- !ruby/object:Gem::Version
|
405
|
-
hash:
|
405
|
+
hash: -4202533913713398219
|
406
406
|
segments:
|
407
407
|
- 0
|
408
408
|
version: "0"
|