umlaut 3.0.5 → 3.1.0.pre1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/README.md +48 -5
- data/app/assets/images/umlaut_icons.png +0 -0
- data/app/assets/images/umlaut_icons/famfamfam-book-go.png +0 -0
- data/app/assets/images/{famfamfam/book_open.png → umlaut_icons/famfamfam-book-open.png} +0 -0
- data/app/assets/images/umlaut_icons/famfamfam-book.png +0 -0
- data/app/assets/images/{famfamfam/cross.png → umlaut_icons/famfamfam-cross.png} +0 -0
- data/app/assets/images/umlaut_icons/famfamfam-error.png +0 -0
- data/app/assets/images/umlaut_icons/famfamfam-help.png +0 -0
- data/app/assets/images/umlaut_icons/famfamfam-information.png +0 -0
- data/app/assets/images/umlaut_icons/famfamfam-link.png +0 -0
- data/app/assets/images/umlaut_icons/famfamfam-page-sound.png +0 -0
- data/app/assets/images/umlaut_icons/famfamfam-page-text.png +0 -0
- data/app/assets/images/umlaut_icons/famfamfam-page-up.png +0 -0
- data/app/assets/images/{famfamfam/page_white.png → umlaut_icons/famfamfam-page-white.png} +0 -0
- data/app/assets/images/{famfamfam/readme.html → umlaut_icons/famfamfam-readme.html} +0 -0
- data/app/assets/images/{famfamfam/tiny_cross.png → umlaut_icons/famfamfam-tiny-cross.png} +0 -0
- data/app/assets/images/{list_closed.png → umlaut_icons/list-closed.png} +0 -0
- data/app/assets/images/{list_open.png → umlaut_icons/list-open.png} +0 -0
- data/app/assets/javascripts/umlaut.js +5 -4
- data/app/assets/javascripts/umlaut/ajax_windows.js +41 -23
- data/app/assets/javascripts/umlaut/expand_contract_toggle.js +21 -29
- data/app/assets/javascripts/umlaut/load_permalink.js +26 -0
- data/app/assets/javascripts/umlaut/search_autocomplete.js +103 -44
- data/app/assets/stylesheets/umlaut.css.scss +19 -0
- data/app/assets/stylesheets/umlaut/_admin.scss +14 -0
- data/app/assets/stylesheets/umlaut/_az.scss +29 -0
- data/app/assets/stylesheets/umlaut/_forms.scss +31 -0
- data/app/assets/stylesheets/umlaut/_icons.scss +64 -0
- data/app/assets/stylesheets/umlaut/_layout.scss +52 -0
- data/app/assets/stylesheets/umlaut/_misc.scss +59 -0
- data/app/assets/stylesheets/umlaut/_mixins.scss +65 -0
- data/app/assets/stylesheets/umlaut/_modal.scss +4 -0
- data/app/assets/stylesheets/umlaut/_resolve.scss +308 -0
- data/app/assets/stylesheets/umlaut/_results.scss +34 -0
- data/app/assets/stylesheets/umlaut/_search.scss +14 -0
- data/app/assets/stylesheets/umlaut/_spinner.scss +12 -0
- data/app/assets/stylesheets/umlaut/_variables.scss +72 -0
- data/app/controllers/export_email_controller.rb +22 -39
- data/app/controllers/journal_tocs_controller +90 -0
- data/app/controllers/js_helper_controller.rb +2 -3
- data/app/controllers/link_router_controller.rb +32 -43
- data/app/controllers/open_search_controller.rb +3 -4
- data/app/controllers/resolve_controller.rb +68 -107
- data/app/controllers/resource_controller.rb +14 -20
- data/app/controllers/search_controller.rb +75 -94
- data/app/controllers/search_methods/README.md +28 -0
- data/app/controllers/search_methods/sfx4.rb +50 -119
- data/app/controllers/search_methods/sfx4_solr/README.md +57 -0
- data/app/controllers/search_methods/sfx4_solr/local.rb +40 -0
- data/app/controllers/search_methods/sfx4_solr/searcher.rb +90 -0
- data/app/controllers/store_controller.rb +24 -30
- data/app/controllers/umlaut/controller_behavior.rb +45 -17
- data/app/controllers/umlaut/error_handling.rb +20 -25
- data/{lib → app/controllers}/umlaut_configurable.rb +35 -21
- data/app/controllers/umlaut_controller.rb +43 -46
- data/app/helpers/emailer_helper.rb +9 -16
- data/app/helpers/export_email_helper.rb +8 -8
- data/app/helpers/open_search_helper.rb +2 -3
- data/app/helpers/resolve_helper.rb +130 -100
- data/app/helpers/search_helper.rb +17 -5
- data/app/helpers/umlaut/footer_helper.rb +1 -1
- data/app/helpers/umlaut/helper.rb +34 -0
- data/app/helpers/umlaut/html_head_helper.rb +12 -21
- data/{lib → app/mixin_logic}/marc_helper.rb +1 -1
- data/{lib → app/mixin_logic}/metadata_helper.rb +6 -5
- data/{lib → app/mixin_logic}/umlaut_http.rb +0 -0
- data/{lib → app/mixin_logic}/xml_schema_helper.rb +0 -0
- data/app/models/collection.rb +97 -95
- data/{lib → app/models}/hip3/bib.rb +0 -0
- data/{lib → app/models}/hip3/bib_searcher.rb +0 -0
- data/{lib → app/models}/hip3/custom_field_lookup.rb +0 -0
- data/{lib → app/models}/hip3/holding.rb +0 -0
- data/{lib → app/models}/hip3/item.rb +0 -0
- data/{lib → app/models}/hip3/receipt.rb +0 -0
- data/{lib → app/models}/hip3/serial_copy.rb +0 -0
- data/app/models/permalink.rb +3 -8
- data/app/models/referent.rb +29 -21
- data/app/models/request.rb +19 -8
- data/app/models/service_response.rb +24 -3
- data/app/models/service_store.rb +108 -39
- data/app/models/service_store.rb-NEW +73 -0
- data/app/models/service_wave.rb +2 -0
- data/app/models/sfx4/abstract/README.md +68 -0
- data/app/models/sfx4/abstract/az_extra_info.rb +44 -0
- data/app/models/sfx4/abstract/az_letter_group.rb +24 -0
- data/app/models/sfx4/abstract/az_title.rb +96 -0
- data/app/models/sfx4/abstract/az_title_search.rb +24 -0
- data/app/models/sfx4/abstract/base.rb +77 -0
- data/app/models/sfx4/global/base.rb +24 -0
- data/app/models/sfx4/global/kb_objects.rb +34 -0
- data/app/models/sfx4/local/az_extra_info.rb +7 -0
- data/app/models/sfx4/local/az_letter_group.rb +7 -0
- data/app/models/sfx4/local/az_title.rb +7 -0
- data/app/models/sfx4/local/az_title_search.rb +7 -0
- data/app/models/sfx4/local/base.rb +26 -0
- data/{lib → app/presentation}/section_renderer.rb +0 -12
- data/app/referent_filters/dissertation_catch.rb +67 -0
- data/{lib → app/referent_filters}/referent_filter.rb +0 -0
- data/{lib → app}/service_adaptors/ajax_export.rb +0 -0
- data/{lib → app}/service_adaptors/amazon.rb +2 -0
- data/{lib → app}/service_adaptors/blacklight.rb +22 -10
- data/{lib → app}/service_adaptors/book_finder.rb +0 -0
- data/{lib → app}/service_adaptors/bx.rb +0 -0
- data/{lib → app}/service_adaptors/cover_thing.rb +0 -0
- data/{lib → app}/service_adaptors/dummy_service.rb +0 -0
- data/{lib → app}/service_adaptors/elsevier_cover.rb +0 -0
- data/{lib → app}/service_adaptors/email_export.rb +0 -0
- data/{lib → app}/service_adaptors/ezproxy.rb +0 -0
- data/{lib → app}/service_adaptors/google_book_search.rb +0 -0
- data/app/service_adaptors/google_scholar_link.rb +71 -0
- data/{lib → app}/service_adaptors/gpo.rb +0 -0
- data/{lib → app}/service_adaptors/hathi_trust.rb +0 -0
- data/{lib → app}/service_adaptors/hip3_service.rb +0 -0
- data/{lib → app}/service_adaptors/hip_holding_search.rb +0 -0
- data/{lib → app}/service_adaptors/internet_archive.rb +0 -0
- data/{lib → app}/service_adaptors/isbn_db.rb +0 -0
- data/{lib → app}/service_adaptors/isi.rb +22 -13
- data/{lib → app}/service_adaptors/jcr.rb +0 -0
- data/{lib → app}/service_adaptors/opac.rb +0 -0
- data/{lib → app}/service_adaptors/open_library.rb +0 -0
- data/{lib → app}/service_adaptors/open_library_cover.rb +0 -0
- data/{lib → app}/service_adaptors/pubmed.rb +0 -0
- data/{lib → app}/service_adaptors/request_to_fixture.rb +0 -0
- data/{lib → app}/service_adaptors/scopus.rb +0 -0
- data/{lib → app/service_adaptors}/service.rb +3 -3
- data/{lib → app}/service_adaptors/sfx.rb +154 -11
- data/{lib → app}/service_adaptors/sfx_backchannel_record.rb +0 -0
- data/app/service_adaptors/tr_link.rb +267 -0
- data/app/service_adaptors/tr_links.rb +278 -0
- data/{lib → app}/service_adaptors/txt_holding_export.rb +0 -0
- data/{lib → app}/service_adaptors/ulrichs_cover.rb +0 -0
- data/{lib → app}/service_adaptors/ulrichs_link.rb +0 -0
- data/{lib → app}/service_adaptors/worldcat.rb +0 -0
- data/{lib → app}/service_adaptors/worldcat_identities.rb +0 -0
- data/app/views/admin/service_errors/_dispatched_service.html.erb +13 -13
- data/app/views/admin/service_errors/index.html.erb +11 -21
- data/app/views/export_email/email.html.erb +17 -2
- data/app/views/export_email/send_email.html.erb +2 -1
- data/app/views/export_email/send_txt.html.erb +2 -1
- data/app/views/export_email/txt.html.erb +30 -2
- data/app/views/layouts/umlaut.html.erb +29 -49
- data/app/views/resolve/_background_progress.html.erb +43 -50
- data/app/views/resolve/_background_updater.html.erb +23 -36
- data/app/views/resolve/_citation.html.erb +63 -87
- data/app/views/resolve/_compact_citation.html.erb +15 -33
- data/app/views/resolve/_cover_image.html.erb +34 -43
- data/app/views/resolve/_fulltext.html.erb +29 -50
- data/app/views/resolve/_help.html.erb +17 -14
- data/app/views/resolve/_holding.html.erb +65 -82
- data/app/views/resolve/_manually_entered_warning.html.erb +7 -0
- data/app/views/resolve/_modal.html.erb +19 -0
- data/app/views/resolve/_related_items.html.erb +20 -35
- data/app/views/resolve/_search_inside.html.erb +34 -57
- data/app/views/resolve/_section_display.html.erb +34 -46
- data/app/views/resolve/_section_heading.html.erb +17 -0
- data/app/views/resolve/_service_errors.html.erb +27 -28
- data/app/views/resolve/_standard_response_item.html.erb +42 -72
- data/app/views/resolve/background_status.html.erb +19 -23
- data/app/views/resolve/get_permalink.html.erb +6 -0
- data/app/views/resolve/index.html.erb +47 -73
- data/app/views/search/_a_to_z.html.erb +9 -6
- data/app/views/search/_citation.html.erb +73 -94
- data/app/views/search/_pager.html.erb +6 -6
- data/app/views/search/books.html.erb +34 -102
- data/app/views/search/journal_search.html.erb +53 -90
- data/app/views/search/journals.html.erb +73 -167
- data/app/views/umlaut/_header.html.erb +9 -0
- data/app/views/umlaut/error.html.erb +44 -44
- data/config/locales/en.yml +5 -0
- data/lib/{CronTab.rb → cron_tab.rb} +0 -0
- data/lib/generators/templates/umlaut_services.yml +57 -43
- data/lib/generators/umlaut/install_generator.rb +12 -0
- data/lib/service_adaptors/README.md +0 -0
- data/lib/tasks/umlaut.rake +8 -24
- data/lib/umlaut.rb +1 -21
- data/lib/umlaut/version.rb +1 -1
- data/test/README.md +75 -0
- data/test/dummy/app/controllers/umlaut_controller.rb +3 -3
- data/test/dummy/config/application.rb +3 -0
- data/test/dummy/config/sunspot.yml +20 -0
- data/test/dummy/config/travis_database.yml +96 -0
- data/test/dummy/config/umlaut_services.yml +16 -23
- data/test/dummy/db/migrate/20120927163304_sfx4_global.rb +26 -0
- data/test/dummy/db/migrate/20120927164040_sfx4_local.rb +54 -0
- data/test/dummy/tmp/cache/assets/BBA/6A0/sprockets%2F2a335471966f33256b321f8324041981 +0 -0
- data/test/dummy/tmp/cache/assets/C2A/410/sprockets%2Fd654b74912b4773a2534616863fb6565 +0 -0
- data/test/dummy/tmp/cache/assets/C45/A30/sprockets%2F39494895e462697b478d3d0c79298a26 +0 -0
- data/test/dummy/tmp/cache/assets/C49/730/sprockets%2F212d35831188417b5131e3e693aa69a6 +0 -0
- data/test/dummy/tmp/cache/assets/C55/1D0/sprockets%2F5af2f2a3403040f736981863fd278529 +0 -0
- data/test/dummy/tmp/cache/assets/C5A/A80/sprockets%2F2328c7370b56b4151776981a5f6d394e +0 -0
- data/test/dummy/tmp/cache/assets/C5F/340/sprockets%2F99692920160b7a279b86a80415b79db7 +0 -0
- data/test/dummy/tmp/cache/assets/C70/4D0/sprockets%2F034ad2036e623081bd352800786dfe80 +0 -0
- data/test/dummy/tmp/cache/assets/C80/980/sprockets%2Fc94807409c1523d43e18d25f35d93c41 +0 -0
- data/test/dummy/tmp/cache/assets/C94/E20/sprockets%2F19579abc248373f419b1c3e287d74598 +0 -0
- data/test/dummy/tmp/cache/assets/C98/330/sprockets%2F0c81574ba94abc10657315d4190c201f +0 -0
- data/test/dummy/tmp/cache/assets/CA4/440/sprockets%2F0feb4425db6319d7d0582192a503671b +0 -0
- data/test/dummy/tmp/cache/assets/CA7/E80/sprockets%2F33310f455a870eaedd6d938e30620714 +0 -0
- data/test/dummy/tmp/cache/assets/CB8/3C0/sprockets%2F697cd846490fda9f0e20c558320610f8 +0 -0
- data/test/dummy/tmp/cache/assets/CBF/B60/sprockets%2F08ca89671549936265dcb673bf02e36f +0 -0
- data/test/dummy/tmp/cache/assets/CC7/F10/sprockets%2F939637f806eef3f0f21584659458ab2e +0 -0
- data/test/dummy/tmp/cache/assets/CC9/9F0/sprockets%2F306166316e2cafd13c15e62b51a2339d +0 -0
- data/test/dummy/tmp/cache/assets/CD8/370/sprockets%2F357970feca3ac29060c1e3861e2c0953 +0 -0
- data/test/dummy/tmp/cache/assets/CF7/2B0/sprockets%2F25a7c73655bd3598173b39d9f98bcd46 +0 -0
- data/test/dummy/tmp/cache/assets/CF8/DA0/sprockets%2Ff5b8c8499d3da954d392fa57739503c5 +0 -0
- data/test/dummy/tmp/cache/assets/CF9/590/sprockets%2F096bcc45cd31b3796fa2121cd203215f +0 -0
- data/test/dummy/tmp/cache/assets/CFE/080/sprockets%2F37fe9f4255baddbd549a659914929398 +0 -0
- data/test/dummy/tmp/cache/assets/D04/CC0/sprockets%2Fe9c1b92f2e437e1bbbe020d718739220 +0 -0
- data/test/dummy/tmp/cache/assets/D0B/090/sprockets%2F58009091c95e3ac328c91c68fca30e0e +0 -0
- data/test/dummy/tmp/cache/assets/D1A/B50/sprockets%2F2db5892438129fe94da8429b8be114ec +0 -0
- data/test/dummy/tmp/cache/assets/D2D/1A0/sprockets%2F376426b4896a3cff7969ce6c7b387e0e +0 -0
- data/test/dummy/tmp/cache/assets/D32/A10/sprockets%2F13fe41fee1fe35b49d145bcc06610705 +0 -0
- data/test/dummy/tmp/cache/assets/D37/2B0/sprockets%2F40834fb07d7318c1fddd5003bd9e04f6 +0 -0
- data/test/dummy/tmp/cache/assets/D43/0D0/sprockets%2F682843a8d0795a5fbcfeb2f0c81727d0 +0 -0
- data/test/dummy/tmp/cache/assets/D46/F80/sprockets%2Fb15c08e749067d7aad9baf5e9388221c +0 -0
- data/test/dummy/tmp/cache/assets/D4E/1B0/sprockets%2Ff7cbd26ba1d28d48de824f0e94586655 +0 -0
- data/test/dummy/tmp/cache/assets/D5A/EA0/sprockets%2Fd771ace226fc8215a3572e0aa35bb0d6 +0 -0
- data/test/dummy/tmp/cache/assets/D6C/7D0/sprockets%2F8a05d6981ec0d38c51739bef0b3a9c2b +0 -0
- data/test/dummy/tmp/cache/assets/D6E/CF0/sprockets%2F5661c6e4f0cea86fe4523f27261aade5 +0 -0
- data/test/dummy/tmp/cache/assets/D94/FF0/sprockets%2F3b56a1aa77de0d570c38a4a9d5f4b1d6 +0 -0
- data/test/dummy/tmp/cache/assets/D97/6B0/sprockets%2Fb070e8c799d1a4ad5e62e0a1ae3b83e6 +0 -0
- data/test/dummy/tmp/cache/assets/D9A/2F0/sprockets%2Fbba0f4b972dc53c15ce6c8c1993b82a4 +0 -0
- data/test/dummy/tmp/cache/assets/D9C/860/sprockets%2Fec2d9f20b270d70e698ff33e53c21fca +0 -0
- data/test/dummy/tmp/cache/assets/DA6/A80/sprockets%2F92e26d8e58d5bcc8b8f6c25d1b05b9c1 +0 -0
- data/test/dummy/tmp/cache/assets/DA8/BB0/sprockets%2F0cf1c7e9f966dce425517c0e2a844efe +0 -0
- data/test/dummy/tmp/cache/assets/DA9/BC0/sprockets%2Fcb9062b73291befe5e5bf2a70978dec8 +0 -0
- data/test/dummy/tmp/cache/assets/DB6/ED0/sprockets%2Ff4482d9b9f76fb65eef16430bde2f8e6 +0 -0
- data/test/dummy/tmp/cache/assets/DDC/400/sprockets%2Fcffd775d018f68ce5dba1ee0d951a994 +0 -0
- data/test/dummy/tmp/cache/assets/DE8/790/sprockets%2Fd1333bde2b9aafcc712d11dd09ab35d8 +0 -0
- data/test/dummy/tmp/cache/assets/DF7/960/sprockets%2F99ac6db10b44a64fbba4ee847b35ba8b +0 -0
- data/test/dummy/tmp/cache/assets/DFD/300/sprockets%2Fabac9489cf7f1db8ef00d72a1571ee1e +0 -0
- data/test/dummy/tmp/cache/assets/E02/C10/sprockets%2F1463cadfce3fc70e61d482f9fcb75ac7 +0 -0
- data/test/dummy/tmp/cache/assets/E04/890/sprockets%2F2f5173deea6c795b8fdde723bb4b63af +0 -0
- data/test/dummy/tmp/cache/assets/E38/FE0/sprockets%2Fe1fc875efa817cbb94a5d8de25ea4e6b +0 -0
- data/test/dummy/tmp/cache/assets/E50/F00/sprockets%2Fec61afdbb1cc4df075e3dad46f0af571 +0 -0
- data/test/dummy/tmp/cache/assets/E5E/5F0/sprockets%2Feffaeb4d7f9bf4c0cc840ff320fde046 +0 -0
- data/test/dummy/tmp/cache/assets/E5F/960/sprockets%2Fdc007b6cad5c7ef08e33ec28cfff0ef6 +0 -0
- data/test/dummy/tmp/cache/sass/310d901c169042855feb8cf3903e1e2821d27f13/_accordion.scssc +0 -0
- data/test/dummy/tmp/cache/sass/310d901c169042855feb8cf3903e1e2821d27f13/_alerts.scssc +0 -0
- data/test/dummy/tmp/cache/sass/310d901c169042855feb8cf3903e1e2821d27f13/_breadcrumbs.scssc +0 -0
- data/test/dummy/tmp/cache/sass/310d901c169042855feb8cf3903e1e2821d27f13/_button-groups.scssc +0 -0
- data/test/dummy/tmp/cache/sass/310d901c169042855feb8cf3903e1e2821d27f13/_buttons.scssc +0 -0
- data/test/dummy/tmp/cache/sass/310d901c169042855feb8cf3903e1e2821d27f13/_carousel.scssc +0 -0
- data/test/dummy/tmp/cache/sass/310d901c169042855feb8cf3903e1e2821d27f13/_close.scssc +0 -0
- data/test/dummy/tmp/cache/sass/310d901c169042855feb8cf3903e1e2821d27f13/_code.scssc +0 -0
- data/test/dummy/tmp/cache/sass/310d901c169042855feb8cf3903e1e2821d27f13/_component-animations.scssc +0 -0
- data/test/dummy/tmp/cache/sass/310d901c169042855feb8cf3903e1e2821d27f13/_dropdowns.scssc +0 -0
- data/test/dummy/tmp/cache/sass/310d901c169042855feb8cf3903e1e2821d27f13/_forms.scssc +0 -0
- data/test/dummy/tmp/cache/sass/310d901c169042855feb8cf3903e1e2821d27f13/_grid.scssc +0 -0
- data/test/dummy/tmp/cache/sass/310d901c169042855feb8cf3903e1e2821d27f13/_hero-unit.scssc +0 -0
- data/test/dummy/tmp/cache/sass/310d901c169042855feb8cf3903e1e2821d27f13/_labels-badges.scssc +0 -0
- data/test/dummy/tmp/cache/sass/310d901c169042855feb8cf3903e1e2821d27f13/_layouts.scssc +0 -0
- data/test/dummy/tmp/cache/sass/310d901c169042855feb8cf3903e1e2821d27f13/_media.scssc +0 -0
- data/test/dummy/tmp/cache/sass/310d901c169042855feb8cf3903e1e2821d27f13/_mixins.scssc +0 -0
- data/test/dummy/tmp/cache/sass/310d901c169042855feb8cf3903e1e2821d27f13/_modals.scssc +0 -0
- data/test/dummy/tmp/cache/sass/310d901c169042855feb8cf3903e1e2821d27f13/_navbar.scssc +0 -0
- data/test/dummy/tmp/cache/sass/310d901c169042855feb8cf3903e1e2821d27f13/_navs.scssc +0 -0
- data/test/dummy/tmp/cache/sass/310d901c169042855feb8cf3903e1e2821d27f13/_pager.scssc +0 -0
- data/test/dummy/tmp/cache/sass/310d901c169042855feb8cf3903e1e2821d27f13/_pagination.scssc +0 -0
- data/test/dummy/tmp/cache/sass/310d901c169042855feb8cf3903e1e2821d27f13/_popovers.scssc +0 -0
- data/test/dummy/tmp/cache/sass/310d901c169042855feb8cf3903e1e2821d27f13/_progress-bars.scssc +0 -0
- data/test/dummy/tmp/cache/sass/310d901c169042855feb8cf3903e1e2821d27f13/_reset.scssc +0 -0
- data/test/dummy/tmp/cache/sass/310d901c169042855feb8cf3903e1e2821d27f13/_responsive-1200px-min.scssc +0 -0
- data/test/dummy/tmp/cache/sass/310d901c169042855feb8cf3903e1e2821d27f13/_responsive-767px-max.scssc +0 -0
- data/test/dummy/tmp/cache/sass/310d901c169042855feb8cf3903e1e2821d27f13/_responsive-768px-979px.scssc +0 -0
- data/test/dummy/tmp/cache/sass/310d901c169042855feb8cf3903e1e2821d27f13/_responsive-navbar.scssc +0 -0
- data/test/dummy/tmp/cache/sass/310d901c169042855feb8cf3903e1e2821d27f13/_responsive-utilities.scssc +0 -0
- data/test/dummy/tmp/cache/sass/310d901c169042855feb8cf3903e1e2821d27f13/_scaffolding.scssc +0 -0
- data/test/dummy/tmp/cache/sass/310d901c169042855feb8cf3903e1e2821d27f13/_sprites.scssc +0 -0
- data/test/dummy/tmp/cache/sass/310d901c169042855feb8cf3903e1e2821d27f13/_tables.scssc +0 -0
- data/test/dummy/tmp/cache/sass/310d901c169042855feb8cf3903e1e2821d27f13/_thumbnails.scssc +0 -0
- data/test/dummy/tmp/cache/sass/310d901c169042855feb8cf3903e1e2821d27f13/_tooltip.scssc +0 -0
- data/test/dummy/tmp/cache/sass/310d901c169042855feb8cf3903e1e2821d27f13/_type.scssc +0 -0
- data/test/dummy/tmp/cache/sass/310d901c169042855feb8cf3903e1e2821d27f13/_utilities.scssc +0 -0
- data/test/dummy/tmp/cache/sass/310d901c169042855feb8cf3903e1e2821d27f13/_variables.scssc +0 -0
- data/test/dummy/tmp/cache/sass/310d901c169042855feb8cf3903e1e2821d27f13/_wells.scssc +0 -0
- data/test/dummy/tmp/cache/sass/310d901c169042855feb8cf3903e1e2821d27f13/bootstrap.scssc +0 -0
- data/test/dummy/tmp/cache/sass/310d901c169042855feb8cf3903e1e2821d27f13/responsive.scssc +0 -0
- data/test/dummy/tmp/cache/sass/3af72421a0fbed39d3047687ca0ad6e6e5545041/_admin.scssc +0 -0
- data/test/dummy/tmp/cache/sass/3af72421a0fbed39d3047687ca0ad6e6e5545041/_az.scssc +0 -0
- data/test/dummy/tmp/cache/sass/3af72421a0fbed39d3047687ca0ad6e6e5545041/_base.scssc +0 -0
- data/test/dummy/tmp/cache/sass/3af72421a0fbed39d3047687ca0ad6e6e5545041/_forms.scssc +0 -0
- data/test/dummy/tmp/cache/sass/3af72421a0fbed39d3047687ca0ad6e6e5545041/_icons.scssc +0 -0
- data/test/dummy/tmp/cache/sass/3af72421a0fbed39d3047687ca0ad6e6e5545041/_misc.scssc +0 -0
- data/test/dummy/tmp/cache/sass/3af72421a0fbed39d3047687ca0ad6e6e5545041/_mixins.scssc +0 -0
- data/test/dummy/tmp/cache/sass/3af72421a0fbed39d3047687ca0ad6e6e5545041/_modal.scssc +0 -0
- data/test/dummy/tmp/cache/sass/3af72421a0fbed39d3047687ca0ad6e6e5545041/_resolve.scssc +0 -0
- data/test/dummy/tmp/cache/sass/3af72421a0fbed39d3047687ca0ad6e6e5545041/_results.scssc +0 -0
- data/test/dummy/tmp/cache/sass/3af72421a0fbed39d3047687ca0ad6e6e5545041/_search.scssc +0 -0
- data/test/dummy/tmp/cache/sass/3af72421a0fbed39d3047687ca0ad6e6e5545041/_spinner.scssc +0 -0
- data/test/dummy/tmp/cache/sass/3af72421a0fbed39d3047687ca0ad6e6e5545041/_variables.scssc +0 -0
- data/test/dummy/tmp/cache/sass/93d65682d6bddb0b2e6788c1232f4849af20a35e/bootstrap-responsive.scssc +0 -0
- data/test/dummy/tmp/cache/sass/93d65682d6bddb0b2e6788c1232f4849af20a35e/bootstrap.scssc +0 -0
- data/test/dummy/tmp/cache/sass/fb58c04fd15fcc38a8c4d91b7070bcfeaf1c3799/umlaut.css.scssc +0 -0
- data/test/fixtures/dispatched_services.yml +0 -4
- data/test/fixtures/permalinks.yml +23 -4
- data/test/fixtures/referent_values.yml +226 -1493
- data/test/fixtures/referents.yml +14 -137
- data/test/fixtures/requests.yml +22 -260
- data/test/fixtures/service_responses.yml +169 -5
- data/test/fixtures/sfx4/global/KB_OBJECTS.yml +46 -0
- data/test/fixtures/sfx4/local/AZ_EXTRA_INFO.yml +4802 -0
- data/test/fixtures/sfx4/local/AZ_LETTER_GROUP.yml +105 -0
- data/test/fixtures/sfx4/local/AZ_TITLE.yml +165 -0
- data/test/fixtures/sfx4/local/AZ_TITLE_SEARCH.yml +341 -0
- data/test/fixtures/sfx_urls.yml +3 -0
- data/test/functional/export_email_controller_test.rb +43 -0
- data/test/functional/link_router_controller_test.rb +16 -0
- data/test/functional/resolve_controller_test.rb +102 -0
- data/test/functional/search_controller_test.rb +40 -0
- data/test/functional/store_controller_test.rb +29 -0
- data/test/helper/list_with_limit_test.rb +90 -0
- data/test/integration/permalinks_test.rb +14 -0
- data/test/support/search_methods/test_case.rb +0 -0
- data/test/support/service_adaptors/test_case.rb +0 -0
- data/test/support/test_with_cassette.rb +37 -0
- data/test/test_helper.rb +76 -30
- data/test/unit/aws_product_sign_test.rb +2 -0
- data/test/unit/determine_services_test.rb +163 -0
- data/test/unit/google_book_search_test.rb +8 -25
- data/test/unit/google_scholar_link_test.rb +81 -0
- data/test/unit/internet_archive_test.rb +33 -0
- data/test/unit/permalink_test.rb +15 -0
- data/test/unit/service_store_test.rb +47 -0
- data/test/unit/service_test.rb +28 -13
- data/test/unit/sfx/sfx_target_roll_up_test.rb +369 -0
- data/test/unit/sfx4_search_test.rb +102 -0
- data/test/unit/sfx4_solr_search_test.rb +77 -0
- data/test/unit/sfx_test.rb +38 -0
- data/test/unit/worldcat_test.rb +7 -0
- data/test/vcr_cassettes/google_book_search/frankenstein_by_OCLC_number.yml +107 -0
- data/test/vcr_cassettes/internet_archive/momo_by_title_author.yml +116 -0
- data/test/vcr_cassettes/resolve/fulltext_with_edition_warning.yml +44 -0
- data/test/vcr_cassettes/resolve/no_holdings.yml +649 -0
- data/test/vcr_cassettes/resolve/nytimes_by_issn.yml +224 -0
- data/test/vcr_cassettes/sfx/nytimes_by_issn.yml +1395 -0
- data/test/vcr_cassettes/sfx4_solr/find_by_group.yml +109 -0
- data/test/vcr_cassettes/sfx4_solr/find_by_title_begins_with.yml +33 -0
- data/test/vcr_cassettes/sfx4_solr/find_by_title_contains.yml +34 -0
- data/test/vcr_cassettes/sfx4_solr/find_by_title_exact.yml +32 -0
- data/test/view/holding_test.rb +30 -0
- metadata +435 -179
- data/app/assets/images/export_bg_bot.gif +0 -0
- data/app/assets/images/export_bg_mid.gif +0 -0
- data/app/assets/images/export_bg_top.gif +0 -0
- data/app/assets/images/famfamfam/page_sound.gif +0 -0
- data/app/assets/images/famfamfam/page_text.gif +0 -0
- data/app/assets/images/famfamfam/page_up.gif +0 -0
- data/app/assets/images/ico_go.gif +0 -0
- data/app/assets/images/more_info.gif +0 -0
- data/app/assets/images/rails.png +0 -0
- data/app/assets/images/request.gif +0 -0
- data/app/assets/javascripts/umlaut/simple_visible_toggle.js +0 -8
- data/app/assets/stylesheets/umlaut.css +0 -900
- data/app/assets/stylesheets/umlaut/_background_progress_spinner.scss +0 -21
- data/app/assets/stylesheets/umlaut/_expand_contract.scss +0 -28
- data/app/controllers/search_methods/sfx3.rb +0 -148
- data/app/models/sfx_db.rb +0 -10
- data/app/models/sfx_db/az_additional_title.rb +0 -11
- data/app/models/sfx_db/az_letter_group.rb +0 -11
- data/app/models/sfx_db/az_title.rb +0 -40
- data/app/models/sfx_db/az_title_v2.rb +0 -34
- data/app/models/sfx_db/isbn.rb +0 -12
- data/app/models/sfx_db/issn.rb +0 -12
- data/app/models/sfx_db/object.rb +0 -35
- data/app/models/sfx_db/object_portfolio.rb +0 -6
- data/app/models/sfx_db/publisher.rb +0 -10
- data/app/models/sfx_db/sfx_db_base.rb +0 -58
- data/app/models/sfx_db/target.rb +0 -10
- data/app/models/sfx_db/target_service.rb +0 -10
- data/app/models/sfx_db/title.rb +0 -10
- data/app/views/export_email/_email.html.erb +0 -25
- data/app/views/export_email/_send_email.html.erb +0 -3
- data/app/views/export_email/_send_txt.html.erb +0 -3
- data/app/views/export_email/_txt.html.erb +0 -62
- data/lib/holding.rb +0 -32
- data/lib/opensearch_feed.rb +0 -398
- data/lib/opensearch_query.rb +0 -98
- data/lib/referent_filters/dissertation_catch.rb +0 -45
- data/lib/service_adaptors/journal_tocs.progress +0 -68
- data/lib/service_adaptors/primo_service.rb +0 -452
- data/lib/service_adaptors/primo_source.rb +0 -82
- data/lib/umlaut/default_configuration.rb +0 -5
- data/test/dummy/config/primo.yml +0 -271
- data/test/unit/primo_service_test.rb +0 -947
@@ -1,23 +1,18 @@
|
|
1
1
|
module EmailerHelper
|
2
2
|
include ApplicationHelper
|
3
|
-
|
3
|
+
include Umlaut::Helper
|
4
|
+
|
5
|
+
|
4
6
|
# returns a plain text short citation
|
5
7
|
def brief_citation(request, options = {})
|
6
|
-
|
7
8
|
options[:include_labels] ||= false
|
8
|
-
|
9
9
|
rv =""
|
10
|
-
|
11
|
-
|
12
|
-
cite = request.referent.to_citation
|
13
|
-
|
10
|
+
cite = request.referent.to_citation
|
14
11
|
title = truncate(cite[:title].strip, :length => 70, :seperator => '...')
|
15
|
-
|
16
12
|
rv << (cite[:title_label].strip + ": ")if options[:include_labels]
|
17
13
|
rv << title
|
18
14
|
rv << "\n"
|
19
|
-
|
20
|
-
if cite[:author]
|
15
|
+
if cite[:author]
|
21
16
|
rv << "Author: " if options[:include_labels]
|
22
17
|
rv << cite[:author].strip
|
23
18
|
rv << "\n"
|
@@ -27,17 +22,15 @@ module EmailerHelper
|
|
27
22
|
rv << cite[:subtitle].strip
|
28
23
|
rv << "\n"
|
29
24
|
end
|
30
|
-
|
31
25
|
pub = []
|
32
|
-
pub << date_format(cite[:date]) unless cite[:date].blank?
|
26
|
+
pub << date_format(cite[:date]) unless cite[:date].blank?
|
33
27
|
pub << 'Vol: '+cite[:volume].strip unless cite[:volume].blank?
|
34
|
-
pub << 'Iss: '+cite[:issue].strip unless cite[:issue].blank?
|
28
|
+
pub << 'Iss: '+cite[:issue].strip unless cite[:issue].blank?
|
35
29
|
pub << 'p. '+cite[:page].strip unless cite[:page].blank?
|
36
30
|
if pub.length > 0
|
37
31
|
rv << "Published: " if options[:include_labels]
|
38
32
|
rv << pub.join(' ')
|
39
33
|
end
|
40
|
-
|
41
|
-
return rv
|
34
|
+
return rv
|
42
35
|
end
|
43
|
-
end
|
36
|
+
end
|
@@ -24,15 +24,15 @@ module ExportEmailHelper
|
|
24
24
|
end
|
25
25
|
|
26
26
|
def validation_error(errors)
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
e << content_tag(:li, error)
|
33
|
-
end
|
34
|
-
e
|
27
|
+
validation_errors = content_tag(:div, :class => "alert alert-error") do
|
28
|
+
content_tag(:span, "Please provide the following:") + content_tag(:ul) do
|
29
|
+
e = "".html_safe
|
30
|
+
errors.each do |error|
|
31
|
+
e << content_tag(:li, error)
|
35
32
|
end
|
33
|
+
e
|
34
|
+
end
|
36
35
|
end
|
36
|
+
validation_errors
|
37
37
|
end
|
38
38
|
end
|
@@ -1,7 +1,6 @@
|
|
1
1
|
module OpenSearchHelper
|
2
|
-
|
2
|
+
|
3
3
|
def opensearch_template_url
|
4
4
|
url_for(:controller => "search", :action => "journal_search", :rfr_id => umlaut_config.lookup('rfr_id.opensearch'), :'umlaut.title_search_type' => 'contains', :only_path => false ) + '&rft.jtitle={searchTerms}'
|
5
5
|
end
|
6
|
-
|
7
|
-
end
|
6
|
+
end
|
@@ -1,11 +1,13 @@
|
|
1
|
+
#encoding: UTF-8
|
2
|
+
|
1
3
|
module ResolveHelper
|
2
4
|
# some useful methods started out as helper methods, but now are in the
|
3
5
|
# Request model. We delegate them for convenience and backwards compat.
|
4
|
-
delegate :get_service_type,
|
5
|
-
:failed_service_dispatches,
|
6
|
-
:service_type_in_progress?,
|
7
|
-
:service_types_in_progress?,
|
8
|
-
:any_services_in_progress?,
|
6
|
+
delegate :get_service_type,
|
7
|
+
:failed_service_dispatches,
|
8
|
+
:service_type_in_progress?,
|
9
|
+
:service_types_in_progress?,
|
10
|
+
:any_services_in_progress?,
|
9
11
|
:title_level_citation?, :to => :@user_request
|
10
12
|
|
11
13
|
|
@@ -22,43 +24,76 @@ module ResolveHelper
|
|
22
24
|
# complete hash was previously looked up from resolve_sections config.
|
23
25
|
#
|
24
26
|
# For documentation of possible values in the section descripton hash,
|
25
|
-
# see SectionRenderer.
|
27
|
+
# see SectionRenderer.
|
26
28
|
def render_section(arguments = {})
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
29
|
+
presenter = (arguments.kind_of?( SectionRenderer )) ?
|
30
|
+
arguments : SectionRenderer.new(@user_request, arguments )
|
31
|
+
render(:partial => "section_display", :locals => {:presenter => presenter })
|
32
|
+
end
|
33
|
+
|
34
|
+
# Return an array of css classes that should be attached to an .umlaut_section
|
35
|
+
# generally 'umlaut-section', plus the section_id, plus possibly
|
36
|
+
# 'umlaut-section-highlighted'. See #should_highlight_section?
|
37
|
+
#
|
38
|
+
# pass in:
|
39
|
+
# * current Umlaut Request object
|
40
|
+
# * string section id
|
41
|
+
# * array of umlaut ServiceResponses already fetched for this section.
|
42
|
+
def section_css_classes(umlaut_request, section_id, response_list)
|
43
|
+
classes = ["umlaut-section", section_id]
|
44
|
+
classes << 'umlaut-section-highlighted' if should_highlight_section?(umlaut_request, section_id, response_list)
|
45
|
+
return classes
|
46
|
+
end
|
47
|
+
|
48
|
+
# Called by #section_css_classes. Decides if a section should get
|
49
|
+
# highlight styles. Default logic highlights fulltext if present,
|
50
|
+
# otherwise holdings/docdel sections (in some cases both even if holdings present,
|
51
|
+
# in some cases just docdel, depending on nature of resource.) This is
|
52
|
+
# something local institutions may want to supply custom logic for,
|
53
|
+
# over-ride this method.
|
54
|
+
#
|
55
|
+
# This is VERY tricky to get right, BOTH becuase of local policy differences,
|
56
|
+
# AND becuase umlaut's concurrent service handling means things are changing
|
57
|
+
# all the time. Umlaut used to just highlight fulltext with responses, that's it.
|
58
|
+
# But we're trying something more sophisticated. You may want to over-ride with
|
59
|
+
# something simpler, or something better suited to local policies and conditions.
|
60
|
+
def should_highlight_section?(umlaut_request, section_id, response_list)
|
61
|
+
case section_id
|
62
|
+
when "fulltext"
|
63
|
+
umlaut_request.get_service_type("fulltext").present?
|
64
|
+
when "holding"
|
65
|
+
umlaut_request.get_service_type("holding").present? && umlaut_request.get_service_type("fulltext").empty?
|
66
|
+
when "document_delivery"
|
67
|
+
# Only once fulltext and holdings are done being fetched.
|
68
|
+
# If there's no fulltext or holdings, OR there's holdings, but
|
69
|
+
# it's a journal type thing, where we probably don't know if the
|
70
|
+
# particular volume/issue wanted is present.
|
71
|
+
umlaut_request.get_service_type("fulltext").empty? &&
|
72
|
+
(! umlaut_request.service_types_in_progress?(["fulltext", "holding"])) && (
|
73
|
+
umlaut_request.get_service_type("holding").empty? ||
|
74
|
+
umlaut_request.referent.format == "journal"
|
75
|
+
)
|
31
76
|
end
|
32
|
-
|
33
|
-
|
34
|
-
render(:partial => "section_display",
|
35
|
-
:locals =>
|
36
|
-
{:presenter => presenter } )
|
37
77
|
end
|
38
78
|
|
39
|
-
|
40
79
|
def app_name
|
41
80
|
return umlaut_config.app_name
|
42
81
|
end
|
43
82
|
|
44
|
-
|
45
83
|
# size can be 'small', 'medium', or 'large.
|
46
|
-
# returns a ServiceResponse object, or nil.
|
84
|
+
# returns a ServiceResponse object, or nil.
|
47
85
|
def cover_image_response(size='medium')
|
48
86
|
cover_images = get_service_type('cover_image')
|
49
87
|
cover_images.each do |service_response|
|
50
|
-
return service_response if service_response.service_data[:size] == size
|
88
|
+
return service_response if service_response.service_data[:size] == size
|
51
89
|
end
|
52
90
|
return nil
|
53
91
|
end
|
54
92
|
|
55
|
-
|
56
|
-
|
57
93
|
# Did this come from citation linker style entry?
|
58
|
-
# We check the referrer.
|
94
|
+
# We check the referrer.
|
59
95
|
def user_entered_citation?(uml_request)
|
60
96
|
return false unless uml_request && uml_request.referrer_id
|
61
|
-
|
62
97
|
id = uml_request.referrer_id
|
63
98
|
return id == 'info:sid/sfxit.com:citation' || id == umlaut_config.lookup("rfr_ids.citation") || id == umlaut_config.lookup('rfr_ids.opensearch')
|
64
99
|
end
|
@@ -66,80 +101,58 @@ module ResolveHelper
|
|
66
101
|
def display_not_found_warning?(uml_request)
|
67
102
|
metadata = uml_request.referent.metadata
|
68
103
|
display_manually_entered_typo_warning = umlaut_config.lookup!("entry_not_in_kb_warning", false)
|
69
|
-
|
70
|
-
return (metadata['genre'] != 'book' && metadata['object_id'].blank? && user_entered_citation?(@user_request) && display_manually_entered_typo_warning)
|
104
|
+
return (metadata['genre'] != 'book' && metadata['object_id'].blank? && user_entered_citation?(@user_request) && display_manually_entered_typo_warning)
|
71
105
|
end
|
72
106
|
|
73
|
-
|
74
107
|
# Generate content in an expand-contract block, with a heading that
|
75
108
|
# you can click on to show/hide it. Actual content in block.
|
76
109
|
# Example, in view:
|
77
110
|
# <% expand_contract_section("My Content", "div_id_to_use") do %>
|
78
111
|
# this will be hidden and shown
|
79
112
|
# <% end %>
|
80
|
-
def expand_contract_section(arg_heading, id, options={}, &block)
|
113
|
+
def expand_contract_section(arg_heading, id, options={}, &block)
|
81
114
|
expanded = (params["umlaut.show_#{id}"] == "true") || options[:initial_expand] || false
|
82
|
-
|
83
|
-
icon = image_tag( ( expanded ? "list_open.png" : "list_closed.png"),
|
84
|
-
:alt => "",
|
85
|
-
:class => "toggle_icon",
|
86
|
-
:border => "0")
|
115
|
+
icon = content_tag(:i, nil, :class => [] << ( expanded ? "umlaut_icons-list-open" : "umlaut_icons-list-closed"))
|
87
116
|
heading = content_tag(:span,( expanded ? "Hide " : "Show "), :class=>'expand_contract_action_label') + arg_heading
|
88
|
-
|
117
|
+
body_class = (expanded ? "in" : "")
|
89
118
|
link_params = params.merge('umlaut.request_id' => @user_request.id,
|
90
|
-
"umlaut.show_#{id}" => (! expanded).to_s
|
91
|
-
|
119
|
+
"umlaut.show_#{id}" => (! expanded).to_s,
|
92
120
|
# Need to zero out format-related params for when we're coming
|
93
121
|
# from a partial html api request, so the link we generate
|
94
|
-
# is not to format json/xml/etc.
|
95
|
-
:format => nil,
|
122
|
+
# is not to format json/xml/etc.
|
123
|
+
:format => nil,
|
96
124
|
'umlaut.response_format' => nil,
|
97
125
|
'umlaut.jsonp'=>nil,
|
98
|
-
|
99
126
|
# In Rails3, an :anchor param will actually be used for #fragmentIdentifier
|
100
127
|
# on end of url
|
101
128
|
:anchor => "#{id}_toggle_link"
|
102
129
|
)
|
103
|
-
|
104
130
|
# Make sure a self-referencing link from partial_html_sections
|
105
131
|
# really goes to full HTML view.
|
106
132
|
link_params[:action] = "index" if link_params[:action] == "partial_html_sections"
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
:class => "expand_contract_toggle" ) + "\n" +
|
114
|
-
content_tag(:div, :id => id,
|
115
|
-
:class => "expand_contract_content",
|
116
|
-
:style => ("display: none;" unless expanded),
|
117
|
-
&block)
|
118
|
-
end
|
119
|
-
end
|
120
|
-
|
133
|
+
return content_tag(:div, :class => "collapsible", :id => "collapse_#{id}") do
|
134
|
+
link_to(icon + " " + heading, link_params, :class => "collapse-toggle", "data-target" => "##{id}", "data-toggle" => "collapse") +
|
135
|
+
content_tag(:div, :id => id, :class => ["collapse"]<< body_class, &block)
|
136
|
+
end
|
137
|
+
end
|
138
|
+
|
121
139
|
# If response has a :content key returns it -- and marks it html_safe
|
122
|
-
# if response has a :content_html_safe == true key.
|
123
|
-
# returns false if no :content.
|
140
|
+
# if response has a :content_html_safe == true key.
|
141
|
+
# returns false if no :content.
|
124
142
|
def response_content(service_response)
|
125
143
|
content = service_response[:content]
|
126
144
|
return false unless content
|
127
|
-
|
128
145
|
content = content.html_safe if service_response[:content_html_safe] == true
|
129
|
-
|
130
146
|
return content
|
131
147
|
end
|
132
|
-
|
133
|
-
|
134
|
-
|
135
148
|
|
136
149
|
# Code-generating helper to add a "More" link to a list, with a maximum
|
137
150
|
# number of items to show before 'more'. AJAXy show, with unobtrusive
|
138
|
-
# degredation when no javascript.
|
151
|
+
# degredation when no javascript.
|
139
152
|
# Based on the idea here for a helper that takes a block. Uses
|
140
153
|
# expand_contract_section for actual hidden overflow. Will split list
|
141
154
|
# into two different <ul>'s, one before the cut and one after. Will generate
|
142
|
-
# <ul> tags itself.
|
155
|
+
# <ul> tags itself.
|
143
156
|
# http://blog.zmok.net/articles/2008/04/22/block-level-helpers-in-ruby-on-rails
|
144
157
|
#
|
145
158
|
# id: id to use for HTML div for hidden part of list. Other ids
|
@@ -149,7 +162,7 @@ module ResolveHelper
|
|
149
162
|
# at least two items will always be included in 'more'. If cutoff
|
150
163
|
# is 5 and your list is 5, all 5 will be shown. If cut-off is 5
|
151
164
|
# and list is 6, 4 items will be shown, with more. This is five
|
152
|
-
# total lines if the 'more' is considered a line.
|
165
|
+
# total lines if the 'more' is considered a line.
|
153
166
|
# block: will be passed |item, index|, should generate html for that
|
154
167
|
# item in block.
|
155
168
|
#
|
@@ -158,50 +171,45 @@ module ResolveHelper
|
|
158
171
|
# <li>Item Number: <%= index %>: <%= item.title %></li>
|
159
172
|
# <% end %>
|
160
173
|
def list_with_limit(id, list, options = {}, &block)
|
161
|
-
|
162
174
|
# backwards compatible to when third argument was just a number
|
163
|
-
# for limit.
|
164
|
-
options = {:limit => options} unless options.kind_of?(Hash)
|
175
|
+
# for limit.
|
176
|
+
options = {:limit => options} unless options.kind_of?(Hash)
|
165
177
|
options[:limit] ||= 5
|
166
|
-
|
167
178
|
return "" if list.empty?
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
if (
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
179
|
+
visible_list = (list.length > options[:limit]) ? list.slice(0, options[:limit]-1) : list
|
180
|
+
hidden_list = (list.length > options[:limit]) ? list.slice((options[:limit]-1)..list.length-1) : []
|
181
|
+
parts =[]
|
182
|
+
parts << content_tag(:ul, :class => options[:ul_class]) do
|
183
|
+
safe_join(
|
184
|
+
visible_list.enum_for(:each_with_index).collect do |item, index|
|
185
|
+
yield(item, index)
|
186
|
+
end, " \n "
|
187
|
+
)
|
188
|
+
end
|
189
|
+
if (hidden_list.present?)
|
190
|
+
parts << expand_contract_section("#{hidden_list.length} more", id) do
|
191
|
+
content_tag(:ul, :class=>options[:ul_class]) do
|
192
|
+
safe_join(
|
193
|
+
hidden_list.enum_for(:each_with_index).collect do |item, index|
|
194
|
+
yield(item, index + options[:limit])
|
195
|
+
end, " \n "
|
196
|
+
)
|
197
|
+
end
|
186
198
|
end
|
187
199
|
end
|
188
|
-
|
189
|
-
return content
|
200
|
+
return safe_join(parts, "\n")
|
190
201
|
end
|
191
202
|
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
##
|
203
|
+
##
|
196
204
|
# Methods to grab SectionRenderer definitions from config. Caching in
|
197
|
-
# class-level variables.
|
205
|
+
# class-level variables.
|
198
206
|
#
|
199
207
|
@@bg_update_sections = nil
|
200
208
|
@@partial_update_sections = nil
|
201
|
-
|
209
|
+
|
202
210
|
# Called by background updater to get a list of all sections configured
|
203
211
|
# in application config parameter resolve_sections to be included in
|
204
|
-
# background updates.
|
212
|
+
# background updates.
|
205
213
|
def bg_update_sections
|
206
214
|
unless (@@bg_update_sections)
|
207
215
|
@@bg_update_sections = umlaut_config.lookup!("resolve_sections", []).find_all do |section|
|
@@ -212,7 +220,7 @@ module ResolveHelper
|
|
212
220
|
end
|
213
221
|
|
214
222
|
# Called by partial_html_sections action to get a list of all sections
|
215
|
-
# that should be included in the partial_html_sections api response.
|
223
|
+
# that should be included in the partial_html_sections api response.
|
216
224
|
def partial_html_sections
|
217
225
|
unless (@@partial_update_sections)
|
218
226
|
@@partial_update_sections = umlaut_config.lookup!("resolve_sections", []).find_all do |section|
|
@@ -224,18 +232,40 @@ module ResolveHelper
|
|
224
232
|
|
225
233
|
# Called by resolve/index view to find sections configured
|
226
234
|
# in application config resolve_sections list for a specific
|
227
|
-
# part of the page. :main, :sidebar, or :resource_info.
|
235
|
+
# part of the page. :main, :sidebar, or :resource_info.
|
228
236
|
def html_sections(area)
|
229
237
|
umlaut_config.lookup!("resolve_sections", []).find_all do |section|
|
230
238
|
section[:html_area] == area
|
231
239
|
end
|
232
240
|
end
|
233
|
-
|
241
|
+
|
234
242
|
def html_section_by_div_id(div_id)
|
235
243
|
umlaut_config.lookup!("resolve_sections", []).find do |defn|
|
236
244
|
defn[:div_id] == div_id
|
237
245
|
end
|
238
246
|
end
|
239
|
-
|
240
|
-
|
241
|
-
|
247
|
+
|
248
|
+
def item_icon(section_id)
|
249
|
+
sections_with_icons = ["fulltext", "audio", "excerpts"]
|
250
|
+
content_tag(:i, nil) if sections_with_icons.include? section_id
|
251
|
+
end
|
252
|
+
|
253
|
+
##
|
254
|
+
# Outputs "yyyy - yyyy" coverage summary, with html tags, IF coverage
|
255
|
+
# dates are available, it is a title-level request, and we're configured
|
256
|
+
# to show with config resolve_display.show_coverage_summary
|
257
|
+
def coverage_summary(response)
|
258
|
+
unless (@user_request.title_level_citation? &&
|
259
|
+
umlaut_config.lookup!("resolve_display.show_coverage_summary", false) &&
|
260
|
+
(response[:coverage_begin_date] || response[:coverage_end_date]))
|
261
|
+
return nil
|
262
|
+
end
|
263
|
+
|
264
|
+
start = response[:coverage_begin_date].try(:year) || I18n.t("umlaut.coverage_summary.open_start", :default => "first")
|
265
|
+
finish = response[:coverage_end_date].try(:year) || I18n.t("umlaut.coverage_summary.open_end", :default => "latest")
|
266
|
+
|
267
|
+
content_tag("span", :class=>"coverage_summary") do
|
268
|
+
"#{start} – #{finish}:"
|
269
|
+
end
|
270
|
+
end
|
271
|
+
end
|
@@ -10,9 +10,7 @@ module SearchHelper
|
|
10
10
|
# return an OpenStruct with atitle_label, title_label
|
11
11
|
def referent_labels(context_obj = @current_context_object)
|
12
12
|
ref_meta = context_obj.referent.metadata
|
13
|
-
|
14
13
|
result = OpenStruct.new
|
15
|
-
|
16
14
|
if ref_meta['genre'].blank?
|
17
15
|
case @current_context_object.referent.format
|
18
16
|
when 'book'
|
@@ -37,7 +35,6 @@ module SearchHelper
|
|
37
35
|
result.title = 'Report'
|
38
36
|
end
|
39
37
|
end
|
40
|
-
|
41
38
|
return result
|
42
39
|
end
|
43
40
|
|
@@ -45,6 +42,21 @@ module SearchHelper
|
|
45
42
|
def group_list
|
46
43
|
group_list ||= ('A'..'Z').to_a.push('0-9').push('Other')
|
47
44
|
end
|
48
|
-
|
49
45
|
|
50
|
-
|
46
|
+
# Date dropdowns in search page
|
47
|
+
def date
|
48
|
+
years + months + days
|
49
|
+
end
|
50
|
+
|
51
|
+
def years
|
52
|
+
select_year(nil, {:prompt => true, :start_year => Date.today.year, :end_year => 1950}, {:name => "__year", :class=>"year input-small"})
|
53
|
+
end
|
54
|
+
|
55
|
+
def months
|
56
|
+
select_month(nil, {:prompt => true, :use_short_month => true}, {:name => "__month", :class=>"month input-small"})
|
57
|
+
end
|
58
|
+
|
59
|
+
def days
|
60
|
+
select_day(nil, {:prompt => true}, {:name => "__day", :class=>"day input-small"})
|
61
|
+
end
|
62
|
+
end
|