blacklight 5.19.2 → 6.0.0.pre1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +0 -3
- data/.hound.yml +2 -0
- data/.jshintrc +67 -0
- data/.rubocop_hound.yml +4 -0
- data/.travis.yml +11 -8
- data/Gemfile +11 -21
- data/Rakefile +1 -0
- data/VERSION +1 -1
- data/app/assets/javascripts/blacklight/blacklight.js +1 -0
- data/app/assets/javascripts/blacklight/core.js +5 -19
- data/app/assets/javascripts/blacklight/facet_load.js +23 -0
- data/app/assets/stylesheets/blacklight/_balanced_list.scss +18 -0
- data/app/assets/stylesheets/blacklight/_blacklight_base.scss +5 -1
- data/app/assets/stylesheets/blacklight/_bookmark.scss +14 -6
- data/app/assets/stylesheets/blacklight/_constraints.scss +52 -0
- data/app/assets/stylesheets/blacklight/_controls.scss +61 -0
- data/app/assets/stylesheets/blacklight/_facets.scss +31 -4
- data/app/assets/stylesheets/blacklight/_header.scss +17 -3
- data/app/assets/stylesheets/blacklight/_pagination.scss +21 -0
- data/app/assets/stylesheets/blacklight/_search_results.scss +28 -0
- data/app/assets/stylesheets/blacklight/blacklight_defaults.scss +0 -3
- data/app/controllers/concerns/blacklight/bookmarks.rb +1 -1
- data/app/controllers/concerns/blacklight/catalog.rb +3 -45
- data/app/controllers/concerns/blacklight/controller.rb +29 -18
- data/app/controllers/concerns/blacklight/default_component_configuration.rb +4 -3
- data/app/controllers/concerns/blacklight/facet.rb +1 -0
- data/app/controllers/concerns/blacklight/request_builders.rb +4 -107
- data/app/controllers/concerns/blacklight/search_fields.rb +1 -1
- data/app/controllers/concerns/blacklight/search_helper.rb +8 -160
- data/app/controllers/saved_searches_controller.rb +1 -1
- data/app/controllers/search_history_controller.rb +18 -1
- data/app/helpers/blacklight/blacklight_helper_behavior.rb +17 -85
- data/app/helpers/blacklight/catalog_helper_behavior.rb +4 -48
- data/app/helpers/blacklight/component_helper_behavior.rb +9 -2
- data/app/helpers/blacklight/configuration_helper_behavior.rb +3 -43
- data/app/helpers/blacklight/facets_helper_behavior.rb +10 -6
- data/app/helpers/blacklight/layout_helper_behavior.rb +0 -8
- data/app/helpers/blacklight/render_constraints_helper_behavior.rb +9 -10
- data/app/helpers/blacklight/render_partials_helper.rb +1 -3
- data/app/helpers/blacklight/url_helper_behavior.rb +15 -187
- data/{lib → app/models}/blacklight/abstract_repository.rb +0 -15
- data/{lib → app/models}/blacklight/configuration.rb +22 -59
- data/app/models/blacklight/configuration/context.rb +47 -0
- data/{lib → app/models}/blacklight/configuration/facet_field.rb +1 -0
- data/{lib → app/models}/blacklight/configuration/field.rb +0 -0
- data/{lib → app/models}/blacklight/configuration/fields.rb +2 -6
- data/{lib → app/models}/blacklight/configuration/search_field.rb +0 -0
- data/{lib → app/models}/blacklight/configuration/solr_field.rb +0 -0
- data/{lib → app/models}/blacklight/configuration/sort_field.rb +0 -0
- data/{lib → app/models}/blacklight/configuration/tool_config.rb +0 -0
- data/app/models/blacklight/configuration/view_config.rb +9 -0
- data/app/models/blacklight/facet_paginator.rb +14 -28
- data/{lib → app/models}/blacklight/search_builder.rb +16 -24
- data/app/models/blacklight/solr/facet_paginator.rb +6 -2
- data/{lib → app/models}/blacklight/solr/repository.rb +0 -21
- data/{lib → app/models}/blacklight/solr/request.rb +0 -0
- data/{lib → app/models}/blacklight/solr/response.rb +9 -8
- data/{lib → app/models}/blacklight/solr/response/facets.rb +37 -29
- data/{lib → app/models}/blacklight/solr/response/group.rb +0 -0
- data/{lib → app/models}/blacklight/solr/response/group_response.rb +0 -0
- data/{lib → app/models}/blacklight/solr/response/more_like_this.rb +0 -0
- data/{lib → app/models}/blacklight/solr/response/pagination_methods.rb +0 -0
- data/{lib → app/models}/blacklight/solr/response/response.rb +0 -0
- data/{lib → app/models}/blacklight/solr/response/spelling.rb +2 -1
- data/{lib → app/models}/blacklight/solr/search_builder.rb +0 -0
- data/app/models/concerns/blacklight/document.rb +11 -27
- data/app/models/concerns/blacklight/document/active_model_shim.rb +8 -0
- data/app/models/concerns/blacklight/solr/document.rb +8 -3
- data/{lib → app/models/concerns}/blacklight/solr/search_builder_behavior.rb +21 -33
- data/app/models/concerns/blacklight/user.rb +0 -9
- data/app/models/record_mailer.rb +0 -1
- data/app/presenters/blacklight/document_presenter.rb +23 -13
- data/app/views/blacklight/nav/_saved_searches.html.erb +1 -1
- data/app/views/blacklight/nav/_search_history.html.erb +1 -1
- data/app/views/bookmarks/_tools.html.erb +1 -2
- data/app/views/bookmarks/index.html.erb +2 -2
- data/app/views/catalog/_document_default.atom.builder +4 -2
- data/app/views/catalog/_facet_index_navigation.html.erb +9 -0
- data/app/views/catalog/_facet_layout.html.erb +2 -3
- data/app/views/catalog/_facet_pagination.html.erb +19 -21
- data/app/views/catalog/_facets.html.erb +2 -3
- data/app/views/catalog/_home_text.html.erb +2 -3
- data/app/views/catalog/_index_header_default.html.erb +2 -2
- data/app/views/catalog/_per_page_widget.html.erb +1 -1
- data/app/views/catalog/_search_form.html.erb +21 -18
- data/app/views/catalog/_sort_widget.html.erb +1 -1
- data/app/views/catalog/_zero_results.html.erb +2 -2
- data/app/views/catalog/facet.html.erb +3 -0
- data/app/views/catalog/index.atom.builder +1 -1
- data/app/views/layouts/blacklight.html.erb +2 -2
- data/app/views/saved_searches/index.html.erb +6 -7
- data/app/views/search_history/index.html.erb +5 -5
- data/app/views/shared/_header_navbar.html.erb +2 -2
- data/blacklight.gemspec +5 -5
- data/config/locales/blacklight.de.yml +1 -4
- data/config/locales/blacklight.en.yml +2 -7
- data/config/locales/blacklight.es.yml +1 -4
- data/config/locales/blacklight.fr.yml +1 -4
- data/config/locales/blacklight.it.yml +1 -4
- data/config/locales/blacklight.pt-BR.yml +1 -4
- data/config/routes.rb +9 -0
- data/db/migrate/20140202020201_create_searches.rb +1 -1
- data/db/migrate/20140202020202_create_bookmarks.rb +1 -1
- data/lib/blacklight.rb +5 -82
- data/lib/blacklight/engine.rb +0 -5
- data/lib/blacklight/parameters.rb +13 -0
- data/lib/blacklight/path.rb +143 -0
- data/lib/blacklight/routes.rb +3 -134
- data/lib/blacklight/routes/exportable.rb +25 -0
- data/lib/blacklight/routes/searchable.rb +20 -0
- data/lib/blacklight/solr.rb +1 -9
- data/lib/blacklight/utils.rb +2 -44
- data/lib/generators/blacklight/controller_generator.rb +7 -4
- data/lib/generators/blacklight/install_generator.rb +16 -9
- data/lib/generators/blacklight/models_generator.rb +18 -0
- data/lib/generators/blacklight/templates/catalog_controller.rb +85 -91
- data/lib/generators/blacklight/test_support_generator.rb +22 -15
- data/solr/conf/_rest_managed.json +3 -0
- data/solr/conf/admin-extra.html +31 -0
- data/solr/conf/elevate.xml +36 -0
- data/solr/conf/mapping-ISOLatin1Accent.txt +246 -0
- data/solr/conf/protwords.txt +21 -0
- data/solr/conf/schema.xml +621 -0
- data/solr/conf/scripts.conf +24 -0
- data/solr/conf/solrconfig.xml +391 -0
- data/solr/conf/spellings.txt +2 -0
- data/solr/conf/stopwords.txt +58 -0
- data/solr/conf/stopwords_en.txt +58 -0
- data/solr/conf/synonyms.txt +31 -0
- data/solr/conf/xslt/example.xsl +132 -0
- data/solr/conf/xslt/example_atom.xsl +67 -0
- data/solr/conf/xslt/example_rss.xsl +66 -0
- data/solr/conf/xslt/luke.xsl +337 -0
- data/solr/sample_solr_documents.yml +1 -0
- data/spec/controllers/blacklight/base_spec.rb +17 -0
- data/spec/controllers/blacklight/search_helper_spec.rb +25 -297
- data/spec/controllers/catalog_controller_spec.rb +7 -6
- data/spec/controllers/saved_searches_controller_spec.rb +1 -0
- data/spec/controllers/search_history_controller_spec.rb +1 -0
- data/spec/features/alternate_controller_spec.rb +10 -10
- data/spec/features/bookmarks_spec.rb +8 -22
- data/spec/features/facets_spec.rb +27 -7
- data/spec/features/record_view_spec.rb +4 -13
- data/spec/features/search_formats_spec.rb +1 -26
- data/spec/features/sitelinks_search_box.rb +1 -1
- data/spec/helpers/blacklight_helper_spec.rb +8 -38
- data/spec/helpers/catalog_helper_spec.rb +0 -8
- data/spec/helpers/configuration_helper_spec.rb +0 -25
- data/spec/helpers/facets_helper_spec.rb +12 -11
- data/spec/helpers/hash_as_hidden_fields_spec.rb +7 -7
- data/spec/helpers/layout_helper_spec.rb +0 -7
- data/spec/helpers/render_constraints_helper_spec.rb +4 -2
- data/spec/helpers/url_helper_spec.rb +13 -254
- data/spec/lib/blacklight/parameters_spec.rb +22 -0
- data/spec/lib/blacklight/path_spec.rb +254 -0
- data/spec/lib/blacklight_spec.rb +6 -2
- data/spec/models/blacklight/configuration/context_spec.rb +33 -0
- data/spec/models/blacklight/document/active_model_shim_spec.rb +33 -0
- data/spec/models/blacklight/document_spec.rb +29 -1
- data/spec/models/blacklight/facet_paginator_spec.rb +14 -13
- data/spec/models/blacklight/search_builder_spec.rb +17 -23
- data/spec/models/blacklight/solr/facet_paginator_spec.rb +11 -1
- data/spec/models/blacklight/solr/response/facets_spec.rb +19 -25
- data/spec/models/blacklight/solr/response/group_response_spec.rb +5 -5
- data/spec/models/blacklight/solr/response_spec.rb +0 -11
- data/spec/models/blacklight/solr/search_builder_spec.rb +49 -57
- data/spec/presenters/document_presenter_spec.rb +15 -42
- data/spec/routing/catalog_routing_spec.rb +7 -11
- data/spec/spec_helper.rb +4 -42
- data/spec/support/controller_level_helpers.rb +17 -0
- data/spec/test_app_templates/lib/generators/test_app_generator.rb +1 -2
- data/spec/views/_user_util_links.html.erb_spec.rb +1 -1
- data/spec/views/catalog/_facet_index_navigation.html.erb_spec.rb +40 -0
- data/spec/views/catalog/_facet_layout.html.erb_spec.rb +1 -1
- data/spec/views/catalog/_facets.html.erb_spec.rb +2 -2
- data/spec/views/catalog/_paginate_compact.html.erb_spec.rb +1 -1
- data/spec/views/catalog/_show_tools.html.erb_spec.rb +8 -8
- data/spec/views/catalog/_sort_and_per_page.html.erb_spec.rb +2 -2
- data/tasks/blacklight.rake +25 -30
- metadata +93 -71
- data/app/assets/stylesheets/blacklight/_catalog.scss +0 -229
- data/app/controllers/concerns/blacklight/search_history.rb +0 -31
- data/app/views/catalog/_refworks_form.html.erb +0 -6
- data/lib/blacklight/configuration/view_config.rb +0 -71
- data/lib/blacklight/rails/routes.rb +0 -29
- data/lib/blacklight/solr_helper.rb +0 -9
- data/lib/generators/blacklight/templates/config/initializers/blacklight_initializer.rb +0 -9
- data/spec/helpers/component_helper_spec.rb +0 -19
- data/spec/lib/blacklight/routes_spec.rb +0 -25
- data/spec/lib/blacklight/solr_helper_spec.rb +0 -12
- data/spec/routing/routes_spec.rb +0 -20
- data/spec/views/catalog/_document_action.html.erb_spec.rb +0 -21
@@ -1,229 +0,0 @@
|
|
1
|
-
.ajax_form
|
2
|
-
{
|
3
|
-
margin-bottom: 0;
|
4
|
-
}
|
5
|
-
|
6
|
-
#librarian_view
|
7
|
-
{
|
8
|
-
left:-17%;
|
9
|
-
text-align:left;
|
10
|
-
top:10%;
|
11
|
-
width:700px;
|
12
|
-
}
|
13
|
-
|
14
|
-
#marc_view
|
15
|
-
{
|
16
|
-
text-align:left;
|
17
|
-
|
18
|
-
.field
|
19
|
-
{
|
20
|
-
border-bottom: $marc_item_separator;
|
21
|
-
clear:both;
|
22
|
-
}
|
23
|
-
|
24
|
-
.ind1, .ind2
|
25
|
-
{
|
26
|
-
display:inline;
|
27
|
-
padding:0 $padding-xs-horizontal;
|
28
|
-
}
|
29
|
-
|
30
|
-
.subfields
|
31
|
-
{
|
32
|
-
padding-left:5em;
|
33
|
-
}
|
34
|
-
|
35
|
-
.tag_ind
|
36
|
-
{
|
37
|
-
float:left;
|
38
|
-
}
|
39
|
-
}
|
40
|
-
|
41
|
-
.constraints-container {
|
42
|
-
@extend .well;
|
43
|
-
line-height: 2.5;
|
44
|
-
padding: 16px 19px;
|
45
|
-
}
|
46
|
-
|
47
|
-
span.constraints-label {
|
48
|
-
@extend .h5;
|
49
|
-
}
|
50
|
-
|
51
|
-
.appliedFilter
|
52
|
-
{
|
53
|
-
.constraint-value {
|
54
|
-
cursor: default;
|
55
|
-
text-overflow: ellipsis;
|
56
|
-
overflow: hidden;
|
57
|
-
|
58
|
-
@media (max-width: $screen-xs-max) {
|
59
|
-
max-width: $screen-xs-min / 2;
|
60
|
-
}
|
61
|
-
|
62
|
-
@media (min-width: $screen-sm-min) and (max-width: $screen-sm-max) {
|
63
|
-
max-width: $screen-sm-min / 2;
|
64
|
-
}
|
65
|
-
|
66
|
-
@media (min-width: $screen-md-min) and (max-width: $screen-md-max) {
|
67
|
-
max-width: $screen-md-min / 2;
|
68
|
-
}
|
69
|
-
|
70
|
-
@media (min-width: $screen-lg-min) {
|
71
|
-
max-width: $screen-lg-min / 2;
|
72
|
-
}
|
73
|
-
|
74
|
-
&:hover, &:active {
|
75
|
-
background-color: $btn-default-bg;
|
76
|
-
border-color: $btn-default-border;
|
77
|
-
box-shadow: none;
|
78
|
-
}
|
79
|
-
}
|
80
|
-
|
81
|
-
.filterName:after
|
82
|
-
{
|
83
|
-
@extend .text-muted;
|
84
|
-
font-family: 'Glyphicons Halflings';
|
85
|
-
/* glyphicon-chevron-right */
|
86
|
-
content: "\e080";
|
87
|
-
font-size: 70%;
|
88
|
-
padding-left: $caret-width-base;
|
89
|
-
}
|
90
|
-
|
91
|
-
.remove:hover, .remove:active {
|
92
|
-
@extend .btn-danger;
|
93
|
-
|
94
|
-
}
|
95
|
-
}
|
96
|
-
|
97
|
-
#documents {
|
98
|
-
.document {
|
99
|
-
margin-top: $padding-base-vertical;
|
100
|
-
padding-top: $padding-base-vertical;
|
101
|
-
border-bottom:1px dotted $table-border-color;
|
102
|
-
@extend .clearfix;
|
103
|
-
}
|
104
|
-
}
|
105
|
-
|
106
|
-
// Tools link on documetn show page
|
107
|
-
.show-tools {
|
108
|
-
.bookmark_toggle {
|
109
|
-
padding: $nav-link-padding;
|
110
|
-
}
|
111
|
-
}
|
112
|
-
|
113
|
-
// bookmarks checkbox on index, give it some
|
114
|
-
// lower margin when it collapses
|
115
|
-
.index-document-functions {
|
116
|
-
margin-bottom: ($line-height-computed / 2);
|
117
|
-
@media (min-width: $screen-sm-min) {
|
118
|
-
margin-bottom: 0;
|
119
|
-
}
|
120
|
-
}
|
121
|
-
|
122
|
-
|
123
|
-
#sidebar form {
|
124
|
-
margin: 0;
|
125
|
-
}
|
126
|
-
|
127
|
-
.page_links
|
128
|
-
{
|
129
|
-
display: inline-block;
|
130
|
-
border: 1px solid transparent;
|
131
|
-
padding: $padding-base-vertical $padding-base-horizontal;
|
132
|
-
padding-left: 0;
|
133
|
-
}
|
134
|
-
|
135
|
-
.pagination {
|
136
|
-
text-align: center ;
|
137
|
-
}
|
138
|
-
|
139
|
-
.dl-horizontal
|
140
|
-
{
|
141
|
-
dd {
|
142
|
-
margin-bottom: $padding-base-vertical;
|
143
|
-
|
144
|
-
&:after {
|
145
|
-
clear: none;
|
146
|
-
}
|
147
|
-
}
|
148
|
-
}
|
149
|
-
|
150
|
-
.dl-invert {
|
151
|
-
dt {
|
152
|
-
font-weight: normal;
|
153
|
-
color: $field_name_color;
|
154
|
-
}
|
155
|
-
}
|
156
|
-
|
157
|
-
label.toggle_bookmark
|
158
|
-
{
|
159
|
-
font-weight: inherit;
|
160
|
-
min-width: 8.5em;
|
161
|
-
}
|
162
|
-
|
163
|
-
#sidebar-mlt li {
|
164
|
-
padding-bottom: $padding-base-vertical;
|
165
|
-
}
|
166
|
-
|
167
|
-
#sortAndPerPage, .pagination-search-widgets {
|
168
|
-
border-bottom: 1px solid $pagination-border;
|
169
|
-
margin-bottom: 1em;
|
170
|
-
padding-bottom: 1em;
|
171
|
-
}
|
172
|
-
|
173
|
-
.pagination-search-widgets {
|
174
|
-
@extend .clearfix;
|
175
|
-
padding-top: 1px;
|
176
|
-
padding-bottom: $padding-base-vertical;
|
177
|
-
}
|
178
|
-
|
179
|
-
#sortAndPerPage .dropdown-toggle {
|
180
|
-
cursor: pointer;
|
181
|
-
}
|
182
|
-
|
183
|
-
.no-js #sortAndPerPage {
|
184
|
-
& {
|
185
|
-
@extend .clearfix;
|
186
|
-
}
|
187
|
-
.dropdown-menu {
|
188
|
-
background: none;
|
189
|
-
box-shadow: none;
|
190
|
-
border: none;
|
191
|
-
position: relative;
|
192
|
-
display: block;
|
193
|
-
float: none;
|
194
|
-
}
|
195
|
-
|
196
|
-
}
|
197
|
-
|
198
|
-
.document-thumbnail {
|
199
|
-
float: right;
|
200
|
-
padding-left: $line-height-computed;
|
201
|
-
margin-bottom: $line-height-computed;
|
202
|
-
}
|
203
|
-
|
204
|
-
.view-type {
|
205
|
-
display: inline-block;
|
206
|
-
|
207
|
-
.caption {
|
208
|
-
@extend .sr-only;
|
209
|
-
}
|
210
|
-
}
|
211
|
-
|
212
|
-
#sort-dropdown .dropdown-toggle, #per_page-dropdown .dropdown-toggle {
|
213
|
-
color: $link-color;
|
214
|
-
|
215
|
-
.caret {
|
216
|
-
color: $text-color;
|
217
|
-
}
|
218
|
-
}
|
219
|
-
|
220
|
-
|
221
|
-
.search-input-group {
|
222
|
-
width: 80%;
|
223
|
-
}
|
224
|
-
|
225
|
-
@media (max-width: $screen-sm-min) {
|
226
|
-
.search-input-group {
|
227
|
-
width: auto;
|
228
|
-
}
|
229
|
-
}
|
@@ -1,31 +0,0 @@
|
|
1
|
-
module Blacklight
|
2
|
-
module SearchHistory
|
3
|
-
extend ActiveSupport::Concern
|
4
|
-
include Blacklight::Configurable
|
5
|
-
|
6
|
-
included do
|
7
|
-
copy_blacklight_config_from(CatalogController)
|
8
|
-
end
|
9
|
-
|
10
|
-
def index
|
11
|
-
@searches = searches_from_history
|
12
|
-
end
|
13
|
-
|
14
|
-
# TODO: we may want to remove unsaved (those without user_id) items from
|
15
|
-
# the database when removed from history
|
16
|
-
def clear
|
17
|
-
if session[:history].clear
|
18
|
-
flash[:notice] = I18n.t('blacklight.search_history.clear.success')
|
19
|
-
else
|
20
|
-
flash[:error] = I18n.t('blacklight.search_history.clear.failure')
|
21
|
-
end
|
22
|
-
|
23
|
-
if respond_to? :redirect_back
|
24
|
-
redirect_back fallback_location: blacklight.search_history_path
|
25
|
-
else
|
26
|
-
# Deprecated in Rails 5.0
|
27
|
-
redirect_to :back
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
@@ -1,6 +0,0 @@
|
|
1
|
-
<%# this partial is used by blacklight-marc 5.0 %>
|
2
|
-
<%= form_tag refworks_export_url, :name => "refworks", :role => 'form', :target => "_blank", :id => "refworks-form" do %>
|
3
|
-
|
4
|
-
<%= hidden_field_tag "ImportData", render_refworks_texts(documents) %>
|
5
|
-
<%= submit_tag t('blacklight.tools.refworks'), :class => 'submit btn btn-default'%>
|
6
|
-
<% end %>
|
@@ -1,71 +0,0 @@
|
|
1
|
-
require 'deprecation'
|
2
|
-
|
3
|
-
class Blacklight::Configuration
|
4
|
-
class ViewConfig < Blacklight::OpenStructWithHashAccess
|
5
|
-
class Show < ViewConfig
|
6
|
-
extend Deprecation
|
7
|
-
self.deprecation_horizon = 'blacklight 6.0'
|
8
|
-
|
9
|
-
def html_title
|
10
|
-
Deprecation.warn(self.class, "config.show.html_title is deprecated; use config.show.title_field instead")
|
11
|
-
fetch(:html_title, title_field)
|
12
|
-
end
|
13
|
-
|
14
|
-
def heading
|
15
|
-
Deprecation.warn(self.class, "config.show.heading is deprecated; use config.show.title_field instead")
|
16
|
-
fetch(:heading, title_field)
|
17
|
-
end
|
18
|
-
|
19
|
-
def display_type
|
20
|
-
Deprecation.warn(self.class, "config.show.display_type is deprecated; use config.show.display_type_field instead")
|
21
|
-
fetch(:display_type, display_type_field)
|
22
|
-
end
|
23
|
-
|
24
|
-
def html_title= value
|
25
|
-
Deprecation.warn(self.class, "config.show.html_title is deprecated; use config.show.title_field instead")
|
26
|
-
super value
|
27
|
-
self.title_field = value
|
28
|
-
end
|
29
|
-
|
30
|
-
def heading= value
|
31
|
-
Deprecation.warn(self.class, "config.show.heading is deprecated; use config.show.title_field instead")
|
32
|
-
super value
|
33
|
-
self.title_field = value
|
34
|
-
end
|
35
|
-
|
36
|
-
def display_type= value
|
37
|
-
Deprecation.warn(self.class, "config.show.display_type is deprecated; use config.show.display_type_field instead")
|
38
|
-
super value
|
39
|
-
self.display_type_field = value
|
40
|
-
end
|
41
|
-
end
|
42
|
-
|
43
|
-
class Index < ViewConfig
|
44
|
-
extend Deprecation
|
45
|
-
self.deprecation_horizon = 'blacklight 6.0'
|
46
|
-
|
47
|
-
def record_display_type
|
48
|
-
Deprecation.warn(self.class, "config.index.record_display_type is deprecated; use config.index.display_type_field instead")
|
49
|
-
fetch(:record_display_type, display_type_field)
|
50
|
-
end
|
51
|
-
|
52
|
-
def record_display_type= value
|
53
|
-
Deprecation.warn(self.class, "config.index.record_display_type is deprecated; use config.index.display_type_field instead")
|
54
|
-
super value
|
55
|
-
self.display_type_field = value
|
56
|
-
end
|
57
|
-
|
58
|
-
def show_link
|
59
|
-
Deprecation.warn(self.class, "config.index.show_link is deprecated; use config.index.title_field instead")
|
60
|
-
fetch(:show_link, title_field)
|
61
|
-
end
|
62
|
-
|
63
|
-
def show_link= value
|
64
|
-
Deprecation.warn(self.class, "config.index.show_link is deprecated; use config.index.title_field instead")
|
65
|
-
super value
|
66
|
-
self.title_field = value
|
67
|
-
end
|
68
|
-
|
69
|
-
end
|
70
|
-
end
|
71
|
-
end
|
@@ -1,29 +0,0 @@
|
|
1
|
-
module ActionDispatch::Routing
|
2
|
-
class Mapper
|
3
|
-
# example
|
4
|
-
# blacklight_for :catalog
|
5
|
-
# blacklight_for :catalog, :dashboard
|
6
|
-
# blacklight_for :catalog, except: [ :saved_searches ]
|
7
|
-
# blacklight_for :catalog, only: [ :saved_searches, :solr_document ]
|
8
|
-
# blacklight_for :catalog, constraints: {id: /[0-9]+/ }
|
9
|
-
def blacklight_for(*resources)
|
10
|
-
raise_no_blacklight_secret_key unless Blacklight.secret_key
|
11
|
-
options = resources.extract_options!
|
12
|
-
resources.map!(&:to_sym)
|
13
|
-
|
14
|
-
Blacklight::Routes.new(self, options.merge(resources: resources)).draw
|
15
|
-
|
16
|
-
end
|
17
|
-
|
18
|
-
private
|
19
|
-
def raise_no_blacklight_secret_key #:nodoc:
|
20
|
-
raise <<-ERROR
|
21
|
-
Blacklight.secret_key was not set. If you are using Rails 4.1+, set your app's secret key base (config/secrets.yml) OR add the following to an initializer:
|
22
|
-
|
23
|
-
Blacklight.secret_key = '#{SecureRandom.hex(64)}'
|
24
|
-
|
25
|
-
Please ensure you restarted your application after installing Blacklight or setting the key.
|
26
|
-
ERROR
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
@@ -1,9 +0,0 @@
|
|
1
|
-
# A secret token used to encrypt user_id's in the Bookmarks#export callback URL
|
2
|
-
# functionality, for example in Refworks export of Bookmarks. In Rails 4, Blacklight
|
3
|
-
# will use the application's secret key base instead.
|
4
|
-
#
|
5
|
-
<% if Rails::VERSION::MAJOR == 4 %>
|
6
|
-
# Blacklight.secret_key = '<%= SecureRandom.hex(64) %>'
|
7
|
-
<% else %>
|
8
|
-
Blacklight.secret_key = '<%= SecureRandom.hex(64) %>'
|
9
|
-
<% end %>
|
@@ -1,19 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe '#document_action_path' do
|
4
|
-
before do
|
5
|
-
allow(helper).to receive_messages(controller_name: 'catalog')
|
6
|
-
end
|
7
|
-
|
8
|
-
let(:document_action_config) { Blacklight::Configuration::ToolConfig.new(tool_config) }
|
9
|
-
let(:document) { SolrDocument.new(id: '123') }
|
10
|
-
|
11
|
-
subject { helper.document_action_path(document_action_config, id: document) }
|
12
|
-
|
13
|
-
context "for endnote" do
|
14
|
-
let(:tool_config) { { if: :render_refworks_action?, partial: "document_action",
|
15
|
-
name: :endnote, key: :endnote, path: :single_endnote_catalog_path } }
|
16
|
-
|
17
|
-
it { is_expected.to eq '/catalog/123.endnote' }
|
18
|
-
end
|
19
|
-
end
|
@@ -1,25 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
describe Blacklight::Routes do
|
3
|
-
subject { Blacklight::Routes.new(router, options) }
|
4
|
-
let(:router) { double }
|
5
|
-
|
6
|
-
describe "solr_document" do
|
7
|
-
describe "without constraints" do
|
8
|
-
let(:options) { Hash.new }
|
9
|
-
it "should define the resources" do
|
10
|
-
allow(router).to receive(:resources).with(:solr_document, {:path=>:records, :controller=>:records, :only=>[:show]})
|
11
|
-
allow(router).to receive(:resources).with(:records, :only=>[:show])
|
12
|
-
subject.solr_document(:records)
|
13
|
-
end
|
14
|
-
end
|
15
|
-
|
16
|
-
describe "with constraints" do
|
17
|
-
let(:options) { { :constraints => {id: /[a-z]+/, format: false } } }
|
18
|
-
it "should define the resources" do
|
19
|
-
allow(router).to receive(:resources).with(:solr_document, {:path=>:records, :controller=>:records, :only=>[:show], :constraints=>{:id=>/[a-z]+/, :format=>false} })
|
20
|
-
allow(router).to receive(:resources).with(:records, :only=>[:show], :constraints=>{:id=>/[a-z]+/, :format=>false})
|
21
|
-
subject.solr_document(:records)
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
@@ -1,12 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe Blacklight::SolrHelper do
|
4
|
-
it "should raise a deprecation error" do
|
5
|
-
expect(Deprecation).to receive(:warn)
|
6
|
-
class TestClass
|
7
|
-
include Blacklight::SolrHelper
|
8
|
-
end
|
9
|
-
end
|
10
|
-
|
11
|
-
after { Object.send(:remove_const, :TestClass) }
|
12
|
-
end
|