blacklight 3.8.2 → 4.0.0.pre6
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +1 -0
- data/README.md +1 -1
- data/VERSION +1 -1
- data/app/assets/javascripts/blacklight/blacklight.js +12 -1
- data/app/assets/javascripts/blacklight/bootstrap_dropdowns.js +3 -0
- data/app/assets/javascripts/blacklight/checkbox_submit.js +12 -5
- data/app/assets/javascripts/blacklight/core.js +0 -1
- data/app/assets/javascripts/blacklight/css_dropdowns.js +10 -0
- data/app/assets/javascripts/blacklight/facet_expand_contract.js +5 -5
- data/app/assets/javascripts/blacklight/lightbox_dialog.js +68 -13
- data/app/assets/javascripts/blacklight/select_submit.js +19 -10
- data/app/assets/javascripts/improved-modal/bootstrap-modal.js +282 -0
- data/app/assets/javascripts/improved-modal/bootstrap-modalmanager.js +353 -0
- data/app/assets/stylesheets/blacklight/_blacklight_base.css.scss +16 -5
- data/app/assets/stylesheets/blacklight/_bookmark.css.scss +24 -6
- data/app/assets/stylesheets/blacklight/_catalog.css.scss +115 -141
- data/app/assets/stylesheets/blacklight/_dropdown.css.scss +57 -0
- data/app/assets/stylesheets/blacklight/_facets.css.scss +127 -58
- data/app/assets/stylesheets/blacklight/_footer.css.scss +20 -0
- data/app/assets/stylesheets/blacklight/_header.css.scss +90 -21
- data/app/assets/stylesheets/blacklight/_layout.css.scss +10 -9
- data/app/assets/stylesheets/blacklight/_modal.css.scss +23 -0
- data/app/assets/stylesheets/blacklight/_print.css.scss +0 -7
- data/app/assets/stylesheets/blacklight/_responsive.css.scss +3 -0
- data/app/assets/stylesheets/blacklight/_search_history.css.scss +2 -4
- data/app/assets/stylesheets/blacklight/blacklight.css.scss +0 -1
- data/app/assets/stylesheets/blacklight/blacklight_defaults.css.scss +9 -2
- data/app/assets/stylesheets/blacklight/responsive_partials/_catalog.css.scss +5 -0
- data/app/assets/stylesheets/blacklight/responsive_partials/_facets.css.scss +37 -0
- data/app/assets/stylesheets/blacklight/responsive_partials/_header.css.scss +30 -0
- data/app/assets/stylesheets/improved-modal/bootstrap-modal.css +199 -0
- data/app/controllers/bookmarks_controller.rb +16 -10
- data/app/helpers/blacklight/blacklight_helper_behavior.rb +124 -61
- data/app/helpers/blacklight/catalog_helper_behavior.rb +5 -3
- data/app/helpers/blacklight/facets_helper_behavior.rb +9 -9
- data/app/views/_flash_msg.html.erb +9 -4
- data/app/views/_user_util_links.html.erb +23 -17
- data/app/views/bookmarks/_tools.html.erb +7 -7
- data/app/views/bookmarks/index.html.erb +5 -13
- data/app/views/catalog/_bookmark_control.html.erb +2 -4
- data/app/views/catalog/_bookmark_form.html.erb +1 -1
- data/app/views/catalog/_citation.html.erb +21 -20
- data/app/views/catalog/_constraints.html.erb +8 -6
- data/app/views/catalog/_document_header.html.erb +6 -7
- data/app/views/catalog/_document_list.html.erb +1 -7
- data/app/views/catalog/_email_form.html.erb +42 -16
- data/app/views/catalog/_facet_layout.html.erb +1 -1
- data/app/views/catalog/_facet_limit.html.erb +1 -1
- data/app/views/catalog/_facet_pagination.html.erb +11 -14
- data/app/views/catalog/_facets.html.erb +16 -2
- data/app/views/catalog/_home.html.erb +2 -2
- data/app/views/catalog/_home_text.html.erb +5 -2
- data/app/views/catalog/_index_default.html.erb +2 -2
- data/app/views/catalog/_marc_view.html.erb +0 -1
- data/app/views/catalog/_paginate_compact.html.erb +5 -0
- data/app/views/catalog/_per_page_widget.html.erb +13 -7
- data/app/views/catalog/_previous_next_doc.html.erb +14 -4
- data/app/views/catalog/_refworks_form.html.erb +2 -2
- data/app/views/catalog/_results_pagination.html.erb +4 -1
- data/app/views/catalog/_search_form.html.erb +19 -13
- data/app/views/catalog/_show_default.html.erb +2 -2
- data/app/views/catalog/_show_more_like_this.html.erb +3 -0
- data/app/views/catalog/_show_sidebar.html.erb +14 -1
- data/app/views/catalog/_show_tools.html.erb +18 -18
- data/app/views/catalog/_sms_form.html.erb +35 -10
- data/app/views/catalog/_sort_and_per_page.html.erb +5 -3
- data/app/views/catalog/_sort_widget.html.erb +12 -6
- data/app/views/catalog/citation.html.erb +1 -1
- data/app/views/catalog/citation.js.erb +7 -0
- data/app/views/catalog/email.html.erb +5 -0
- data/app/views/catalog/facet.html.erb +28 -21
- data/app/views/catalog/index.html.erb +26 -26
- data/app/views/catalog/librarian_view.html.erb +7 -0
- data/app/views/catalog/show.html.erb +35 -29
- data/app/views/catalog/sms.html.erb +5 -0
- data/app/views/kaminari/blacklight/_first_page.html.erb +2 -2
- data/app/views/kaminari/blacklight/_gap.html.erb +4 -1
- data/app/views/kaminari/blacklight/_last_page.html.erb +2 -2
- data/app/views/kaminari/blacklight/_next_page.html.erb +3 -3
- data/app/views/kaminari/blacklight/_page.html.erb +4 -3
- data/app/views/kaminari/blacklight/_paginator.html.erb +5 -5
- data/app/views/kaminari/blacklight/_prev_page.html.erb +3 -3
- data/app/views/kaminari/blacklight_compact/_next_page.html.erb +9 -0
- data/app/views/kaminari/blacklight_compact/_paginator.html.erb +15 -0
- data/app/views/kaminari/blacklight_compact/_prev_page.html.erb +9 -0
- data/app/views/layouts/blacklight.html.erb +47 -27
- data/app/views/saved_searches/index.html.erb +2 -2
- data/app/views/search_history/index.html.erb +12 -7
- data/app/views/shared/_footer.html.erb +0 -0
- data/app/views/shared/_header_navbar.html.erb +25 -0
- data/blacklight.gemspec +2 -5
- data/config/locales/blacklight.en.yml +23 -15
- data/lib/blacklight.rb +2 -2
- data/lib/blacklight/catalog.rb +36 -14
- data/lib/blacklight/configuration.rb +10 -2
- data/lib/blacklight/mash.rb +151 -0
- data/lib/blacklight/solr/document.rb +73 -11
- data/lib/blacklight/solr/document/extensions.rb +0 -8
- data/lib/blacklight/solr/document/marc_export.rb +7 -2
- data/lib/blacklight/solr/document/more_like_this.rb +5 -0
- data/lib/blacklight/solr_helper.rb +43 -18
- data/lib/blacklight/solr_response.rb +60 -0
- data/lib/blacklight/solr_response/facets.rb +58 -0
- data/lib/blacklight/solr_response/more_like_this.rb +14 -0
- data/lib/blacklight/solr_response/spelling.rb +92 -0
- data/lib/generators/blacklight/assets_generator.rb +1 -14
- data/lib/generators/blacklight/blacklight_generator.rb +22 -21
- data/lib/generators/blacklight/jetty_generator.rb +1 -35
- data/{test_support → lib/generators/blacklight/templates}/alternate_controller.rb +0 -0
- data/lib/generators/blacklight/templates/blacklight.css.scss +4 -0
- data/lib/generators/blacklight/templates/config/SolrMarc/config-test.properties +2 -2
- data/lib/generators/blacklight/templates/config/jetty.yml +6 -0
- data/lib/generators/blacklight/test_support_generator.rb +35 -0
- data/lib/railties/all_tests.rake +5 -23
- data/lib/railties/blacklight_cucumber.rake +2 -11
- data/lib/railties/blacklight_rspec.rake +2 -12
- data/test_support/bin/run-tests.sh +1 -1
- data/test_support/bin/setup-test-app.sh +123 -0
- data/test_support/bin/test.sh +21 -21
- data/test_support/features/bookmarks.feature +9 -3
- data/test_support/features/saved_searches.feature +3 -3
- data/test_support/features/search.feature +3 -3
- data/test_support/features/search_filters.feature +24 -26
- data/test_support/features/search_history.feature +9 -10
- data/test_support/features/search_sort.feature +4 -6
- data/test_support/features/step_definitions/general_steps.rb +0 -4
- data/test_support/features/step_definitions/search_result_steps.rb +2 -1
- data/test_support/features/step_definitions/search_steps.rb +32 -2
- data/test_support/spec/controllers/application_controller_spec.rb +8 -0
- data/test_support/spec/controllers/catalog_controller_spec.rb +3 -18
- data/test_support/spec/helpers/blacklight_helper_spec.rb +116 -20
- data/test_support/spec/helpers/catalog_helper_spec.rb +14 -6
- data/test_support/spec/helpers/facets_helper_spec.rb +1 -1
- data/test_support/spec/lib/blacklight_solr_document_more_like_this_spec.rb +18 -0
- data/test_support/spec/lib/blacklight_solr_document_spec.rb +54 -1
- data/test_support/spec/lib/blacklight_solr_response_spec.rb +153 -0
- data/test_support/spec/lib/facet_paginator_spec.rb +1 -1
- data/test_support/spec/lib/marc_export_spec.rb +14 -6
- data/test_support/spec/lib/solr_helper_spec.rb +22 -6
- data/test_support/spec/models/solr_docment_spec.rb +1 -4
- data/test_support/spec/{features → requests}/alternate_controller_spec.rb +3 -2
- data/test_support/spec/views/catalog/_facets.html.erb_spec.rb +20 -4
- data/test_support/spec/views/catalog/_show_sidebar.erb_spec.rb +25 -0
- metadata +53 -131
- data/app/assets/javascripts/blacklight/more_facets.js +0 -16
- data/app/assets/javascripts/jquery-1.4.2.min.js +0 -154
- data/app/assets/javascripts/jquery-ui-1.8.1.custom.min.js +0 -756
- data/app/assets/javascripts/jquery.uiExt.ajaxyDialog.js +0 -180
- data/app/assets/stylesheets/blacklight/_formatting.css.scss +0 -164
- data/app/assets/stylesheets/blacklight/grids/_susy_grid.css.scss +0 -72
- data/app/assets/stylesheets/jquery/ui-lightness/images/ui-anim_basic_16x16.gif +0 -0
- data/app/assets/stylesheets/jquery/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png +0 -0
- data/app/assets/stylesheets/jquery/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png +0 -0
- data/app/assets/stylesheets/jquery/ui-lightness/images/ui-bg_flat_10_000000_40x100.png +0 -0
- data/app/assets/stylesheets/jquery/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png +0 -0
- data/app/assets/stylesheets/jquery/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png +0 -0
- data/app/assets/stylesheets/jquery/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/app/assets/stylesheets/jquery/ui-lightness/images/ui-bg_gloss-wave_35_558fd0_500x100.png +0 -0
- data/app/assets/stylesheets/jquery/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png +0 -0
- data/app/assets/stylesheets/jquery/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png +0 -0
- data/app/assets/stylesheets/jquery/ui-lightness/images/ui-icons_222222_256x240.png +0 -0
- data/app/assets/stylesheets/jquery/ui-lightness/images/ui-icons_228ef1_256x240.png +0 -0
- data/app/assets/stylesheets/jquery/ui-lightness/images/ui-icons_2e4f81_256x240.png +0 -0
- data/app/assets/stylesheets/jquery/ui-lightness/images/ui-icons_ffd27a_256x240.png +0 -0
- data/app/assets/stylesheets/jquery/ui-lightness/images/ui-icons_ffffff_256x240.png +0 -0
- data/app/assets/stylesheets/jquery/ui-lightness/jquery-ui-1.8.1.custom.css +0 -486
- data/app/models/solr_document.rb +0 -5
- data/app/views/catalog/email.erb +0 -1
- data/app/views/catalog/sms.erb +0 -1
- data/doc/Atom-Responses.md +0 -90
- 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 -78
- data/doc/Blacklight-3.8-release-notes-and-upgrade-guide.md +0 -11
- data/doc/Blacklight-Add-ons.md +0 -28
- data/doc/Blacklight-configuration.md +0 -301
- data/doc/Blacklight-on-Heroku.md +0 -135
- data/doc/Community-principles.md +0 -44
- data/doc/Configuring-and-Customizing-Blacklight.md +0 -271
- data/doc/Contributing-to-Blacklight.md +0 -25
- data/doc/Examples.md +0 -62
- data/doc/Extending-or-Modifying-Blacklight-Search-Behavior.md +0 -141
- data/doc/Home.md +0 -77
- data/doc/How-to-release-a-version.md +0 -37
- data/doc/Indexing-your-data-into-solr.md +0 -5
- data/doc/Integration-with-Rails-Footnotes.md +0 -20
- data/doc/Pagination.md +0 -38
- data/doc/Providing-your-own-view-templates.md +0 -109
- data/doc/Quickstart.md +0 -116
- data/doc/README.md +0 -77
- data/doc/README_SOLR.md +0 -245
- data/doc/Release-Notes-And-Upgrade-Guides.md +0 -14
- data/doc/Sunspot-for-indexing.md +0 -46
- data/doc/User-Authentication.md +0 -60
- data/doc/testing.md +0 -115
- data/lib/generators/blacklight/solr_conf_generator.rb +0 -26
- data/lib/generators/blacklight/templates/assets/standard.css.scss +0 -59
- data/lib/generators/blacklight/templates/config/blacklight_config.rb +0 -3
- data/lib/generators/blacklight/templates/config/compass.rb +0 -2
- data/lib/generators/blacklight/templates/solr_conf/schema.xml +0 -689
- data/lib/generators/blacklight/templates/solr_conf/solrconfig.xml +0 -1846
- data/lib/solrmarc.log.1 +0 -849
- data/test_support/spec/controllers/bookmarks_controller_spec.rb +0 -48
data/doc/Home.md
DELETED
@@ -1,77 +0,0 @@
|
|
1
|
-
#
|
2
|
-
[[https://github.com/projectblacklight/projectblacklight.github.com/raw/master/images/logo.png]]
|
3
|
-
|
4
|
-
## Introduction
|
5
|
-
|
6
|
-
Blacklight is an open source, Ruby on Rails engine/gem that provides a discovery interface for [Apache Solr](http://lucene.apache.org/solr). Blacklight provides a basic user interface with a search box, facet constraints, stable document urls, etc., all of which is customizable via Rails (templating) mechanisms. Blacklight accommodates heterogeneous data, allowing different information displays for different types of objects.
|
7
|
-
|
8
|
-
Some other features include:
|
9
|
-
|
10
|
-
* Stable URLs for search and record pages allow users to bookmark, share, and save search queries for later access
|
11
|
-
* Every Blacklight search provides RSS and Atom Responses of search results
|
12
|
-
* For certain types of solr documents, an OpenURL/Z39.88 COinS object is embedded in each document, which allows plugins like Zotero to easily extract data from the page.
|
13
|
-
* Blacklight supports OpenSearch, a collection of simple formats for the sharing of search results.
|
14
|
-
* Faceted searching
|
15
|
-
* Search queries can be targeted at specific sets of fields
|
16
|
-
* Results sorting
|
17
|
-
* Tools for exporting records to Refworks or Endnote, sending records via Email or SMS, or as a formatted citation.
|
18
|
-
|
19
|
-
A [demo application](http://demo.projectblacklight.org) uses the latest version of Blacklight to display a basic library catalog.
|
20
|
-
|
21
|
-
> NOTE: This wiki provides developer documentation for the latest Blacklight release. For documentation of older releases, see the end of this page.
|
22
|
-
|
23
|
-
## Getting Started
|
24
|
-
* [[Quickstart Guide|Quickstart]]
|
25
|
-
* [[Site Search|http://projectblacklight.org/search.html]]
|
26
|
-
* [[Demo|http://demo.projectblacklight.org]]
|
27
|
-
* [[Example installations|Examples]]
|
28
|
-
* [[Release Notes And Upgrade Guides]]
|
29
|
-
|
30
|
-
|
31
|
-
## Developing your application
|
32
|
-
* [[Blacklight Configuration]]: Search results, facets, query fields
|
33
|
-
* [[Providing your own view templates]]: Overriding the out-of-the-box Blacklight templates the Rails way.
|
34
|
-
* [[User Authentication]]: Connecting Blacklight with an existing Authentication system
|
35
|
-
* [[Extending or Modifying Blacklight Search Behavior]] How to change the way the Blacklight discovery feature works.
|
36
|
-
* [[Internationalization]]: Translating (or simply customizing) the Blacklight copy
|
37
|
-
* [[Common Blacklight Patterns]]
|
38
|
-
* [[Indexing your data into Solr]]
|
39
|
-
* [[Additional Blacklight-specific Solr documentation|README_SOLR]]
|
40
|
-
* [[Blacklight on Heroku]]
|
41
|
-
* [[Pagination]]: Advise on how to customize pagination with Kaminari
|
42
|
-
|
43
|
-
|
44
|
-
## Support
|
45
|
-
Don't be scared to ask a question on the [[Blacklight mailing list|http://groups.google.com/group/blacklight-development]]. We appreciate you checking the documentation first and asking an educated question, but don't beat your head against the wall -- sometimes the existing documentation may be out of date and inaccurate.
|
46
|
-
|
47
|
-
In order to reduce spam, the first time you post your email will be held in a moderation queue, but as soon as your first message is approved your posts won’t be held for moderation any longer.
|
48
|
-
|
49
|
-
Some Blacklight developers aso hang out on our IRC channel, usually during North American office hours. On `chat.freenode.net`, channel `#blacklight`. Stop in and say hi, we're happy to help with questions when we have time. [[http://freenode.net/faq.shtml]].
|
50
|
-
|
51
|
-
* [[Bug Tracker|https://github.com/projectblacklight/blacklight/issues/]]
|
52
|
-
* [[Mailing List|http://groups.google.com/group/blacklight-development]]
|
53
|
-
* [[Jenkins Continuous Integration|http://hudson.projectblacklight.org]]
|
54
|
-
|
55
|
-
## Contributing to Blacklight
|
56
|
-
|
57
|
-
* [[Contributing to Blacklight]]
|
58
|
-
* [[Community Principles]]
|
59
|
-
* [[How to release a version]]
|
60
|
-
* [[Testing]]
|
61
|
-
|
62
|
-
## Releases
|
63
|
-
Blacklight releases are published on the [[Rubygems.org blacklight project|https://rubygems.org/gems/blacklight]].
|
64
|
-
|
65
|
-
For a list of features and bugfixes in Blacklight releases, see the [[Release announcements|Release Notes And Upgrade Guides]] on this wiki.
|
66
|
-
|
67
|
-
### Older Documentation
|
68
|
-
This wiki provides developer documentation for the ```master``` branch of Blacklight, which may include documentation of features not present in every Blacklight version. For documentation of specific Blacklight releases, see also:
|
69
|
-
|
70
|
-
* [[Home]]
|
71
|
-
* [[Blacklight 3.x|https://github.com/projectblacklight/blacklight/tree/release-3.8/doc]]
|
72
|
-
* [[Blacklight 3.0 or 3.1|https://github.com/projectblacklight/blacklight/tree/release-3.1/doc]]
|
73
|
-
* [[Blacklight 2.x|https://github.com/projectblacklight/blacklight/tree/v2.9-frozen/doc]] for all Blacklight 2.x releases; version-specific documentation is also available:
|
74
|
-
* [[Blacklight 2.7|https://github.com/projectblacklight/blacklight/tree/v2.7.0/doc]]
|
75
|
-
* [[Blacklight 2.6|https://github.com/projectblacklight/blacklight/tree/v2.6.0/doc]]
|
76
|
-
* [[Blacklight 2.5|https://github.com/projectblacklight/blacklight/tree/v2.5.0/doc]]
|
77
|
-
* [[Blacklight 2.4|https://github.com/projectblacklight/blacklight/tree/v2.4.2/doc]]
|
@@ -1,37 +0,0 @@
|
|
1
|
-
Before releasing, ensure that you're on the master branch. Run all tests and ensure that they pass. Also check the [[hudson site|http://hudson.projectblacklight.org/hudson/]] to make sure tests are passing.
|
2
|
-
```bash
|
3
|
-
$ ./test_support/bin/test.sh
|
4
|
-
```
|
5
|
-
|
6
|
-
1. Create a release branch, wit the format release-{major}.{minor}
|
7
|
-
```bash
|
8
|
-
$ git checkout -b release-{major}.{minor}
|
9
|
-
# Switched to a new branch 'release-{major}.{minor}'
|
10
|
-
```
|
11
|
-
|
12
|
-
1. Update the version number in ./VERSION
|
13
|
-
```
|
14
|
-
{major}.{minor}.{patch}
|
15
|
-
```
|
16
|
-
|
17
|
-
1. Update the links in the readme files to point at the correct version so we're not linking to the documents in master which may not be correct for the specific tagged release (change "master" to version number)
|
18
|
-
|
19
|
-
1. Fix GitHub issue tracker to know about the release
|
20
|
-
* Create a milestone in GitHub for the NEXT version.
|
21
|
-
* Move any open tickets for released version to the next version.
|
22
|
-
* Mark the milestone as released.
|
23
|
-
|
24
|
-
1. Write an upgrade guide for [[Release Notes And Upgrade Guides]].
|
25
|
-
|
26
|
-
1. Prepare announcement
|
27
|
-
* Include URL to GitHub closed issues for version
|
28
|
-
* Include URL to github commits between tags. github can show all commits between two versions with a URL of this form: [[http://github.com/projectblacklight/blacklight/compare/v2.5.0...v2.6.0]] Replace with previous version and current release version tags.
|
29
|
-
* Include URL to the Github wiki [[Release Notes And Upgrade Guides]].
|
30
|
-
|
31
|
-
1. Release the gem
|
32
|
-
```bash
|
33
|
-
$ rake release
|
34
|
-
```
|
35
|
-
|
36
|
-
1. Announce
|
37
|
-
* Write emails announcing the release to Blacklight Development
|
@@ -1,5 +0,0 @@
|
|
1
|
-
Blacklight uses Solr as its data index. Blacklight is agnostic as to how that Solr index gets populated. Many Blacklight contributors work in university libraries and have to deal with library data in the MARC format. The Blacklight out-of-the-box demo and test suite is geared towards that use case.
|
2
|
-
|
3
|
-
## What’s the relationship between Blacklight and SolrMarc?
|
4
|
-
|
5
|
-
However, one excellent way to index lots of MARC records into Solr quickly is to use SolrMarc. Some of the same people are active in both projects, e.g, Bob Haschart from UVA and Naomi Dushay from Stanford University. SolrMarc is not a Blacklight-specific project, it is also used by VuFind and other projects, and is a separate project that exists in its own right.
|
@@ -1,20 +0,0 @@
|
|
1
|
-
[[Rails Footnotes|https://github.com/josevalim/rails-footnotes]] is a helpful plugin that displays footnotes in your application for easy debugging, such as sessions, request parameters, cookies, filter chain, routes, queries, etc. Installing Rails Footnotes is very easy, just add this to your Gemfile:
|
2
|
-
```ruby
|
3
|
-
gem 'rails-footnotes', '>= 3.7', :group => :development
|
4
|
-
```
|
5
|
-
|
6
|
-
And add something like this to config/initializers/footnotes.rb to run the Footnotes plugin:
|
7
|
-
```ruby
|
8
|
-
if defined?(Footnotes) && Rails.env.development?
|
9
|
-
Footnotes.run!
|
10
|
-
end
|
11
|
-
```
|
12
|
-
|
13
|
-
To add RSolr debugging information to the footnotes panel, you can use the [[RSolr Footnotes|https://github.com/cbeer/rsolr-footnotes]] gem by adding this to your Gemfile:
|
14
|
-
```ruby
|
15
|
-
gem "rsolr-footnotes", :group => :development
|
16
|
-
```
|
17
|
-
|
18
|
-
RSolr footnotes will capture every solr request with basic performance information and provide a link back to the Solr request URL.
|
19
|
-
|
20
|
-
[[https://github.com/projectblacklight/projectblacklight.github.com/raw/master/images/rsolr_footnotes_example.png|frame|alt=Example of RSolr Footnotes in the Blacklight Demo App]]
|
data/doc/Pagination.md
DELETED
@@ -1,38 +0,0 @@
|
|
1
|
-
Blacklight uses [kaminari](https://github.com/amatsuda/kaminari) for providing pagination of Solr responses.
|
2
|
-
|
3
|
-
One motivation for this is so a pagination view theme can be provided that you can use for your custom code with ordinary ActiveRecord or anything else kaminari can handle, to have consistency between the rest of your app's pagination and Blacklight's Solr response pagination.
|
4
|
-
|
5
|
-
## How it works
|
6
|
-
|
7
|
-
The Blacklight #paginate_params helper method takes an RSolr::Response, and converts it to something Kaminari #paginate can handle. (Basically just by translating some attribute names). So you could call:
|
8
|
-
|
9
|
-
paginate( paginate_params(@response) ) # where @response is an RSolr::Response
|
10
|
-
|
11
|
-
But there's a shortcut Blacklight helper method which compacts this, #paginate_rsolr_response:
|
12
|
-
|
13
|
-
paginate_solr_response @response, :theme => 'blacklight'
|
14
|
-
|
15
|
-
The `theme => 'blacklight'` part will be passed through kaminari, and tell kaminari to use the theme that the Blacklight plugin supplies at [app/views/kaminari/blacklight](https://github.com/projectblacklight/blacklight/tree/master/app/views/kaminari/blacklight)
|
16
|
-
|
17
|
-
Any other arguments of ordinary kaminari paginate can also be passed in there. If all client code uses #paginate_solr_response, it also provides a 'hook' for local apps to completely over-ride pagination rendering, perhaps not even using kaminari.
|
18
|
-
|
19
|
-
Additionally, we sometimes want to output a "Showing X through Y of N" message, which kaminari doesnt' have a way to do by default, so we just provide our own way in a Blacklight view helper method, which takes a RSolr::Response too:
|
20
|
-
|
21
|
-
render_pagination_info(@response)
|
22
|
-
|
23
|
-
## Changing the kaminari theme
|
24
|
-
|
25
|
-
If you want to change how pagination links are rendered, the easiest/cleanest thing to do is to over-ride the 'blacklight' theme that the Blacklight plugin defines. Copy the view templates in Blacklight source at app/views/kaminari/blacklight to your own local app/views/kaminari/blacklight. You actually only need to copy files you'll want to modify, templates not overridden with a local copy will still be found by kaminari from the Blacklight gem. You can use any techniques available for creating a kaminari theme when editing these files, including over-riding more kaminari view templates if available. See the kaminari documentation.
|
26
|
-
|
27
|
-
There are other ways you could change how Blacklight pagination renders, but by doing it this way, any code (in core Blacklight or additional plugins you install) that tries to render pagination using kaminari with 'blacklight' theme will get your locally defined theme.
|
28
|
-
|
29
|
-
The "pagination info" (showing X through Y of N) is not part of the kaminari theme, but just a blacklight view helper method, #render_pagination_info. To change this, just over-ride this method [[over-ride locally|CUSTOMIZING]] like any other Blacklight view helper method.
|
30
|
-
|
31
|
-
## Using kaminari theme for your own pagination
|
32
|
-
|
33
|
-
Your local app may show pagination of ActiveRecord objects, that you'd like to appear consistent with other Blacklight pagination. Just use kaminari to show the pagination HTML, with the theme :blacklight. This technique can be used for anything kaminari can paginate, such as Mongoid et al, in addition to ActiveRecord. Fetch the ActiveRecords using ordinary kaminari techniques (see kaminari docs) and then:
|
34
|
-
|
35
|
-
paginate @my_active_records, :theme => 'blacklight'
|
36
|
-
|
37
|
-
That's it. There's currently no great way to display the #render_pagination_info for anything but RSolr::Response.
|
38
|
-
|
@@ -1,109 +0,0 @@
|
|
1
|
-
> TODO: Validate this page for Blacklight 4.x!
|
2
|
-
|
3
|
-
# Customizing the User Interface
|
4
|
-
## Layouts
|
5
|
-
|
6
|
-
The built-in Blacklight controllers all by default use a Rails view layout called "blacklight", that lives in the Blacklight source. This ends up being a bit confusing, but is the best way we have at present to have out of the box default using a layout with full functionality, without stepping on a possibly existing local 'application' layout.
|
7
|
-
|
8
|
-
To change what layout the Blacklight controllers use, simply implement a method #layout_name in your local application_controller.rb that returns the name of the layout you'd like them to use.
|
9
|
-
|
10
|
-
```ruby
|
11
|
-
# [from app/controllers/application_controller.rb]
|
12
|
-
class ApplicationController < ActionController::Base
|
13
|
-
...
|
14
|
-
def layout_name
|
15
|
-
"application"
|
16
|
-
end
|
17
|
-
...
|
18
|
-
end
|
19
|
-
```
|
20
|
-
|
21
|
-
When implementing your own layout instead of using the stock one, you may want to look at the Blacklight app/views/layouts/blacklight.html.erb file to see what helper methods are called there, to maintain full Blacklight functionality you may want to call these same helper methods.
|
22
|
-
|
23
|
-
* `render_head_content` renders content within the
|
24
|
-
html `<head>` tag, which includes document-specific alternative
|
25
|
-
formats as well as tags generated by plugins, etc.
|
26
|
-
* `sidebar_items` renders features including sidebar content, e.g. facet
|
27
|
-
lists.
|
28
|
-
* flash messages
|
29
|
-
* user util links
|
30
|
-
|
31
|
-
## Overriding Views (templates and partials)
|
32
|
-
As a Rails Engine, you can easily override views in your app. You can see what views and partials are provided by looking in `[[./app/views|https://github.com/projectblacklight/blacklight/tree/master/app/views]]` inside the Blacklight source.
|
33
|
-
|
34
|
-
Once you find the view you'd like to change, you should create a file with the same name and relative path in your own application (e.g. if you wanted to override [[./app/views/catalog/_show_partials/_default.html.erb|https://github.com/projectblacklight/blacklight/blob/master/app/views/catalog/_show_partials/_default.html.erb]] you would create ./app/views/catalog/_show_partials/_default.html.erb in your local application. Frequently, you will start by copying the existing Blacklight view and modifying it from there.
|
35
|
-
|
36
|
-
It is generally recommended that you override as little as possible, in order to maximize your forward compatibility. Look to override either a small, focused partial template, or a helper method of partial template called from a larger template, so your application's version can call out to those same helpers or partial templates within blacklight core code.
|
37
|
-
|
38
|
-
## Overriding the CatalogController
|
39
|
-
Overriding the Blacklight `CatalogController` implementation is easy, and the skeleton of the `CatalogController` is generated into your application for you when you install Blacklight.
|
40
|
-
|
41
|
-
See the [[Extending or Modifying Blacklight Search Behavior]] for tips and approaches to customizing the catalog.
|
42
|
-
|
43
|
-
## Overriding Other Controllers
|
44
|
-
|
45
|
-
1. Find the controller you're interested in blacklight's app/controllers/ .
|
46
|
-
2. Create a file with the same name in your local app/controllers.
|
47
|
-
3. This file requires the original class, and then re-opens it to add more methods.
|
48
|
-
|
49
|
-
```ruby
|
50
|
-
require "#{Blacklight.controllers_dir}/some_controller"
|
51
|
-
|
52
|
-
class SomeController < ApplicationController
|
53
|
-
# custom code goes here
|
54
|
-
end
|
55
|
-
```
|
56
|
-
|
57
|
-
In that "custom code goes here", you can redefine certain methods (action methods or otherwise) to do something different. You can also add new methods (again action methods or otherwise), etc.
|
58
|
-
|
59
|
-
It's kind of hard to call 'super' to call original functionality:
|
60
|
-
|
61
|
-
* the ruby language features here make 'super' unavailable, although you can work around that confusingly with the rails #alias_method_chain method.
|
62
|
-
* but more importantly, action methods in particular don't really suit themselves to being over-ridden and called by super, because the original implementation often does something you'd want to change but there's no easy way to 'undo' -- calling 'render', which can only be called once.
|
63
|
-
|
64
|
-
So basically, if you find yourself wanting to access some functionaltiy in the original implementation of a method that you also want to over-ride -- the best solution is probably to refactor Blacklight core code to put that functionality in a subsidiary method, so you can over-ride the action method entirely but call that logic from core. Action methods should be short and sweet anyway.
|
65
|
-
|
66
|
-
|
67
|
-
## Custom View Helpers
|
68
|
-
|
69
|
-
(This is accurate for Blacklight 3.1.1 and subsequent. Before that, things were messier).
|
70
|
-
|
71
|
-
One of the most common things you might need to do is create a view helper -- especially to override some Blacklight behavior implemented in it's own view helpers. The first step is looking at Blacklight source to determine what view helper method you want to override.
|
72
|
-
|
73
|
-
Blacklight comes packaged with several view helper modules. There is a BlacklightHelper in (blacklight source) app/helpers/blacklight_helper.rb , and several others that correspond to specific controller. (Note, depending on version of Rails and configuration, all helpers may get loaded for every request, even ones that are named to correspond only to a particular other controller).
|
74
|
-
|
75
|
-
If you simply created a local helper with the same name as a helper in Blacklight, that will end up preventing the Blacklight helper from being loaded at all though, which is not what you want to do to override.
|
76
|
-
|
77
|
-
We've structured each Blacklight view helper module into two parts to make it easy to selectively over-ride methods. For instance, here's Blacklight's app/helpers/blacklight_helper.rb:
|
78
|
-
|
79
|
-
```ruby
|
80
|
-
module BlacklightHelper
|
81
|
-
include Blacklight::BlacklightHelperBehavior
|
82
|
-
end
|
83
|
-
```
|
84
|
-
|
85
|
-
Now, the actual methods will be found in app/helpers/blacklight/blacklight_helper_behavior.rb instead.
|
86
|
-
|
87
|
-
If you want to over-ride a helper method, copy the wrapper blacklight_helper into your local app, with the 'include' line, and now you can individually over-ride methods from BlacklightHelperBehavior, and the other methods you don't over-ride will still have their default implementation.
|
88
|
-
|
89
|
-
YOUR `app/helpers/blacklight_helper.rb`
|
90
|
-
|
91
|
-
```ruby
|
92
|
-
module BlacklightHelper
|
93
|
-
include Blacklight::BlacklightHelperBehavior
|
94
|
-
|
95
|
-
def application_name
|
96
|
-
"Bestest University Search"
|
97
|
-
end
|
98
|
-
end
|
99
|
-
```
|
100
|
-
|
101
|
-
One helper you might want to over-ride for customization is #render_document_partial (currently defined in [[blacklight_helper|https://github.com/projectblacklight/blacklight/blob/master/app/helpers/blacklight_helper.rb]]), which you can over-ride to choose differnet local partial views to display a document on search results or detail page, possibly varying depending on type of document according to your own local logic.
|
102
|
-
|
103
|
-
## Adding in your own CSS or Javascript
|
104
|
-
|
105
|
-
Within your local application, you can use the [[Rails Asset Pipeline|http://guides.rubyonrails.org/asset_pipeline.html]] to manipulate javascript and css documents.
|
106
|
-
|
107
|
-
**todo??** better instructions for over-riding BL's built in CSS using SASS? (jrochkind thought jamesws wrote such already, but can't find them now)
|
108
|
-
|
109
|
-
The Blacklight generator added a file to your app at `./app/assets/stylesheets/blacklight_themes/standard.css.scss`, elements of the BL default theme can be customized or over-ridden there. If there's something you want to do but aren't sur e the best way, feel free to ask on the listserv.
|
data/doc/Quickstart.md
DELETED
@@ -1,116 +0,0 @@
|
|
1
|
-
Blacklight is a Ruby on Rails Engine plugin, meaning it provides a small application that runs inside an existing Ruby on Rails project. For notes on upgrading Blacklight, check out our [[Release Notes And Upgrade Guides]] index.
|
2
|
-
|
3
|
-
## Pre-requisites
|
4
|
-
* Ruby 1.9 or higher (consider using [[RVM|https://rvm.beginrescueend.com/rvm/install/]] or [[RBEnv|http://rbenv.org/]] to manage your Ruby version).
|
5
|
-
* Java 1.5 or higher (in order to run solr under a java servlet container)
|
6
|
-
* **For Windows users**: You may want to use [RailsInstaller](http://railsinstaller.org/) to get a Ruby on Rails environment.
|
7
|
-
|
8
|
-
> NOTE: We run our continuous integration tests against Ruby 1.9.3, Ruby 1.8.7, JRuby and REE using the latest release of Rails, although we highly recommend using Ruby 1.9 and Rails 3.2.
|
9
|
-
|
10
|
-
In addition, you should have the Bundler and Rails ruby gems installed:
|
11
|
-
|
12
|
-
```bash
|
13
|
-
$ gem install bundler
|
14
|
-
$ gem install rails
|
15
|
-
```
|
16
|
-
|
17
|
-
## Install and Use
|
18
|
-
|
19
|
-
1. Create a new rails 3 application
|
20
|
-
|
21
|
-
```bash
|
22
|
-
$ rails new my_app
|
23
|
-
# create
|
24
|
-
# create README
|
25
|
-
# create Rakefile
|
26
|
-
# create config.ru
|
27
|
-
# create .gitignore
|
28
|
-
# create Gemfile
|
29
|
-
# [...]
|
30
|
-
|
31
|
-
$ cd my_app
|
32
|
-
```
|
33
|
-
|
34
|
-
Rails automatically created an `public/index.html` file. However, Blacklight will provide a default `root` route for your application, so you probably want to remove it:
|
35
|
-
|
36
|
-
```bash
|
37
|
-
$ rm public/index.html
|
38
|
-
```
|
39
|
-
|
40
|
-
2. Append this line to your application's `Gemfile`
|
41
|
-
|
42
|
-
```ruby
|
43
|
-
gem 'blacklight'
|
44
|
-
```
|
45
|
-
|
46
|
-
Especially if you are running on Linux, you may have to add `gem 'therubyracer'` to your gemfile, to get a Javascript runtime needed by the asset pipeline.
|
47
|
-
|
48
|
-
then, update the bundle
|
49
|
-
|
50
|
-
```bash
|
51
|
-
$ bundle install
|
52
|
-
```
|
53
|
-
|
54
|
-
3. Install blacklight using Devise for user authentication:
|
55
|
-
|
56
|
-
```bash
|
57
|
-
$ gem install devise
|
58
|
-
$ rails generate blacklight --devise
|
59
|
-
```
|
60
|
-
If you would prefer to integrate with an alternative user authentication provider, see the [[User Authentication]] documentation. You can also install with no support for logged in users simply by omitting the devise install, and generating blacklight with `rails generate blacklight` (no --devise argument).
|
61
|
-
|
62
|
-
4. Run your database migrations to create Blacklight's database tables:
|
63
|
-
|
64
|
-
```bash
|
65
|
-
$ rake db:migrate
|
66
|
-
```
|
67
|
-
|
68
|
-
5. You will need to install and configure Solr. You can install
|
69
|
-
Blacklight's example Solr configuration (using the jetty servlet container) that is configured to work with
|
70
|
-
the Blacklight defaults:
|
71
|
-
|
72
|
-
```bash
|
73
|
-
$ rails generate blacklight:jetty
|
74
|
-
```
|
75
|
-
|
76
|
-
Alternatively, you can also install your own copy of Solr or point Blacklight at an existing Solr server ( referred to in your `config/solr.yml`). The Blacklight
|
77
|
-
configuration must match your Solr configuration. In addition, Blacklight has minor expectations about the Solr configuration and schemas. You can generate the Blacklight demonstration solrconfig and schema files using:
|
78
|
-
|
79
|
-
```bash
|
80
|
-
$ rails generate blacklight:solr_conf path/to/output/directory/
|
81
|
-
```
|
82
|
-
|
83
|
-
**For Windows Users: ** This step will only work on *nix platforms. You can manually download and extract a tagged version of [blacklight-jetty](https://github.com/projectblacklight/blacklight-jetty/tags). After extracting the file, you need to update the `config/solr.yml` file to add a `jetty_path` key to your test environment, e.g.:
|
84
|
-
|
85
|
-
```yaml
|
86
|
-
test: &test
|
87
|
-
url: http://localhost:8983/solr
|
88
|
-
jetty_path: C:\path\to\jetty
|
89
|
-
```
|
90
|
-
|
91
|
-
|
92
|
-
6. Make sure your Solr server is running. If you installed the Blacklight demo Solr/Jetty package, you can start the Jetty/Solr server using:
|
93
|
-
|
94
|
-
```bash
|
95
|
-
$ java -jar jetty/start.jar &
|
96
|
-
```
|
97
|
-
|
98
|
-
6. Index some data. You can index test MARC records provided Blacklight running:
|
99
|
-
|
100
|
-
```bash
|
101
|
-
$ rake solr:marc:index_test_data
|
102
|
-
```
|
103
|
-
|
104
|
-
7. Start up your application
|
105
|
-
|
106
|
-
```bash
|
107
|
-
$ rails server
|
108
|
-
```
|
109
|
-
|
110
|
-
Visit the catalog at [[http://localhost:3000/catalog]]. You should see the Blacklight interface with 30 MARC records for testing. Additional MARC records are available from the [[blacklight-data|https://github.com/projectblacklight/blacklight-data]] repository. These can be ingested into Solr using SolrMarc,
|
111
|
-
|
112
|
-
```bash
|
113
|
-
$ rake solr:marc:index MARC_FILE=(path to file)
|
114
|
-
```
|
115
|
-
|
116
|
-
See [[Configuring and Customizing Blacklight]] for information about how to customize the Blacklight user interface, search experience, and more.
|
data/doc/README.md
DELETED
@@ -1,77 +0,0 @@
|
|
1
|
-
#
|
2
|
-
[[https://github.com/projectblacklight/projectblacklight.github.com/raw/master/images/logo.png]]
|
3
|
-
|
4
|
-
## Introduction
|
5
|
-
|
6
|
-
Blacklight is an open source, Ruby on Rails engine/gem that provides a discovery interface for [Apache Solr](http://lucene.apache.org/solr). Blacklight provides a basic user interface with a search box, facet constraints, stable document urls, etc., all of which is customizable via Rails (templating) mechanisms. Blacklight accommodates heterogeneous data, allowing different information displays for different types of objects.
|
7
|
-
|
8
|
-
Some other features include:
|
9
|
-
|
10
|
-
* Stable URLs for search and record pages allow users to bookmark, share, and save search queries for later access
|
11
|
-
* Every Blacklight search provides RSS and Atom Responses of search results
|
12
|
-
* For certain types of solr documents, an OpenURL/Z39.88 COinS object is embedded in each document, which allows plugins like Zotero to easily extract data from the page.
|
13
|
-
* Blacklight supports OpenSearch, a collection of simple formats for the sharing of search results.
|
14
|
-
* Faceted searching
|
15
|
-
* Search queries can be targeted at specific sets of fields
|
16
|
-
* Results sorting
|
17
|
-
* Tools for exporting records to Refworks or Endnote, sending records via Email or SMS, or as a formatted citation.
|
18
|
-
|
19
|
-
A [demo application](http://demo.projectblacklight.org) uses the latest version of Blacklight to display a basic library catalog.
|
20
|
-
|
21
|
-
> NOTE: This wiki provides developer documentation for the latest Blacklight release. For documentation of older releases, see the end of this page.
|
22
|
-
|
23
|
-
## Getting Started
|
24
|
-
* [[Quickstart Guide|Quickstart]]
|
25
|
-
* [[Site Search|http://projectblacklight.org/search.html]]
|
26
|
-
* [[Demo|http://demo.projectblacklight.org]]
|
27
|
-
* [[Example installations|Examples]]
|
28
|
-
* [[Release Notes And Upgrade Guides]]
|
29
|
-
|
30
|
-
|
31
|
-
## Developing your application
|
32
|
-
* [[Blacklight Configuration]]: Search results, facets, query fields
|
33
|
-
* [[Providing your own view templates]]: Overriding the out-of-the-box Blacklight templates the Rails way.
|
34
|
-
* [[User Authentication]]: Connecting Blacklight with an existing Authentication system
|
35
|
-
* [[Extending or Modifying Blacklight Search Behavior]] How to change the way the Blacklight discovery feature works.
|
36
|
-
* [[Internationalization]]: Translating (or simply customizing) the Blacklight copy
|
37
|
-
* [[Common Blacklight Patterns]]
|
38
|
-
* [[Indexing your data into Solr]]
|
39
|
-
* [[Additional Blacklight-specific Solr documentation|README_SOLR]]
|
40
|
-
* [[Blacklight on Heroku]]
|
41
|
-
* [[Pagination]]: Advise on how to customize pagination with Kaminari
|
42
|
-
|
43
|
-
|
44
|
-
## Support
|
45
|
-
Don't be scared to ask a question on the [[Blacklight mailing list|http://groups.google.com/group/blacklight-development]]. We appreciate you checking the documentation first and asking an educated question, but don't beat your head against the wall -- sometimes the existing documentation may be out of date and inaccurate.
|
46
|
-
|
47
|
-
In order to reduce spam, the first time you post your email will be held in a moderation queue, but as soon as your first message is approved your posts won’t be held for moderation any longer.
|
48
|
-
|
49
|
-
Some Blacklight developers aso hang out on our IRC channel, usually during North American office hours. On `chat.freenode.net`, channel `#blacklight`. Stop in and say hi, we're happy to help with questions when we have time. [[http://freenode.net/faq.shtml]].
|
50
|
-
|
51
|
-
* [[Bug Tracker|https://github.com/projectblacklight/blacklight/issues/]]
|
52
|
-
* [[Mailing List|http://groups.google.com/group/blacklight-development]]
|
53
|
-
* [[Jenkins Continuous Integration|http://hudson.projectblacklight.org]]
|
54
|
-
|
55
|
-
## Contributing to Blacklight
|
56
|
-
|
57
|
-
* [[Contributing to Blacklight]]
|
58
|
-
* [[Community Principles]]
|
59
|
-
* [[How to release a version]]
|
60
|
-
* [[Testing]]
|
61
|
-
|
62
|
-
## Releases
|
63
|
-
Blacklight releases are published on the [[Rubygems.org blacklight project|https://rubygems.org/gems/blacklight]].
|
64
|
-
|
65
|
-
For a list of features and bugfixes in Blacklight releases, see the [[Release announcements|Release Notes And Upgrade Guides]] on this wiki.
|
66
|
-
|
67
|
-
### Older Documentation
|
68
|
-
This wiki provides developer documentation for the ```master``` branch of Blacklight, which may include documentation of features not present in every Blacklight version. For documentation of specific Blacklight releases, see also:
|
69
|
-
|
70
|
-
* [[Home]]
|
71
|
-
* [[Blacklight 3.x|https://github.com/projectblacklight/blacklight/tree/release-3.8/doc]]
|
72
|
-
* [[Blacklight 3.0 or 3.1|https://github.com/projectblacklight/blacklight/tree/release-3.1/doc]]
|
73
|
-
* [[Blacklight 2.x|https://github.com/projectblacklight/blacklight/tree/v2.9-frozen/doc]] for all Blacklight 2.x releases; version-specific documentation is also available:
|
74
|
-
* [[Blacklight 2.7|https://github.com/projectblacklight/blacklight/tree/v2.7.0/doc]]
|
75
|
-
* [[Blacklight 2.6|https://github.com/projectblacklight/blacklight/tree/v2.6.0/doc]]
|
76
|
-
* [[Blacklight 2.5|https://github.com/projectblacklight/blacklight/tree/v2.5.0/doc]]
|
77
|
-
* [[Blacklight 2.4|https://github.com/projectblacklight/blacklight/tree/v2.4.2/doc]]
|