blacklight_advanced_search 6.0.0 → 6.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/blacklight_advanced_search.gemspec +1 -1
- data/lib/blacklight_advanced_search/controller.rb +0 -7
- data/lib/blacklight_advanced_search/engine.rb +0 -35
- data/lib/generators/blacklight_advanced_search/install_generator.rb +25 -0
- data/lib/generators/blacklight_advanced_search/templates/saved_searches_controller.rb +6 -0
- data/lib/generators/blacklight_advanced_search/templates/search_history_controller.rb +6 -0
- data/spec/test_app_templates/app/controllers/catalog_controller.rb +24 -16
- metadata +8 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 656aa169eecd81150115fea2e617b2d345676709
|
4
|
+
data.tar.gz: 70d003ffa0d3e363ad54d0e0b5b5a87c15ebcd72
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5ae65b233d287eab9f15e21f711b7eda5a464e1875a40404e2ee12cd98440bfb8884a136313dcfe192ce14ea22c61f14f08525a49645e7f207a74f7c92f56f9f
|
7
|
+
data.tar.gz: 76ececeffd3c0b342a9cb336ae03c5c032135cc1c9e12b56fd04e6816cf4ac222e00aef291ae6556c646396a0ff9db9e59474c2f514d6baf4afa23d43b2df11e
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
6.0.
|
1
|
+
6.0.1
|
@@ -17,7 +17,7 @@ Gem::Specification.new do |s|
|
|
17
17
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
18
18
|
s.require_paths = ["lib"]
|
19
19
|
|
20
|
-
s.add_dependency 'blacklight', '
|
20
|
+
s.add_dependency 'blacklight', '~> 6.0.1'
|
21
21
|
s.add_dependency "parslet"
|
22
22
|
|
23
23
|
s.add_development_dependency "rails"
|
@@ -6,13 +6,6 @@ module BlacklightAdvancedSearch::Controller
|
|
6
6
|
extend ActiveSupport::Concern
|
7
7
|
|
8
8
|
included do
|
9
|
-
# default advanced config values
|
10
|
-
blacklight_config.advanced_search ||= Blacklight::OpenStructWithHashAccess.new
|
11
|
-
#blacklight_config.advanced_search[:qt] ||= 'advanced'
|
12
|
-
blacklight_config.advanced_search[:url_key] ||= 'advanced'
|
13
|
-
blacklight_config.advanced_search[:query_parser] ||= 'dismax'
|
14
|
-
blacklight_config.advanced_search[:form_solr_parameters] ||= {}
|
15
|
-
|
16
9
|
# Display advanced search constraints properly
|
17
10
|
helper BlacklightAdvancedSearch::RenderConstraintsOverride
|
18
11
|
helper BlacklightAdvancedSearch::CatalogHelperOverride
|
@@ -2,40 +2,5 @@ require 'blacklight'
|
|
2
2
|
|
3
3
|
module BlacklightAdvancedSearch
|
4
4
|
class Engine < Rails::Engine
|
5
|
-
|
6
|
-
# Do these things in a to_prepare block, to try and make them work
|
7
|
-
# in development mode with class-reloading. The trick is we can't
|
8
|
-
# be sure if the controllers we're modifying are being reloaded in
|
9
|
-
# dev mode, if they are in the BL plugin and haven't been copied to
|
10
|
-
# local, they won't be. But we do our best.
|
11
|
-
config.to_prepare do
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
# Ordinary module over-ride to CatalogController
|
16
|
-
CatalogController.send(:include,
|
17
|
-
BlacklightAdvancedSearch::Controller
|
18
|
-
) unless
|
19
|
-
CatalogController.include?(
|
20
|
-
BlacklightAdvancedSearch::Controller
|
21
|
-
)
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
SearchHistoryController.send(:helper,
|
26
|
-
BlacklightAdvancedSearch::RenderConstraintsOverride
|
27
|
-
) unless
|
28
|
-
SearchHistoryController.helpers.is_a?(
|
29
|
-
BlacklightAdvancedSearch::RenderConstraintsOverride
|
30
|
-
)
|
31
|
-
|
32
|
-
SavedSearchesController.send(:helper,
|
33
|
-
BlacklightAdvancedSearch::RenderConstraintsOverride
|
34
|
-
) unless
|
35
|
-
SearchHistoryController.helpers.is_a?(
|
36
|
-
BlacklightAdvancedSearch::RenderConstraintsOverride
|
37
|
-
)
|
38
|
-
|
39
|
-
end
|
40
5
|
end
|
41
6
|
end
|
@@ -15,6 +15,31 @@ module BlacklightAdvancedSearch
|
|
15
15
|
end
|
16
16
|
end
|
17
17
|
|
18
|
+
def install_catalog_controller_mixin
|
19
|
+
inject_into_class "app/controllers/catalog_controller.rb", "CatalogController" do
|
20
|
+
" include BlacklightAdvancedSearch::Controller\n"
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
def configuration
|
25
|
+
inject_into_file 'app/controllers/catalog_controller.rb', after: "configure_blacklight do |config|" do
|
26
|
+
"\n # default advanced config values" \
|
27
|
+
"\n config.advanced_search ||= Blacklight::OpenStructWithHashAccess.new" \
|
28
|
+
"\n # config.advanced_search[:qt] ||= 'advanced'" \
|
29
|
+
"\n config.advanced_search[:url_key] ||= 'advanced'" \
|
30
|
+
"\n config.advanced_search[:query_parser] ||= 'dismax'" \
|
31
|
+
"\n config.advanced_search[:form_solr_parameters] ||= {}\n"
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
def install_search_history_controller
|
36
|
+
copy_file "search_history_controller.rb", "app/controllers/search_history_controller.rb"
|
37
|
+
end
|
38
|
+
|
39
|
+
def install_saved_searches_controller
|
40
|
+
copy_file "saved_searches_controller.rb", "app/controllers/saved_searches_controller.rb"
|
41
|
+
end
|
42
|
+
|
18
43
|
def inject_routes
|
19
44
|
inject_into_file 'config/routes.rb', after: /mount Blacklight::Engine.*$/ do
|
20
45
|
"\n mount BlacklightAdvancedSearch::Engine => '/'\n"
|
@@ -1,25 +1,33 @@
|
|
1
1
|
class CatalogController < ApplicationController
|
2
2
|
include Blacklight::Catalog
|
3
|
+
include BlacklightAdvancedSearch::Controller
|
3
4
|
|
4
5
|
configure_blacklight do |config|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
6
|
+
# default advanced config values
|
7
|
+
config.advanced_search ||= Blacklight::OpenStructWithHashAccess.new
|
8
|
+
# config.advanced_search[:qt] ||= 'advanced'
|
9
|
+
config.advanced_search[:url_key] ||= 'advanced'
|
10
|
+
config.advanced_search[:query_parser] ||= 'dismax'
|
11
|
+
config.advanced_search[:form_solr_parameters] ||= {}
|
9
12
|
|
10
|
-
|
13
|
+
config.default_solr_params = {
|
14
|
+
:qt => 'search',
|
15
|
+
:rows => 10
|
16
|
+
}
|
11
17
|
|
12
|
-
|
13
|
-
field.solr_local_parameters = { :qf => "title_t", :pf => "title_t"}
|
14
|
-
end
|
18
|
+
config.add_facet_field 'language_facet'
|
15
19
|
|
16
|
-
|
17
|
-
|
18
|
-
|
20
|
+
config.add_search_field('title') do |field|
|
21
|
+
field.solr_local_parameters = { :qf => "title_t", :pf => "title_t"}
|
22
|
+
end
|
23
|
+
|
24
|
+
config.add_search_field('author') do |field|
|
25
|
+
field.solr_local_parameters = { :qf => "author_t", :pf => "author_t"}
|
26
|
+
end
|
19
27
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
end
|
28
|
+
config.add_search_field('dummy_field') do |field|
|
29
|
+
field.include_in_advanced_search = false
|
30
|
+
field.solr_local_parameters = { :qf => "author_t", :pf => "author_t"}
|
24
31
|
end
|
25
|
-
end
|
32
|
+
end
|
33
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: blacklight_advanced_search
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 6.0.
|
4
|
+
version: 6.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jonathan Rochkind
|
@@ -9,28 +9,22 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-01-
|
12
|
+
date: 2016-01-30 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: blacklight
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
17
17
|
requirements:
|
18
|
-
- - "
|
19
|
-
- !ruby/object:Gem::Version
|
20
|
-
version: 6.0.0.pre
|
21
|
-
- - "<"
|
18
|
+
- - "~>"
|
22
19
|
- !ruby/object:Gem::Version
|
23
|
-
version:
|
20
|
+
version: 6.0.1
|
24
21
|
type: :runtime
|
25
22
|
prerelease: false
|
26
23
|
version_requirements: !ruby/object:Gem::Requirement
|
27
24
|
requirements:
|
28
|
-
- - "
|
29
|
-
- !ruby/object:Gem::Version
|
30
|
-
version: 6.0.0.pre
|
31
|
-
- - "<"
|
25
|
+
- - "~>"
|
32
26
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
27
|
+
version: 6.0.1
|
34
28
|
- !ruby/object:Gem::Dependency
|
35
29
|
name: parslet
|
36
30
|
requirement: !ruby/object:Gem::Requirement
|
@@ -164,6 +158,8 @@ files:
|
|
164
158
|
- lib/generators/blacklight_advanced_search/blacklight_advanced_search_generator.rb
|
165
159
|
- lib/generators/blacklight_advanced_search/install_generator.rb
|
166
160
|
- lib/generators/blacklight_advanced_search/templates/advanced_controller.rb
|
161
|
+
- lib/generators/blacklight_advanced_search/templates/saved_searches_controller.rb
|
162
|
+
- lib/generators/blacklight_advanced_search/templates/search_history_controller.rb
|
167
163
|
- lib/parsing_nesting/Readme.rdoc
|
168
164
|
- lib/parsing_nesting/grammar.rb
|
169
165
|
- lib/parsing_nesting/tree.rb
|