blacklight 3.1.2 → 3.2.0pre1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (121) hide show
  1. data/.gitignore +5 -2
  2. data/README.md +7 -2
  3. data/VERSION +1 -1
  4. data/app/assets/images/favicon.ico +0 -0
  5. data/app/assets/javascripts/blacklight/blacklight.js +23 -1
  6. data/app/assets/stylesheets/blacklight/_catalog.css.scss +369 -0
  7. data/app/assets/stylesheets/blacklight/_facets.css.scss +117 -0
  8. data/app/assets/stylesheets/blacklight/_folder.css.scss +38 -0
  9. data/app/assets/stylesheets/blacklight/_formatting.css.scss +164 -0
  10. data/app/assets/stylesheets/blacklight/_header.css.scss +36 -0
  11. data/app/assets/stylesheets/blacklight/_layout.css.scss +79 -0
  12. data/app/assets/stylesheets/blacklight/_print.css.scss +54 -0
  13. data/app/assets/stylesheets/blacklight/_search_history.css.scss +44 -0
  14. data/app/assets/stylesheets/blacklight/_susy_framework.css.scss +228 -0
  15. data/app/assets/stylesheets/blacklight/blacklight.css.scss +27 -0
  16. data/app/assets/stylesheets/blacklight/blacklight_defaults.css.scss +48 -0
  17. data/app/controllers/bookmarks_controller.rb +2 -1
  18. data/app/controllers/folder_controller.rb +4 -0
  19. data/app/controllers/saved_searches_controller.rb +4 -0
  20. data/app/controllers/search_history_controller.rb +4 -0
  21. data/app/helpers/blacklight/blacklight_helper_behavior.rb +64 -104
  22. data/app/helpers/blacklight/catalog_helper_behavior.rb +4 -4
  23. data/app/helpers/blacklight/facets_helper_behavior.rb +52 -5
  24. data/app/helpers/blacklight/render_constraints_helper_behavior.rb +14 -59
  25. data/app/helpers/blacklight/search_history_constraints_helper_behavior.rb +56 -0
  26. data/app/helpers/search_history_constraints_helper.rb +3 -0
  27. data/app/models/record_mailer.rb +1 -2
  28. data/app/views/_flash_msg.html.erb +4 -5
  29. data/app/views/_user_util_links.html.erb +3 -1
  30. data/app/views/bookmarks/index.html.erb +2 -2
  31. data/app/views/catalog/_bookmark_control.html.erb +6 -6
  32. data/app/views/catalog/_facet_layout.html.erb +4 -0
  33. data/app/views/catalog/_facet_limit.html.erb +20 -33
  34. data/app/views/catalog/_facets.html.erb +1 -5
  35. data/app/views/catalog/_folder_control.html.erb +5 -5
  36. data/app/views/catalog/_index_default.html.erb +1 -1
  37. data/app/views/catalog/_search_form.html.erb +4 -3
  38. data/app/views/catalog/_show_default.html.erb +1 -1
  39. data/app/views/catalog/_show_tools.html.erb +6 -6
  40. data/app/views/catalog/_sort_and_per_page.html.erb +1 -1
  41. data/app/views/catalog/index.atom.builder +2 -2
  42. data/app/views/catalog/index.rss.builder +1 -1
  43. data/app/views/catalog/opensearch.xml.builder +10 -0
  44. data/app/views/catalog/show.html.erb +1 -1
  45. data/app/views/folder/_tools.html.erb +4 -4
  46. data/app/views/layouts/blacklight.html.erb +25 -37
  47. data/app/views/record_mailer/email_record.text.erb +1 -1
  48. data/app/views/record_mailer/sms_record.text.erb +2 -2
  49. data/app/views/search_history/index.html.erb +1 -1
  50. data/blacklight.gemspec +11 -9
  51. data/lib/{generators/blacklight/templates/SolrMarc.jar → SolrMarc.jar} +0 -0
  52. data/lib/blacklight.rb +5 -3
  53. data/lib/blacklight/catalog.rb +3 -4
  54. data/lib/blacklight/configurable.rb +54 -39
  55. data/lib/blacklight/configuration.rb +126 -0
  56. data/lib/blacklight/configuration/fields.rb +142 -0
  57. data/lib/blacklight/configuration/search_field.rb +12 -0
  58. data/lib/blacklight/configuration/solr_field.rb +12 -0
  59. data/lib/blacklight/configuration/sort_field.rb +17 -0
  60. data/lib/blacklight/controller.rb +16 -14
  61. data/lib/blacklight/engine.rb +1 -1
  62. data/lib/blacklight/global_configurable.rb +46 -0
  63. data/lib/blacklight/search_fields.rb +21 -54
  64. data/lib/blacklight/solr/document.rb +13 -3
  65. data/lib/blacklight/solr_helper.rb +88 -52
  66. data/lib/blacklight/utils.rb +18 -0
  67. data/lib/generators/blacklight/assets_generator.rb +14 -20
  68. data/lib/generators/blacklight/blacklight_generator.rb +14 -6
  69. data/lib/generators/blacklight/jetty_generator.rb +1 -1
  70. data/lib/generators/blacklight/templates/assets/standard.css.scss +51 -0
  71. data/lib/generators/blacklight/templates/catalog_controller.rb +148 -0
  72. data/lib/generators/blacklight/templates/config/blacklight_config.rb +2 -239
  73. data/lib/generators/blacklight/templates/config/sass.rb +5 -0
  74. data/lib/generators/blacklight/templates/solr_conf/schema.xml +514 -164
  75. data/lib/generators/blacklight/templates/solr_conf/solrconfig.xml +1591 -323
  76. data/lib/generators/blacklight/templates/solr_document.rb +2 -0
  77. data/lib/railties/all_tests.rake +36 -3
  78. data/lib/railties/blacklight_cucumber.rake +6 -4
  79. data/lib/railties/blacklight_rspec.rake +5 -4
  80. data/test_support/bin/run-tests.sh +2 -13
  81. data/test_support/bin/test.sh +30 -23
  82. data/test_support/features/did_you_mean.feature +14 -13
  83. data/test_support/features/step_definitions/saved_searches_steps.rb +1 -1
  84. data/test_support/features/step_definitions/search_steps.rb +4 -4
  85. data/test_support/spec/controllers/application_controller_spec.rb +3 -13
  86. data/test_support/spec/controllers/catalog_controller_spec.rb +102 -24
  87. data/test_support/spec/controllers/folder_controller_spec.rb +7 -1
  88. data/test_support/spec/helpers/blacklight_helper_spec.rb +45 -34
  89. data/test_support/spec/helpers/facets_helper_spec.rb +68 -0
  90. data/test_support/spec/helpers/html_head_helper_spec.rb +37 -0
  91. data/test_support/spec/helpers/{render_constraints_helper_spec.rb → search_history_constraints_helper_spec.rb} +26 -7
  92. data/test_support/spec/lib/blacklight_configurable_spec.rb +92 -0
  93. data/test_support/spec/lib/blacklight_configuration_spec.rb +295 -0
  94. data/test_support/spec/lib/{configurable_spec.rb → global_configurable_spec.rb} +2 -2
  95. data/test_support/spec/lib/search_fields_spec.rb +26 -29
  96. data/test_support/spec/{helpers → lib}/solr_helper_spec.rb +268 -287
  97. data/test_support/spec/lib/tasks/solr_marc_task_spec.rb +1 -1
  98. data/test_support/spec/lib/utils_spec.rb +58 -0
  99. data/test_support/spec/models/solr_docment_spec.rb +4 -8
  100. data/test_support/spec/views/catalog/_facets.html.erb_spec.rb +27 -170
  101. data/test_support/spec/views/catalog/_index_default.erb_spec.rb +38 -20
  102. data/test_support/spec/views/catalog/_show_default.erb_spec.rb +38 -19
  103. data/test_support/spec/views/catalog/index.atom.builder_spec.rb +19 -1
  104. metadata +148 -145
  105. data/app/assets/stylesheets/blacklight/blacklight.css +0 -493
  106. data/app/assets/stylesheets/yui.css +0 -31
  107. data/app/views/catalog/opensearch.xml.erb +0 -11
  108. data/doc/Atom-Responses.md +0 -90
  109. data/doc/CUSTOMIZING.md +0 -121
  110. data/doc/Extending-blacklight-with-the-document-extension-framework.md +0 -1
  111. data/doc/Extending-or-Modifying-Blacklight-Search-Behavior.md +0 -131
  112. data/doc/Features.md +0 -147
  113. data/doc/Integration-with-Rails-Footnotes.md +0 -20
  114. data/doc/Pagination.md +0 -38
  115. data/doc/Quickstart.md +0 -97
  116. data/doc/Upgrading-Guide.md +0 -98
  117. data/doc/User-Authentication.md +0 -54
  118. data/doc/Using-a-custom-solr-uniquekey-field.md +0 -36
  119. data/lib/blacklight/comma_link_renderer.rb +0 -28
  120. data/lib/railties/jetty_solr_server.rb +0 -108
  121. data/test_support/spec/views/catalog/show.html.erb_spec.rb +0 -101
@@ -1,101 +0,0 @@
1
- # -*- encoding : utf-8 -*-
2
- require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
3
-
4
- describe "/catalog/show.html.erb" do
5
-
6
- include Blacklight::SolrHelper
7
-
8
- before(:each) do
9
- # get actual solr response
10
- all_docs_query = {}
11
- (@solr_resp, @document_list) = get_search_results(all_docs_query)
12
- @document = @document_list.first
13
- adfadf
14
-
15
-
16
- # TODO: should probably not have id field name hardcoded
17
- @div_doc_id = 'div[id=doc_' + @document.id + ']'
18
-
19
- assigns[:response] = @solr_resp
20
- assigns[:document_list] = @document_list
21
- assigns[:document] = @document
22
-
23
- @previousDocument = mock("prev_doc")
24
- @previousDocument.should_receive(:id).and_return("abc")
25
- @nextDocument = mock("next_doc")
26
- @nextDocument.should_receive(:id).and_return("xyz")
27
- assigns[:previous_document] = @previousDocument
28
- assigns[:next_document] = @nextDocument
29
-
30
- session[:search] = {:q => "query", :f => "facets", :per_page => "10", :page => "2"}
31
- render 'catalog/show'
32
- end
33
-
34
- html_title_field = Blacklight.config[:show][:html_title]
35
- doc_heading_field = Blacklight.config[:show][:heading]
36
- # so far, only default display type in plugin
37
- display_type_field = Blacklight.config[:show][:display_type]
38
- # There is a problem with link_to and rspec-rails. See:
39
- # http://www.nabble.com/Rails:-View-specs-and-implicit-parameters-in-link_to()-td20011051.html
40
- # This spec will run cleanly if the implicit routes are added to the plugin
41
- # level routes.rb file: (at the bottom of the file)
42
- #
43
- # map.connect ':controller/:action/:id'
44
- # map.connect ':controller/:action/:id.:format'
45
-
46
- # If someone can find a better workaround, that would be mega-spiffy. (Cuke anybody?)
47
- #
48
- # For now, I am commenting out this spec because I'm not sure if adding those
49
- # routes will affect anything else. Similar comments are in routes.rb
50
- # - Jessie 2009-04-20 (ALSO affects _facets.html.erb_spec.rb)
51
- =begin
52
- it "should have text for html title field specified in the initializer: " + html_title_field do
53
- @document[html_title_field].should_not be_nil
54
- end
55
-
56
- it "should have a div containing the document id" do
57
- @solr_resp.should have_selector(@div_doc_id)
58
- end
59
-
60
- # TODO: re-write this. --bess
61
- # TODO: should NOT have h2 hardcoded for document heading field.
62
- it "should have an h2 matching contents of heading field specified in the initializer: " + doc_heading_field do
63
- @solr_resp.should have_selector(@div_doc_id)
64
- with_tag('h2', {:text => @document[doc_heading_field]})
65
- end
66
-
67
- # TODO: re-write this. --bess
68
- it "should have some displayed field values" do
69
- @solr_resp.should have_selector('div[class=row]')
70
- with_tag('dt', {:text => /\S+/})
71
- with_tag('dd', {:text => /\S+/})
72
- end
73
-
74
-
75
- # Previous and Next Links
76
- it "should have previousNextDocument div" do
77
- response.should have_selector("div[id=previousNextDocument]")
78
- end
79
- =end
80
- # TODO: tests that need writing?
81
- =begin
82
- # Previous and Next Links
83
- it "should have a next link" do
84
- 't'.should == 'f'
85
- end
86
- it "should not have a next link if it's the last document" do
87
- 't'.should == 'f'
88
- end
89
- it "should have a previous link" do
90
- 't'.should == 'f'
91
- end
92
- it "should not have a previous link if it's the first document" do
93
- 't'.should == 'f'
94
- end
95
-
96
- it "should have a back-to-search-results link" do
97
- 't'.should == 'f'
98
- end
99
- =end
100
-
101
- end