blacklight 4.9.0 → 5.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 -1
- data/.travis.yml +22 -12
- data/Gemfile +3 -40
- data/LICENSE +1 -2
- data/README.md +1 -2
- data/Rakefile +0 -4
- data/VERSION +1 -1
- data/app/assets/images/blacklight/logo.png +0 -0
- data/app/assets/javascripts/blacklight/ajax_modal.js +190 -0
- data/app/assets/javascripts/blacklight/blacklight.js +7 -17
- data/app/assets/javascripts/blacklight/checkbox_submit.js +1 -1
- data/app/assets/stylesheets/blacklight/{_blacklight_base.scss → _blacklight_base.css.scss} +0 -21
- data/app/assets/stylesheets/blacklight/_bookmark.css.scss +4 -0
- data/app/assets/stylesheets/blacklight/_catalog.css.scss +192 -0
- data/app/assets/stylesheets/blacklight/_facets.css.scss +141 -0
- data/app/assets/stylesheets/blacklight/{_group.scss → _group.css.scss} +1 -1
- data/app/assets/stylesheets/blacklight/_header.css.scss +44 -0
- data/app/assets/stylesheets/blacklight/_layout.css.scss +5 -0
- data/app/assets/stylesheets/blacklight/{_modal.scss → _modal.css.scss} +7 -7
- data/app/assets/stylesheets/blacklight/_search_history.css.scss +20 -0
- data/app/assets/stylesheets/blacklight/{blacklight.scss → blacklight.css.scss} +0 -0
- data/app/assets/stylesheets/blacklight/blacklight_defaults.css.scss +14 -0
- data/app/controllers/bookmarks_controller.rb +0 -4
- data/app/controllers/feedback_controller.rb +0 -4
- data/app/helpers/blacklight/blacklight_helper_behavior.rb +45 -155
- data/app/helpers/blacklight/catalog_helper_behavior.rb +8 -41
- data/app/helpers/blacklight/facets_helper_behavior.rb +20 -43
- data/app/helpers/blacklight/hash_as_hidden_fields_helper_behavior.rb +2 -9
- data/app/helpers/blacklight/render_constraints_helper_behavior.rb +9 -14
- data/app/helpers/blacklight/search_history_constraints_helper_behavior.rb +6 -6
- data/app/views/_flash_msg.html.erb +9 -2
- data/app/views/_user_util_links.html.erb +29 -15
- data/app/views/bookmarks/_tools.html.erb +4 -7
- data/app/views/bookmarks/index.html.erb +3 -2
- data/app/views/catalog/_citation.html.erb +1 -1
- data/app/views/catalog/_constraints.html.erb +1 -1
- data/app/views/catalog/_constraints_element.html.erb +12 -8
- data/app/views/catalog/_did_you_mean.html.erb +2 -2
- data/app/views/catalog/_document_header.html.erb +3 -3
- data/app/views/catalog/_email_form.html.erb +10 -10
- data/app/views/catalog/_facet_layout.html.erb +11 -3
- data/app/views/catalog/_facet_limit.html.erb +7 -7
- data/app/views/catalog/_facet_pagination.html.erb +8 -7
- data/app/views/catalog/_facet_pivot.html.erb +3 -1
- data/app/views/catalog/_facets.html.erb +12 -9
- data/app/views/catalog/_paginate_compact.html.erb +1 -7
- data/app/views/catalog/_per_page_widget.html.erb +5 -8
- data/app/views/catalog/_previous_next_doc.html.erb +11 -9
- data/app/views/catalog/_refworks_form.html.erb +3 -4
- data/app/views/catalog/_results_pagination.html.erb +1 -1
- data/app/views/catalog/_search_form.html.erb +16 -14
- data/app/views/catalog/_show_sidebar.html.erb +7 -9
- data/app/views/catalog/_show_tools.html.erb +13 -7
- data/app/views/catalog/_sms_form.html.erb +8 -8
- data/app/views/catalog/_sort_and_per_page.html.erb +4 -6
- data/app/views/catalog/_sort_widget.html.erb +5 -6
- data/app/views/catalog/email.html.erb +1 -1
- data/app/views/catalog/facet.html.erb +2 -8
- data/app/views/catalog/index.html.erb +11 -6
- data/app/views/catalog/show.html.erb +5 -5
- data/app/views/catalog/sms.html.erb +1 -1
- data/app/views/catalog/sms_sent.html.erb +1 -1
- data/app/views/feedback/complete.html.erb +2 -2
- data/app/views/feedback/show.html.erb +1 -1
- data/app/views/kaminari/blacklight/_paginator.html.erb +1 -1
- data/app/views/kaminari/blacklight_compact/_paginator.html.erb +25 -5
- data/app/views/layouts/blacklight.html.erb +23 -23
- data/app/views/saved_searches/index.html.erb +2 -2
- data/app/views/search_history/index.html.erb +5 -7
- data/app/views/shared/_header_navbar.html.erb +23 -23
- data/blacklight.gemspec +10 -13
- data/config/locales/blacklight.en.yml +1 -12
- data/config/locales/blacklight.fr.yml +1 -12
- data/gemfiles/rails3.gemfile +21 -0
- data/gemfiles/rails4.gemfile +20 -0
- data/lib/blacklight.rb +0 -8
- data/lib/blacklight/base.rb +0 -2
- data/lib/blacklight/catalog.rb +6 -32
- data/lib/blacklight/catalog/search_context.rb +8 -48
- data/lib/blacklight/configurable.rb +2 -1
- data/lib/blacklight/configuration.rb +1 -2
- data/lib/blacklight/configuration/facet_field.rb +0 -2
- data/lib/blacklight/engine.rb +3 -3
- data/lib/blacklight/legacy_controller_methods.rb +1 -64
- data/lib/blacklight/rails/routes.rb +17 -0
- data/lib/blacklight/routes.rb +46 -40
- data/lib/blacklight/solr.rb +1 -0
- data/lib/blacklight/solr/document.rb +21 -42
- data/lib/blacklight/solr/facet_paginator.rb +30 -54
- data/lib/blacklight/solr/request.rb +45 -0
- data/lib/blacklight/solr_helper.rb +16 -53
- data/lib/blacklight/solr_response.rb +0 -6
- data/lib/blacklight/user.rb +2 -7
- data/lib/blacklight/utils.rb +1 -9
- data/lib/generators/blacklight/assets_generator.rb +0 -14
- data/lib/generators/blacklight/blacklight_generator.rb +17 -14
- data/lib/generators/blacklight/templates/blacklight.css.scss +3 -0
- data/lib/generators/blacklight/templates/catalog_controller.rb +4 -1
- data/lib/railties/blacklight.rake +3 -1
- data/solr/sample_solr_documents.yml +641 -0
- data/spec/controllers/application_controller_spec.rb +5 -21
- data/spec/controllers/bookmarks_controller_spec.rb +11 -11
- data/spec/controllers/catalog_controller_spec.rb +122 -119
- data/spec/controllers/search_history_controller_spec.rb +8 -8
- data/spec/features/alternate_controller_spec.rb +5 -5
- data/spec/features/facets_spec.rb +9 -0
- data/spec/features/record_view_spec.rb +1 -1
- data/spec/features/search_filters_spec.rb +97 -41
- data/spec/features/search_results_spec.rb +14 -17
- data/spec/features/search_sort_spec.rb +1 -1
- data/spec/helpers/blacklight_helper_spec.rb +170 -285
- data/spec/helpers/catalog_helper_spec.rb +57 -96
- data/spec/helpers/facets_helper_spec.rb +130 -152
- data/spec/helpers/hash_as_hidden_fields_spec.rb +9 -15
- data/spec/helpers/render_constraints_helper_spec.rb +5 -5
- data/spec/helpers/search_history_constraints_helper_spec.rb +21 -21
- data/spec/lib/blacklight/routes_spec.rb +25 -0
- data/spec/lib/blacklight/solr/request_spec.rb +37 -0
- data/spec/lib/blacklight/solr_response/group_response_spec.rb +2 -2
- data/spec/lib/blacklight_configurable_spec.rb +16 -16
- data/spec/lib/blacklight_configuration_spec.rb +132 -132
- data/spec/lib/blacklight_email_spec.rb +4 -4
- data/spec/lib/blacklight_sms_spec.rb +4 -4
- data/spec/lib/blacklight_solr_document_dublin_core_spec.rb +6 -6
- data/spec/lib/blacklight_solr_document_more_like_this_spec.rb +4 -4
- data/spec/lib/blacklight_solr_document_spec.rb +36 -36
- data/spec/lib/blacklight_solr_response_spec.rb +43 -48
- data/spec/lib/blacklight_spec.rb +6 -14
- data/spec/lib/blacklight_user_spec.rb +5 -9
- data/spec/lib/facet_paginator_spec.rb +59 -51
- data/spec/lib/search_fields_spec.rb +13 -13
- data/spec/lib/solr_helper_spec.rb +258 -304
- data/spec/lib/tasks/blacklight_task_spec.rb +1 -1
- data/spec/lib/utils_spec.rb +16 -46
- data/spec/models/bookmark_spec.rb +6 -7
- data/spec/models/record_mailer_spec.rb +16 -16
- data/spec/models/search_spec.rb +8 -8
- data/spec/models/solr_document_spec.rb +6 -77
- data/spec/routing/catalog_routing_spec.rb +16 -10
- data/spec/spec_helper.rb +7 -7
- data/spec/support/assert_difference.rb +2 -2
- data/spec/support/features.rb +0 -11
- data/spec/support/features/session_helpers.rb +3 -3
- data/spec/support/include_text.rb +2 -2
- data/spec/test_app_templates/Gemfile.extra +10 -2
- data/spec/test_app_templates/lib/generators/test_app_generator.rb +12 -18
- data/spec/views/catalog/_constraints_element.html.erb_spec.rb +13 -13
- data/spec/views/catalog/_document.html.erb_spec.rb +1 -1
- data/spec/views/catalog/_document_list.html.erb_spec.rb +1 -1
- data/spec/views/catalog/_facets.html.erb_spec.rb +13 -14
- data/spec/views/catalog/_index_default.erb_spec.rb +21 -21
- data/spec/views/catalog/_search_header.erb_spec.rb +1 -1
- data/spec/views/catalog/_show_default.erb_spec.rb +21 -21
- data/spec/views/catalog/_show_sidebar.erb_spec.rb +7 -7
- data/spec/views/catalog/_thumbnail_default.erb_spec.rb +3 -3
- data/spec/views/catalog/index.atom.builder_spec.rb +29 -29
- data/spec/views/catalog/index.html.erb_spec.rb +6 -7
- data/tasks/blacklight.rake +8 -2
- metadata +84 -180
- data/app/assets/javascripts/blacklight/css_dropdowns.js +0 -10
- data/app/assets/javascripts/blacklight/facet_expand_contract.js +0 -41
- data/app/assets/javascripts/blacklight/lightbox_dialog.js +0 -70
- data/app/assets/javascripts/blacklight/select_submit.js +0 -27
- data/app/assets/javascripts/blacklight/zebra_stripe.js +0 -13
- data/app/assets/javascripts/improved-modal/bootstrap-modal.js +0 -355
- data/app/assets/javascripts/improved-modal/bootstrap-modalmanager.js +0 -370
- data/app/assets/stylesheets/blacklight/_bookmark.scss +0 -33
- data/app/assets/stylesheets/blacklight/_catalog.scss +0 -255
- data/app/assets/stylesheets/blacklight/_dropdown.scss +0 -57
- data/app/assets/stylesheets/blacklight/_facets.scss +0 -197
- data/app/assets/stylesheets/blacklight/_footer.scss +0 -0
- data/app/assets/stylesheets/blacklight/_header.scss +0 -53
- data/app/assets/stylesheets/blacklight/_layout.scss +0 -10
- data/app/assets/stylesheets/blacklight/_mixins.scss +0 -0
- data/app/assets/stylesheets/blacklight/_print.scss +0 -0
- data/app/assets/stylesheets/blacklight/_responsive.scss +0 -3
- data/app/assets/stylesheets/blacklight/_search_history.scss +0 -42
- data/app/assets/stylesheets/blacklight/blacklight_defaults.scss +0 -49
- data/app/assets/stylesheets/blacklight/responsive_partials/_catalog.scss +0 -5
- data/app/assets/stylesheets/blacklight/responsive_partials/_facets.scss +0 -37
- data/app/assets/stylesheets/blacklight/responsive_partials/_header.scss +0 -30
- data/app/assets/stylesheets/improved-modal/bootstrap-modal.css +0 -217
- data/app/helpers/blacklight/html_head_helper_behavior.rb +0 -118
- data/app/helpers/html_head_helper.rb +0 -3
- data/app/views/catalog/_bookmark_form.html.erb +0 -7
- data/app/views/catalog/_marc_view.html.erb +0 -32
- data/app/views/catalog/librarian_view.html.erb +0 -10
- data/config/routes.rb +0 -17
- data/doc/Atom-Responses.md +0 -90
- data/doc/Blacklight-3.0-Release-Notes-And-Upgrade-Guide.md +0 -107
- data/doc/Blacklight-3.2-Release-Notes-and-Upgrade-Guide.md +0 -191
- data/doc/Blacklight-3.3-release-notes-and-upgrade-guide.md +0 -37
- data/doc/Blacklight-3.4-release-notes-and-upgrade-guide.md +0 -27
- data/doc/Blacklight-3.5-release-notes-and-upgrade-guide.md +0 -44
- data/doc/Blacklight-3.6-release-notes-and-upgrade-guide.md +0 -25
- data/doc/Blacklight-3.7-release-notes-and-upgrade-guide.md +0 -80
- data/doc/Blacklight-3.8-release-notes-and-upgrade-guide.md +0 -11
- data/doc/Blacklight-4.0-release-notes-and-upgrade-guide.md +0 -135
- data/doc/Blacklight-4.1-release-notes-and-upgrade-guide.md +0 -17
- data/doc/Blacklight-4.2-release-notes-and-upgrade-guide.md +0 -25
- data/doc/Blacklight-4.3-release-notes-and-upgrade-guide.md +0 -21
- data/doc/Blacklight-4.4-release-notes-and-upgrade-guide.md +0 -41
- data/doc/Blacklight-Add-ons.md +0 -28
- data/doc/Blacklight-configuration.md +0 -411
- data/doc/Blacklight-on-Heroku.md +0 -135
- data/doc/Code4Lib-2014.md +0 -48
- data/doc/Community-principles.md +0 -44
- data/doc/Configuring-and-Customizing-Blacklight.md +0 -271
- data/doc/Configuring-rails-routes.md +0 -13
- data/doc/Contributing-to-Blacklight.md +0 -25
- data/doc/Examples.md +0 -94
- data/doc/Extending-or-Modifying-Blacklight-Search-Behavior.md +0 -141
- data/doc/FAQs.md +0 -1
- data/doc/Home.md +0 -80
- data/doc/How-to-release-a-version.md +0 -29
- data/doc/Indexing-your-data-into-solr.md +0 -32
- data/doc/Integration-with-Rails-Footnotes.md +0 -20
- data/doc/Internationalization.md +0 -32
- data/doc/JSON-API.md +0 -17
- data/doc/Pagination.md +0 -51
- data/doc/Providing-your-own-view-templates.md +0 -109
- data/doc/Quickstart.md +0 -115
- data/doc/README_SOLR.md +0 -245
- data/doc/Release-Notes-And-Upgrade-Guides.md +0 -20
- data/doc/Roadmap.md +0 -43
- data/doc/Sunspot-for-indexing.md +0 -46
- data/doc/Theming.md +0 -64
- data/doc/User-Authentication.md +0 -60
- data/doc/testing.md +0 -57
- data/lib/SolrMarc.jar +0 -0
- data/lib/blacklight/mash.rb +0 -19
- data/lib/blacklight/solr/document/marc.rb +0 -71
- data/lib/blacklight/solr/document/marc_export.rb +0 -590
- data/lib/generators/blacklight/marc_generator.rb +0 -66
- data/lib/generators/blacklight/templates/blacklight.scss +0 -4
- data/lib/generators/blacklight/templates/config/SolrMarc/config-test.properties +0 -37
- data/lib/generators/blacklight/templates/config/SolrMarc/config.properties +0 -37
- data/lib/generators/blacklight/templates/config/SolrMarc/index.properties +0 -97
- data/lib/generators/blacklight/templates/config/SolrMarc/index_scripts/dewey.bsh +0 -47
- data/lib/generators/blacklight/templates/config/SolrMarc/index_scripts/format.bsh +0 -126
- data/lib/generators/blacklight/templates/config/SolrMarc/translation_maps/README_MAPS +0 -1
- data/lib/generators/blacklight/templates/config/SolrMarc/translation_maps/callnumber_map.properties +0 -407
- data/lib/generators/blacklight/templates/config/SolrMarc/translation_maps/composition_era_map.properties +0 -56
- data/lib/generators/blacklight/templates/config/SolrMarc/translation_maps/country_map.properties +0 -379
- data/lib/generators/blacklight/templates/config/SolrMarc/translation_maps/format_map.properties +0 -50
- data/lib/generators/blacklight/templates/config/SolrMarc/translation_maps/instrument_map.properties +0 -101
- data/lib/generators/blacklight/templates/config/SolrMarc/translation_maps/language_map.properties +0 -490
- data/lib/railties/solr_marc.rake +0 -162
- data/spec/data/test_data.utf8.mrc +0 -1
- data/spec/features/librarian_view_spec.rb +0 -13
- data/spec/helpers/html_head_helper_spec.rb +0 -164
- data/spec/lib/blacklight_solr_document_marc_spec.rb +0 -89
- data/spec/lib/marc_export_spec.rb +0 -746
- data/spec/lib/tasks/solr_marc_task_spec.rb +0 -60
- data/spec/requests/alternate_controller_spec.rb +0 -16
- data/spec/routing/routes_spec.rb +0 -20
- data/spec/views/catalog/_constraints.html.erb_spec.rb +0 -33
- data/spec/views/catalog/_paginate_compact.html.erb_spec.rb +0 -49
- data/test_support/data/test_data.utf8.mrc +0 -1
@@ -0,0 +1,141 @@
|
|
1
|
+
#sidebar, #facets {
|
2
|
+
@extend .clearfix;
|
3
|
+
padding-bottom: $padding-large-vertical;
|
4
|
+
}
|
5
|
+
|
6
|
+
.no-js {
|
7
|
+
#sidebar .collapse {
|
8
|
+
@extend .in;
|
9
|
+
}
|
10
|
+
}
|
11
|
+
|
12
|
+
.facet_limit-active {
|
13
|
+
@extend .panel-success;
|
14
|
+
}
|
15
|
+
|
16
|
+
#facet-panel-collapse {
|
17
|
+
@extend .navbar-collapse;
|
18
|
+
padding-left: 0;
|
19
|
+
padding-right: 0;
|
20
|
+
border-top: none;
|
21
|
+
box-shadow: none;
|
22
|
+
max-height: none;
|
23
|
+
}
|
24
|
+
|
25
|
+
.facets-toggle {
|
26
|
+
@extend .navbar-toggle;
|
27
|
+
@extend .btn;
|
28
|
+
@extend .btn-default;
|
29
|
+
|
30
|
+
border-color: $navbar-default-toggle-border-color;
|
31
|
+
|
32
|
+
.icon-bar {
|
33
|
+
background-color: $navbar-default-toggle-icon-bar-bg;
|
34
|
+
}
|
35
|
+
}
|
36
|
+
|
37
|
+
.facet-values {
|
38
|
+
display: table;
|
39
|
+
width: 100%;
|
40
|
+
|
41
|
+
li {
|
42
|
+
|
43
|
+
display: table-row;
|
44
|
+
|
45
|
+
.selected {
|
46
|
+
@extend .text-success;
|
47
|
+
}
|
48
|
+
|
49
|
+
.remove {
|
50
|
+
@extend .text-muted;
|
51
|
+
text-indent: $padding-base-horizontal;
|
52
|
+
}
|
53
|
+
}
|
54
|
+
|
55
|
+
.facet-label {
|
56
|
+
display: table-cell;
|
57
|
+
padding-right: 1em;
|
58
|
+
|
59
|
+
text-indent: -15px;
|
60
|
+
padding-left: 15px;
|
61
|
+
padding-bottom: $padding-base-vertical;
|
62
|
+
}
|
63
|
+
|
64
|
+
.facet-count {
|
65
|
+
display: table-cell;
|
66
|
+
vertical-align: top;
|
67
|
+
text-align: right;
|
68
|
+
}
|
69
|
+
}
|
70
|
+
|
71
|
+
.facet_extended_list
|
72
|
+
{
|
73
|
+
.sort_options
|
74
|
+
{
|
75
|
+
text-align:right;
|
76
|
+
}
|
77
|
+
|
78
|
+
|
79
|
+
.prev_next_links
|
80
|
+
{
|
81
|
+
float:left;
|
82
|
+
}
|
83
|
+
|
84
|
+
}
|
85
|
+
|
86
|
+
ul.facet_extended_list
|
87
|
+
{
|
88
|
+
@extend .list-unstyled;
|
89
|
+
|
90
|
+
}
|
91
|
+
|
92
|
+
.collapse-toggle {
|
93
|
+
cursor: pointer;
|
94
|
+
}
|
95
|
+
|
96
|
+
.panel-heading.collapse-toggle .panel-title:after {
|
97
|
+
/* symbol for "opening" panels */
|
98
|
+
font-family: 'Glyphicons Halflings'; /* essential for enabling glyphicon */
|
99
|
+
content: "\e114"; /* adjust as needed, taken from bootstrap.css */
|
100
|
+
float: right; /* adjust as needed */
|
101
|
+
color: grey; /* adjust as needed */
|
102
|
+
font-size: 0.8em;
|
103
|
+
line-height: normal;
|
104
|
+
}
|
105
|
+
.panel-heading.collapse-toggle.collapsed .panel-title:after {
|
106
|
+
/* symbol for "collapsed" panels */
|
107
|
+
content: "\e080"; /* adjust as needed, taken from bootstrap.css */
|
108
|
+
}
|
109
|
+
|
110
|
+
/* Sidenav
|
111
|
+
-------------------------------------------------- */
|
112
|
+
|
113
|
+
.facet_pagination {
|
114
|
+
@extend .clearfix;
|
115
|
+
}
|
116
|
+
|
117
|
+
|
118
|
+
@media (max-width: $grid-float-breakpoint) {
|
119
|
+
|
120
|
+
.facets-toggle {
|
121
|
+
margin-top: 3px;
|
122
|
+
}
|
123
|
+
|
124
|
+
#facets .top-panel-heading {
|
125
|
+
border: 1px solid #ccc;
|
126
|
+
margin-bottom: 1em;
|
127
|
+
@include border-bottom-radius($panel-border-radius - 1);
|
128
|
+
}
|
129
|
+
}
|
130
|
+
|
131
|
+
/* style for pivot facet's nested list */
|
132
|
+
|
133
|
+
.pivot-facet {
|
134
|
+
@extend .list-unstyled;
|
135
|
+
|
136
|
+
ul, .pivot-facet {
|
137
|
+
@extend .list-unstyled;
|
138
|
+
padding-bottom: $padding-base-vertical;
|
139
|
+
padding-left: $padding-large-horizontal;
|
140
|
+
}
|
141
|
+
}
|
@@ -0,0 +1,44 @@
|
|
1
|
+
/*
|
2
|
+
Header bar at top (Bootstrap nav-bar)
|
3
|
+
*/
|
4
|
+
|
5
|
+
#header-navbar {
|
6
|
+
.navbar-brand { /* The main logo image for the Blacklight instance */
|
7
|
+
width: 150px;
|
8
|
+
background:transparent image_url($logo_image) no-repeat top left;
|
9
|
+
display: inline-block;
|
10
|
+
text-indent: 100%;
|
11
|
+
white-space: nowrap;
|
12
|
+
overflow: hidden;
|
13
|
+
padding-right:0;
|
14
|
+
margin-right:20px;
|
15
|
+
padding-left: 0;
|
16
|
+
}
|
17
|
+
}
|
18
|
+
|
19
|
+
#search-navbar {
|
20
|
+
.search-query-form {
|
21
|
+
@extend .col-md-8;
|
22
|
+
padding-left: 0;
|
23
|
+
}
|
24
|
+
|
25
|
+
.search-query-form {
|
26
|
+
border: 0;
|
27
|
+
}
|
28
|
+
.submit-search-text {
|
29
|
+
// hide 'search' label at very small screens, magnifying glass
|
30
|
+
// icon should still be there.
|
31
|
+
@media screen and (max-width: $screen-xs-min ) {
|
32
|
+
// copied from .sr-only, sadly can't seem to use @extend in a media
|
33
|
+
// query like this, have to copy.
|
34
|
+
position: absolute;
|
35
|
+
width: 1px;
|
36
|
+
height: 1px;
|
37
|
+
margin: -1px;
|
38
|
+
padding: 0;
|
39
|
+
overflow: hidden;
|
40
|
+
clip: rect(0,0,0,0);
|
41
|
+
border: 0;
|
42
|
+
}
|
43
|
+
}
|
44
|
+
}
|
@@ -1,10 +1,9 @@
|
|
1
|
-
.modal-header {
|
2
|
-
h1 {
|
3
|
-
font-size: 24px; line-height: 40px;
|
4
|
-
}
|
5
|
-
}
|
6
|
-
|
7
1
|
#ajax-modal {
|
2
|
+
|
3
|
+
.modal-content {
|
4
|
+
@extend .clearfix;
|
5
|
+
}
|
6
|
+
|
8
7
|
#email_form {
|
9
8
|
width: auto;
|
10
9
|
}
|
@@ -18,10 +17,11 @@
|
|
18
17
|
}
|
19
18
|
|
20
19
|
button.close {
|
21
|
-
|
20
|
+
display: block;
|
22
21
|
}
|
23
22
|
}
|
24
23
|
|
24
|
+
|
25
25
|
button.close {
|
26
26
|
display: none;
|
27
27
|
}
|
@@ -0,0 +1,20 @@
|
|
1
|
+
/* Search History */
|
2
|
+
.search_history
|
3
|
+
{
|
4
|
+
|
5
|
+
.constraint
|
6
|
+
{
|
7
|
+
display: block;
|
8
|
+
text-indent: -$padding-large-horizontal;
|
9
|
+
padding-left: $padding-large-horizontal;
|
10
|
+
|
11
|
+
}
|
12
|
+
|
13
|
+
.filterName, .filterSeparator
|
14
|
+
{
|
15
|
+
@extend .text-muted;
|
16
|
+
}
|
17
|
+
}
|
18
|
+
|
19
|
+
|
20
|
+
|
File without changes
|
@@ -0,0 +1,14 @@
|
|
1
|
+
/* Warning! If you want to change these, just copy them into your own theme css. But you want to remove the !default, which only will set them if not already set. */
|
2
|
+
|
3
|
+
$logo_image: 'blacklight/logo.png' !default;
|
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
|
+
/* label (field names) */
|
11
|
+
$field_name_color: $text-muted !default;
|
12
|
+
|
13
|
+
/* border between items on marc view */
|
14
|
+
$marc_item_separator: 1px solid $text-muted !default;
|
@@ -97,8 +97,4 @@ 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
|
104
100
|
end
|
@@ -1,9 +1,6 @@
|
|
1
1
|
# -*- encoding : utf-8 -*-
|
2
2
|
class FeedbackController < ApplicationController
|
3
3
|
|
4
|
-
extend Deprecation
|
5
|
-
self.deprecation_horizon = 'Blacklight 5.x'
|
6
|
-
|
7
4
|
# http://expressica.com/simple_captcha/
|
8
5
|
# include SimpleCaptcha::ControllerHelpers
|
9
6
|
|
@@ -17,7 +14,6 @@ class FeedbackController < ApplicationController
|
|
17
14
|
end
|
18
15
|
end
|
19
16
|
end
|
20
|
-
deprecation_deprecate :show
|
21
17
|
|
22
18
|
protected
|
23
19
|
|
@@ -4,13 +4,8 @@
|
|
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
|
-
|
8
|
-
extend Deprecation
|
9
|
-
self.deprecation_horizon = 'Blacklight 5.x'
|
10
|
-
|
11
7
|
include HashAsHiddenFieldsHelper
|
12
8
|
include RenderConstraintsHelper
|
13
|
-
include HtmlHeadHelper
|
14
9
|
include FacetsHelper
|
15
10
|
|
16
11
|
|
@@ -62,19 +57,6 @@ module Blacklight::BlacklightHelperBehavior
|
|
62
57
|
extra_body_classes.join " "
|
63
58
|
end
|
64
59
|
|
65
|
-
# collection of items to be rendered in the @sidebar
|
66
|
-
# @deprecated
|
67
|
-
def sidebar_items
|
68
|
-
@sidebar_items ||= []
|
69
|
-
end
|
70
|
-
deprecation_deprecate :sidebar_items
|
71
|
-
|
72
|
-
# collection of items to be rendered in the @topbar
|
73
|
-
def topbar_items
|
74
|
-
@topbar_items ||= []
|
75
|
-
end
|
76
|
-
deprecation_deprecate :topbar_items
|
77
|
-
|
78
60
|
def render_search_bar
|
79
61
|
render :partial=>'catalog/search_form'
|
80
62
|
end
|
@@ -86,7 +68,6 @@ module Blacklight::BlacklightHelperBehavior
|
|
86
68
|
def render_document_list_partial options={}
|
87
69
|
render :partial=>'catalog/document_list'
|
88
70
|
end
|
89
|
-
deprecation_deprecate :render_document_list_partial
|
90
71
|
|
91
72
|
# Save function area for search results 'index' view, normally
|
92
73
|
# renders next to title.
|
@@ -96,7 +77,7 @@ module Blacklight::BlacklightHelperBehavior
|
|
96
77
|
content = []
|
97
78
|
content << render(:partial => 'catalog/bookmark_control', :locals => {:document=> document}.merge(options)) if render_bookmarks_control?
|
98
79
|
|
99
|
-
content_tag("div", content
|
80
|
+
content_tag("div", safe_join(content, "\n".html_safe), :class=> wrapping_class)
|
100
81
|
end
|
101
82
|
|
102
83
|
# Save function area for item detail 'show' view, normally
|
@@ -104,16 +85,12 @@ module Blacklight::BlacklightHelperBehavior
|
|
104
85
|
def render_show_doc_actions(document=@document, options={})
|
105
86
|
# I'm not sure why this key is documentFunctions and #render_index_doc_actions uses wrapping_class.
|
106
87
|
# TODO: remove documentFunctions key in Blacklight 5.x
|
107
|
-
if options.has_key? :documentFunctions
|
108
|
-
Deprecation.warn(Blacklight::BlacklightHelperBehavior, "Calling #render_show_doc_actions with the :documentFunctions option is deprecated; use :wrapping_class instead")
|
109
|
-
end
|
110
|
-
|
111
88
|
wrapping_class = options.delete(:documentFunctions) || options.delete(:wrapping_class) || "documentFunctions"
|
112
89
|
|
113
90
|
content = []
|
114
91
|
content << render(:partial => 'catalog/bookmark_control', :locals => {:document=> document}.merge(options)) if render_bookmarks_control?
|
115
92
|
|
116
|
-
content_tag("div", content
|
93
|
+
content_tag("div", safe_join(content, "\n".html_safe), :class=> wrapping_class)
|
117
94
|
end
|
118
95
|
|
119
96
|
##
|
@@ -127,26 +104,8 @@ module Blacklight::BlacklightHelperBehavior
|
|
127
104
|
(document.has_highlight_field? solr_field.field if solr_field.highlight)
|
128
105
|
end
|
129
106
|
|
130
|
-
|
131
|
-
|
132
|
-
# @deprecated
|
133
|
-
def index_field_names document=nil
|
134
|
-
Deprecation.warn(Blacklight::BlacklightHelperBehavior, "#index_field_names helper is deprecated, and should be replaced by overriding the appropriate partial")
|
135
|
-
index_fields(document).keys
|
136
|
-
end
|
137
|
-
|
138
|
-
##
|
139
|
-
# Labels for the index fields
|
140
|
-
# @deprecated
|
141
|
-
def index_field_labels document=nil
|
142
|
-
# XXX DEPRECATED
|
143
|
-
Deprecation.warn(Blacklight::BlacklightHelperBehavior, "#index_field_labels helper is deprecated, and should be replaced by overriding the appropriate partial")
|
144
|
-
|
145
|
-
Hash[*index_fields(document).map { |key, field| [key, field.label] }.flatten]
|
146
|
-
end
|
147
|
-
|
148
|
-
def should_show_spellcheck_suggestions? response
|
149
|
-
response.total <= spell_check_max and response.spelling.words.size > 0
|
107
|
+
def spell_check_max
|
108
|
+
blacklight_config.spell_max
|
150
109
|
end
|
151
110
|
|
152
111
|
##
|
@@ -167,7 +126,7 @@ module Blacklight::BlacklightHelperBehavior
|
|
167
126
|
document = args.first
|
168
127
|
|
169
128
|
field = options[:field]
|
170
|
-
html_escape
|
129
|
+
html_escape index_fields(document)[field].label
|
171
130
|
end
|
172
131
|
|
173
132
|
##
|
@@ -241,7 +200,6 @@ module Blacklight::BlacklightHelperBehavior
|
|
241
200
|
|
242
201
|
# Used in citation view for displaying the title
|
243
202
|
def citation_title(document)
|
244
|
-
Deprecation.warn(Blacklight::BlacklightHelperBehavior, "#citation_title is deprecated; use #document_heading instead")
|
245
203
|
document[blacklight_config.show.html_title]
|
246
204
|
end
|
247
205
|
|
@@ -265,15 +223,6 @@ module Blacklight::BlacklightHelperBehavior
|
|
265
223
|
blacklight_config.show_fields
|
266
224
|
end
|
267
225
|
|
268
|
-
# used in the catalog/_show/_default partial
|
269
|
-
# @deprecated
|
270
|
-
def document_show_field_labels document=nil
|
271
|
-
# XXX DEPRECATED
|
272
|
-
Deprecation.warn(Blacklight::BlacklightHelperBehavior, "#document_show_field_labels helper is deprecated, and should be replaced by overriding the appropriate partial")
|
273
|
-
|
274
|
-
Hash[*document_show_fields(document).map { |key, field| [key, field.label] }.flatten]
|
275
|
-
end
|
276
|
-
|
277
226
|
##
|
278
227
|
# Render the show field label for a document
|
279
228
|
#
|
@@ -293,7 +242,7 @@ module Blacklight::BlacklightHelperBehavior
|
|
293
242
|
|
294
243
|
field = options[:field]
|
295
244
|
|
296
|
-
html_escape
|
245
|
+
html_escape document_show_fields(document)[field].label
|
297
246
|
end
|
298
247
|
|
299
248
|
##
|
@@ -374,18 +323,14 @@ module Blacklight::BlacklightHelperBehavior
|
|
374
323
|
', '
|
375
324
|
end
|
376
325
|
|
377
|
-
def document_index_view_type
|
378
|
-
if blacklight_config.document_index_view_types.include?
|
379
|
-
|
326
|
+
def document_index_view_type
|
327
|
+
if blacklight_config.document_index_view_types.include? params[:view]
|
328
|
+
params[:view]
|
380
329
|
else
|
381
|
-
|
330
|
+
blacklight_config.document_index_view_types.first
|
382
331
|
end
|
383
332
|
end
|
384
333
|
|
385
|
-
def default_document_index_view_type
|
386
|
-
blacklight_config.document_index_view_types.first
|
387
|
-
end
|
388
|
-
|
389
334
|
def render_document_index documents = nil, locals = {}
|
390
335
|
documents ||= @document_list
|
391
336
|
render_document_index_with_view(document_index_view_type, documents)
|
@@ -457,9 +402,14 @@ module Blacklight::BlacklightHelperBehavior
|
|
457
402
|
|
458
403
|
# Search History and Saved Searches display
|
459
404
|
def link_to_previous_search(params)
|
460
|
-
link_to(render_search_to_s(params), catalog_index_path(params))
|
405
|
+
link_to(raw(render_search_to_s(params)), catalog_index_path(params)).html_safe
|
461
406
|
end
|
462
407
|
|
408
|
+
#
|
409
|
+
# shortcut for built-in Rails helper, "number_with_delimiter"
|
410
|
+
#
|
411
|
+
def format_num(num); number_with_delimiter(num) end
|
412
|
+
|
463
413
|
#
|
464
414
|
# link based helpers ->
|
465
415
|
#
|
@@ -474,17 +424,6 @@ module Blacklight::BlacklightHelperBehavior
|
|
474
424
|
link_to(query, link_url)
|
475
425
|
end
|
476
426
|
|
477
|
-
##
|
478
|
-
# Get the path to the search action with any parameters (e.g. view type)
|
479
|
-
# that should be persisted across search sessions.
|
480
|
-
def start_over_path query_params = params
|
481
|
-
h = { }
|
482
|
-
current_index_view_type = document_index_view_type(query_params)
|
483
|
-
h[:view] = current_index_view_type unless current_index_view_type == default_document_index_view_type
|
484
|
-
|
485
|
-
search_action_url(h)
|
486
|
-
end
|
487
|
-
|
488
427
|
def render_document_index_label doc, opts
|
489
428
|
label = nil
|
490
429
|
label ||= doc.get(opts[:label], :sep => nil) if opts[:label].instance_of? Symbol
|
@@ -508,74 +447,34 @@ module Blacklight::BlacklightHelperBehavior
|
|
508
447
|
{ :'data-counter' => counter, :'data-search_id' => current_search_session.try(:id) }
|
509
448
|
end
|
510
449
|
|
511
|
-
# link_back_to_catalog(:label=>'Back to Search')
|
512
450
|
# Create a link back to the index screen, keeping the user's facet, query and paging choices intact by using session.
|
451
|
+
# @example
|
452
|
+
# link_back_to_catalog(label: 'Back to Search')
|
453
|
+
# link_back_to_catalog(label: 'Back to Search', route_set: my_engine)
|
513
454
|
def link_back_to_catalog(opts={:label=>nil})
|
455
|
+
scope = opts.delete(:route_set) || self
|
514
456
|
query_params = current_search_session.try(:query_params) || {}
|
515
|
-
link_url = url_for(query_params)
|
457
|
+
link_url = scope.url_for(query_params)
|
458
|
+
label = opts.delete(:label)
|
459
|
+
|
516
460
|
if link_url =~ /bookmarks/
|
517
|
-
|
461
|
+
label ||= t('blacklight.back_to_bookmarks')
|
518
462
|
end
|
519
463
|
|
520
|
-
|
521
|
-
|
522
|
-
link_to opts[:label], link_url
|
523
|
-
end
|
524
|
-
|
525
|
-
# @overload params_for_search(source_params, params_to_merge)
|
526
|
-
# Merge the source params with the params_to_merge hash
|
527
|
-
# @param [Hash] Hash
|
528
|
-
# @param [Hash] Hash to merge into above
|
529
|
-
# @overload params_for_search(params_to_merge)
|
530
|
-
# Merge the current search parameters with the
|
531
|
-
# parameters provided.
|
532
|
-
# @param [Hash] Hash to merge into the parameters
|
533
|
-
# @overload params_for_search
|
534
|
-
# Returns the current search parameters after being sanitized by #sanitize_search_params
|
535
|
-
# @overload legacy_method
|
536
|
-
# @params [Hash] Hash of params to merge, may include:
|
537
|
-
# - :omit_keys
|
538
|
-
# - :params
|
539
|
-
# @yield [params] The merged parameters hash before being sanitized
|
540
|
-
def params_for_search(*args, &block)
|
541
|
-
|
542
|
-
omit_keys = []
|
543
|
-
|
544
|
-
source_params, params_to_merge = case args.length
|
545
|
-
when 0
|
546
|
-
[params, {}]
|
547
|
-
when 1
|
548
|
-
options = args.first
|
549
|
-
|
550
|
-
if options.has_key? :omit_keys
|
551
|
-
Deprecation.warn(Blacklight::BlacklightHelperBehavior, "#params_for_search with :omit_keys is deprecated; use params_for_search to generate the hash, and either provide a block or clean up the params after the fact")
|
552
|
-
omit_keys = options.delete(:omit_keys)
|
553
|
-
end
|
554
|
-
|
555
|
-
if options.has_key? :params
|
556
|
-
Deprecation.warn(Blacklight::BlacklightHelperBehavior, "#params_for_search with :params option is deprecated; use the 2-arg form of #params_for_search(params, params_to_merge)")
|
557
|
-
end
|
464
|
+
label ||= t('blacklight.back_to_search')
|
558
465
|
|
559
|
-
|
560
|
-
|
561
|
-
options = args.last
|
466
|
+
link_to label, link_url, opts
|
467
|
+
end
|
562
468
|
|
563
|
-
|
564
|
-
|
565
|
-
|
566
|
-
|
567
|
-
|
568
|
-
[args.first, options]
|
569
|
-
else
|
570
|
-
raise ArgumentError.new "wrong number of arguments (#{args.length} for 0..2)"
|
571
|
-
end
|
469
|
+
def params_for_search(options={})
|
470
|
+
# special keys
|
471
|
+
# params hash to mutate
|
472
|
+
source_params = options.delete(:params) || params
|
473
|
+
omit_keys = options.delete(:omit_keys) || []
|
572
474
|
|
573
475
|
# params hash we'll return
|
574
|
-
my_params = source_params.dup.merge(
|
476
|
+
my_params = source_params.dup.merge(options.dup)
|
575
477
|
|
576
|
-
if block_given?
|
577
|
-
yield my_params
|
578
|
-
end
|
579
478
|
|
580
479
|
# remove items from our params hash that match:
|
581
480
|
# - a key
|
@@ -606,44 +505,39 @@ module Blacklight::BlacklightHelperBehavior
|
|
606
505
|
my_params[:page] = 1
|
607
506
|
end
|
608
507
|
|
609
|
-
|
610
|
-
end
|
611
|
-
|
612
|
-
##
|
613
|
-
# Sanitize the search parameters by removing unnecessary parameters
|
614
|
-
# from the provided parameters
|
615
|
-
# @param [Hash] Hash of parameters
|
616
|
-
def sanitize_search_params source_params
|
617
|
-
|
618
|
-
my_params = source_params.reject { |k,v| v.nil? }
|
508
|
+
my_params.reject! { |k,v| v.nil? }
|
619
509
|
|
620
|
-
|
510
|
+
# removing action, controller, and id from duplicate params so that we don't get hidden fields for them.
|
511
|
+
my_params.delete(:action)
|
512
|
+
my_params.delete(:controller)
|
513
|
+
my_params.delete(:id)
|
514
|
+
# commit is just an artifact of submit button, we don't need it, and
|
515
|
+
# don't want it to pile up with another every time we press submit again!
|
516
|
+
my_params.delete(:commit)
|
621
517
|
|
518
|
+
my_params
|
622
519
|
end
|
623
520
|
|
624
|
-
|
625
521
|
# Create form input type=hidden fields representing the entire search context,
|
626
522
|
# for inclusion in a form meant to change some aspect of it, like
|
627
523
|
# re-sort or change records per page. Can pass in params hash
|
628
524
|
# as :params => hash, otherwise defaults to #params. Can pass
|
629
525
|
# in certain top-level params keys to _omit_, defaults to :page
|
630
526
|
def search_as_hidden_fields(options={})
|
631
|
-
Deprecation.warn(Blacklight::BlacklightHelperBehavior, "#search_as_hidden_fields is deprecated; use render_hash_as_hidden_fields(params_for_search(..)..) instead")
|
632
|
-
|
633
527
|
my_params = params_for_search({:omit_keys => [:page]}.merge(options))
|
634
528
|
|
635
529
|
# hash_as_hidden_fields in hash_as_hidden_fields.rb
|
636
|
-
return
|
530
|
+
return hash_as_hidden_fields(my_params)
|
637
531
|
end
|
638
532
|
|
639
533
|
def link_to_previous_document(previous_document)
|
640
|
-
link_to_unless previous_document.nil?, raw(t('views.pagination.previous')), previous_document, search_session_params(search_session[
|
534
|
+
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
|
641
535
|
content_tag :span, raw(t('views.pagination.previous')), :class => 'previous'
|
642
536
|
end
|
643
537
|
end
|
644
538
|
|
645
539
|
def link_to_next_document(next_document)
|
646
|
-
link_to_unless next_document.nil?, raw(t('views.pagination.next')), next_document, search_session_params(search_session[
|
540
|
+
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
|
647
541
|
content_tag :span, raw(t('views.pagination.next')), :class => 'next'
|
648
542
|
end
|
649
543
|
end
|
@@ -699,8 +593,4 @@ module Blacklight::BlacklightHelperBehavior
|
|
699
593
|
has_user_authentication_provider? and current_or_guest_user.present?
|
700
594
|
end
|
701
595
|
|
702
|
-
def spell_check_max
|
703
|
-
blacklight_config.spell_max
|
704
|
-
end
|
705
|
-
|
706
596
|
end
|