blacklight 3.0pre1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (170) hide show
  1. data/.gitignore +17 -0
  2. data/.gitmodules +6 -0
  3. data/.yardopts +4 -0
  4. data/Gemfile +4 -0
  5. data/LICENSE +14 -0
  6. data/README.rdoc +168 -0
  7. data/Rakefile +9 -0
  8. data/app/controllers/bookmarks_controller.rb +98 -0
  9. data/app/controllers/feedback_controller.rb +37 -0
  10. data/app/controllers/folder_controller.rb +49 -0
  11. data/app/controllers/saved_searches_controller.rb +45 -0
  12. data/app/controllers/search_history_controller.rb +25 -0
  13. data/app/helpers/blacklight_helper.rb +606 -0
  14. data/app/helpers/bookmarks_helper.rb +3 -0
  15. data/app/helpers/catalog_helper.rb +65 -0
  16. data/app/helpers/feedback_helper.rb +2 -0
  17. data/app/helpers/hash_as_hidden_fields.rb +57 -0
  18. data/app/helpers/render_constraints_helper.rb +120 -0
  19. data/app/helpers/saved_searches_helper.rb +2 -0
  20. data/app/helpers/search_history_helper.rb +2 -0
  21. data/app/models/bookmark.rb +6 -0
  22. data/app/models/record_mailer.rb +43 -0
  23. data/app/models/search.rb +19 -0
  24. data/app/views/_flash_msg.html.erb +6 -0
  25. data/app/views/_user_util_links.html.erb +13 -0
  26. data/app/views/bookmarks/index.html.erb +33 -0
  27. data/app/views/catalog/_bookmark_control.html.erb +25 -0
  28. data/app/views/catalog/_bookmark_form.html.erb +8 -0
  29. data/app/views/catalog/_citation.html.erb +15 -0
  30. data/app/views/catalog/_constraints.html.erb +7 -0
  31. data/app/views/catalog/_constraints_element.html.erb +33 -0
  32. data/app/views/catalog/_did_you_mean.html.erb +10 -0
  33. data/app/views/catalog/_document_list.html.erb +30 -0
  34. data/app/views/catalog/_email_form.html.erb +11 -0
  35. data/app/views/catalog/_facet_limit.html.erb +33 -0
  36. data/app/views/catalog/_facet_pagination.html.erb +28 -0
  37. data/app/views/catalog/_facets.html.erb +9 -0
  38. data/app/views/catalog/_folder_control.html.erb +12 -0
  39. data/app/views/catalog/_home.html.erb +6 -0
  40. data/app/views/catalog/_home_text.html.erb +6 -0
  41. data/app/views/catalog/_index_partials/_default.erb +11 -0
  42. data/app/views/catalog/_marc_view.html.erb +33 -0
  43. data/app/views/catalog/_opensearch_response_metadata.html.erb +3 -0
  44. data/app/views/catalog/_previous_next_doc.html.erb +6 -0
  45. data/app/views/catalog/_refworks_form.html.erb +7 -0
  46. data/app/views/catalog/_results_pagination.html.erb +11 -0
  47. data/app/views/catalog/_search_form.html.erb +14 -0
  48. data/app/views/catalog/_show_partials/_default.html.erb +9 -0
  49. data/app/views/catalog/_show_sidebar.html.erb +1 -0
  50. data/app/views/catalog/_show_tools.html.erb +46 -0
  51. data/app/views/catalog/_sms_form.html.erb +23 -0
  52. data/app/views/catalog/_solr_request.html.erb +5 -0
  53. data/app/views/catalog/_sort_and_per_page.html.erb +20 -0
  54. data/app/views/catalog/_unapi_microformat.html.erb +1 -0
  55. data/app/views/catalog/citation.html.erb +1 -0
  56. data/app/views/catalog/email.erb +1 -0
  57. data/app/views/catalog/endnote.endnote.erb +1 -0
  58. data/app/views/catalog/facet.html.erb +28 -0
  59. data/app/views/catalog/index.atom.builder +108 -0
  60. data/app/views/catalog/index.html.erb +37 -0
  61. data/app/views/catalog/index.rss.builder +19 -0
  62. data/app/views/catalog/librarian_view.html.erb +3 -0
  63. data/app/views/catalog/opensearch.json.erb +0 -0
  64. data/app/views/catalog/opensearch.xml.erb +11 -0
  65. data/app/views/catalog/send_email_record.erb +0 -0
  66. data/app/views/catalog/show.endnote.erb +1 -0
  67. data/app/views/catalog/show.html.erb +42 -0
  68. data/app/views/catalog/show.refworks.erb +1 -0
  69. data/app/views/catalog/sms.erb +1 -0
  70. data/app/views/catalog/unapi.xml.builder +6 -0
  71. data/app/views/feedback/complete.html.erb +3 -0
  72. data/app/views/feedback/show.html.erb +20 -0
  73. data/app/views/folder/_tools.html.erb +23 -0
  74. data/app/views/folder/index.html.erb +44 -0
  75. data/app/views/layouts/blacklight.html.erb +49 -0
  76. data/app/views/record_mailer/email_record.erb +6 -0
  77. data/app/views/record_mailer/sms_record.erb +4 -0
  78. data/app/views/saved_searches/index.html.erb +27 -0
  79. data/app/views/search_history/index.html.erb +23 -0
  80. data/blacklight.gemspec +50 -0
  81. data/config.ru +4 -0
  82. data/config/routes.rb +54 -0
  83. data/db/seeds.rb +7 -0
  84. data/features/generators.feature +77 -0
  85. data/features/support/aruba.rb +9 -0
  86. data/install.rb +0 -0
  87. data/install/solr.yml +8 -0
  88. data/lib/blacklight.rb +121 -0
  89. data/lib/blacklight/catalog.rb +311 -0
  90. data/lib/blacklight/comma_link_renderer.rb +27 -0
  91. data/lib/blacklight/configurable.rb +46 -0
  92. data/lib/blacklight/controller.rb +121 -0
  93. data/lib/blacklight/engine.rb +32 -0
  94. data/lib/blacklight/exceptions.rb +13 -0
  95. data/lib/blacklight/marc.rb +46 -0
  96. data/lib/blacklight/marc/citation.rb +251 -0
  97. data/lib/blacklight/search_fields.rb +107 -0
  98. data/lib/blacklight/solr.rb +7 -0
  99. data/lib/blacklight/solr/document.rb +239 -0
  100. data/lib/blacklight/solr/document/dublin_core.rb +40 -0
  101. data/lib/blacklight/solr/document/email.rb +15 -0
  102. data/lib/blacklight/solr/document/marc.rb +84 -0
  103. data/lib/blacklight/solr/document/marc_export.rb +430 -0
  104. data/lib/blacklight/solr/document/sms.rb +13 -0
  105. data/lib/blacklight/solr/facet_paginator.rb +93 -0
  106. data/lib/blacklight/solr_helper.rb +413 -0
  107. data/lib/blacklight/user.rb +55 -0
  108. data/lib/blacklight/version.rb +3 -0
  109. data/lib/colorize.rb +196 -0
  110. data/lib/generators/blacklight/blacklight_generator.rb +134 -0
  111. data/lib/generators/blacklight/templates/SolrMarc.jar +0 -0
  112. data/lib/generators/blacklight/templates/catalog_controller.rb +8 -0
  113. data/lib/generators/blacklight/templates/config/SolrMarc/config-test.properties +37 -0
  114. data/lib/generators/blacklight/templates/config/SolrMarc/config.properties +37 -0
  115. data/lib/generators/blacklight/templates/config/SolrMarc/index.properties +97 -0
  116. data/lib/generators/blacklight/templates/config/SolrMarc/index_scripts/dewey.bsh +47 -0
  117. data/lib/generators/blacklight/templates/config/SolrMarc/index_scripts/format.bsh +126 -0
  118. data/lib/generators/blacklight/templates/config/SolrMarc/translation_maps/README_MAPS +1 -0
  119. data/lib/generators/blacklight/templates/config/SolrMarc/translation_maps/callnumber_map.properties +407 -0
  120. data/lib/generators/blacklight/templates/config/SolrMarc/translation_maps/composition_era_map.properties +56 -0
  121. data/lib/generators/blacklight/templates/config/SolrMarc/translation_maps/country_map.properties +379 -0
  122. data/lib/generators/blacklight/templates/config/SolrMarc/translation_maps/format_map.properties +50 -0
  123. data/lib/generators/blacklight/templates/config/SolrMarc/translation_maps/instrument_map.properties +101 -0
  124. data/lib/generators/blacklight/templates/config/SolrMarc/translation_maps/language_map.properties +490 -0
  125. data/lib/generators/blacklight/templates/config/blacklight_config.rb +245 -0
  126. data/lib/generators/blacklight/templates/config/solr.yml +6 -0
  127. data/lib/generators/blacklight/templates/migrations/add_user_types_to_bookmarks_searches.rb +11 -0
  128. data/lib/generators/blacklight/templates/migrations/create_bookmarks.rb +17 -0
  129. data/lib/generators/blacklight/templates/migrations/create_searches.rb +15 -0
  130. data/lib/generators/blacklight/templates/migrations/remove_editable_fields_from_bookmarks.rb +11 -0
  131. data/lib/generators/blacklight/templates/public/images/blacklight/bg.png +0 -0
  132. data/lib/generators/blacklight/templates/public/images/blacklight/border.png +0 -0
  133. data/lib/generators/blacklight/templates/public/images/blacklight/bul_sq_gry.gif +0 -0
  134. data/lib/generators/blacklight/templates/public/images/blacklight/checkmark.gif +0 -0
  135. data/lib/generators/blacklight/templates/public/images/blacklight/logo.png +0 -0
  136. data/lib/generators/blacklight/templates/public/images/blacklight/magnifying_glass.gif +0 -0
  137. data/lib/generators/blacklight/templates/public/images/blacklight/remove.gif +0 -0
  138. data/lib/generators/blacklight/templates/public/images/blacklight/separator.gif +0 -0
  139. data/lib/generators/blacklight/templates/public/images/blacklight/start_over.gif +0 -0
  140. data/lib/generators/blacklight/templates/public/javascripts/blacklight.js +485 -0
  141. data/lib/generators/blacklight/templates/public/javascripts/jquery-1.4.2.min.js +154 -0
  142. data/lib/generators/blacklight/templates/public/javascripts/jquery-ui-1.8.1.custom.min.js +756 -0
  143. data/lib/generators/blacklight/templates/public/stylesheets/blacklight.css +487 -0
  144. data/lib/generators/blacklight/templates/public/stylesheets/jquery/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png +0 -0
  145. data/lib/generators/blacklight/templates/public/stylesheets/jquery/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png +0 -0
  146. data/lib/generators/blacklight/templates/public/stylesheets/jquery/ui-lightness/images/ui-bg_flat_10_000000_40x100.png +0 -0
  147. data/lib/generators/blacklight/templates/public/stylesheets/jquery/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png +0 -0
  148. data/lib/generators/blacklight/templates/public/stylesheets/jquery/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png +0 -0
  149. data/lib/generators/blacklight/templates/public/stylesheets/jquery/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  150. data/lib/generators/blacklight/templates/public/stylesheets/jquery/ui-lightness/images/ui-bg_gloss-wave_35_558fd0_500x100.png +0 -0
  151. data/lib/generators/blacklight/templates/public/stylesheets/jquery/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png +0 -0
  152. data/lib/generators/blacklight/templates/public/stylesheets/jquery/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png +0 -0
  153. data/lib/generators/blacklight/templates/public/stylesheets/jquery/ui-lightness/images/ui-icons_222222_256x240.png +0 -0
  154. data/lib/generators/blacklight/templates/public/stylesheets/jquery/ui-lightness/images/ui-icons_228ef1_256x240.png +0 -0
  155. data/lib/generators/blacklight/templates/public/stylesheets/jquery/ui-lightness/images/ui-icons_2e4f81_256x240.png +0 -0
  156. data/lib/generators/blacklight/templates/public/stylesheets/jquery/ui-lightness/images/ui-icons_ffd27a_256x240.png +0 -0
  157. data/lib/generators/blacklight/templates/public/stylesheets/jquery/ui-lightness/images/ui-icons_ffffff_256x240.png +0 -0
  158. data/lib/generators/blacklight/templates/public/stylesheets/jquery/ui-lightness/jquery-ui-1.8.1.custom.css +486 -0
  159. data/lib/generators/blacklight/templates/public/stylesheets/yui.css +31 -0
  160. data/lib/generators/blacklight/templates/solr_document.rb +30 -0
  161. data/lib/railties/blacklight.rake +66 -0
  162. data/lib/railties/cucumber.rake +53 -0
  163. data/lib/railties/rspec.rake +188 -0
  164. data/lib/railties/solr_marc.rake +148 -0
  165. data/lib/railties/test_solr_server.rb +130 -0
  166. data/spec/helpers/catalog_helper_spec.rb +111 -0
  167. data/spec/views/catalog/_sms_form.html.erb_spec.rb +19 -0
  168. data/tasks/blacklight_tasks.rake +4 -0
  169. data/uninstall.rb +1 -0
  170. metadata +431 -0
@@ -0,0 +1,33 @@
1
+ <%- # local params:
2
+ # label
3
+ # value
4
+ # options =>
5
+ # :remove => url for a remove constraint link
6
+ # :classes => array of classes to add to container span
7
+ options ||= {}
8
+ options[:escape_label] = true unless options.has_key?(:escape_label)
9
+ options[:escape_value] = true unless options.has_key?(:escape_value)
10
+ -%>
11
+
12
+ <span class="appliedFilter constraint <%= options[:classes].join(" ") if options[:classes] %>">
13
+ <%- unless label.blank? -%>
14
+ <span class="filterName"><%= options[:escape_label] ? h(label) : raw(label) %></span>
15
+ <%- end -%>
16
+ <%- unless value.blank? -%>
17
+ <span class="filterValue"><%= options[:escape_value] ? h(value) : raw(value) %></span>
18
+ <%- end -%>
19
+ <%- unless options[:remove].blank? -%>
20
+ <% accessible_remove_label =
21
+ if label.blank?
22
+ "Remove constraint #{options[:escape_value] ? h(value) : value}"
23
+ else
24
+ "Remove constraint #{options[:escape_value] ? h(value) : value}: #{options[:escape_value] ? h(value) : value}"
25
+ end
26
+ %>
27
+ <%= link_to(accessible_remove_label,
28
+ options[:remove],
29
+ :class=>'btnRemove imgReplace',
30
+ :alt=>'remove'
31
+ ) %>
32
+ <%- end -%>
33
+ </span>
@@ -0,0 +1,10 @@
1
+ <% if @response.response[:numFound] <= spell_check_max and @response.spelling.words.size > 0 %>
2
+ <div id="spell">
3
+ <h4 class="suggest"><i>Did you mean to type
4
+ <% @response.spelling.words.each_with_index do |word,index| -%>
5
+ <% if index > 0 -%>, or <% end -%>
6
+ <%= link_to_query(word) -%>
7
+ <% end -%>
8
+ ?</i></h4>
9
+ </div>
10
+ <% end %>
@@ -0,0 +1,30 @@
1
+ <% # container for all documents in index view -%>
2
+ <div id="documents">
3
+
4
+ <% # loop thru each doc -%>
5
+ <% @document_list.each_with_index do |document,counter| %>
6
+
7
+ <% # container for a single doc -%>
8
+ <div class="document <%= render_document_class document %>">
9
+
10
+ <% # header bar for doc items in index view -%>
11
+ <div class="documentHeader">
12
+
13
+ <% # bookmark/folder functions for items/docs -%>
14
+ <%= render_index_doc_actions document %>
15
+
16
+ <% # main title container for doc partial view -%>
17
+ <div class="yui-u">
18
+ <h3 class="index_title"><%= counter + 1 + @response.params[:start].to_i %>. <%= link_to_document document, :label=>document_show_link_field, :counter => (counter + 1 + @response.params[:start].to_i) %></h3>
19
+ </div>
20
+ </div>
21
+
22
+ <% # main container for doc partial view -%>
23
+ <%= render_document_partial document, :index %>
24
+
25
+ <%= render_document_unapi_microformat document %>
26
+
27
+ </div>
28
+
29
+ <% end %>
30
+ </div>
@@ -0,0 +1,11 @@
1
+ <h1>Email This</h1>
2
+ <%= form_tag url_for(:controller => "catalog", :action => "email"), :id => 'email_form', :method => :post do %>
3
+ <%= label_tag(:to, "Email:") %><br/>
4
+ <%= text_field_tag :to %><br/>
5
+ <%= label_tag(:message, "Message:") %><br/>
6
+ <%= text_area_tag :message %><br/>
7
+ <% @documents.each do |doc| %>
8
+ <%=hidden_field_tag "id[]", doc.get(:id)%>
9
+ <% end %>
10
+ <%= submit_tag "Send" %>
11
+ <% end %>
@@ -0,0 +1,33 @@
1
+ <%- # required to pass in local :solr_field
2
+ # optional :display_heading parameter, sometimes set to false
3
+ # by plugins that might re-use this inside something else.
4
+ display_heading = true unless local_assigns.has_key?(:display_heading)
5
+ -%>
6
+
7
+ <% display_facet = @response.facets.detect {|f| f.name == solr_field} -%>
8
+ <% if display_facet && display_facet.items.length > 0 %>
9
+ <% if display_heading %>
10
+ <h3><%= facet_field_labels[solr_field] -%></h3>
11
+ <% end %>
12
+ <ul>
13
+ <% paginator =
14
+ Blacklight::Solr::FacetPaginator.new(display_facet.items,
15
+ :limit => facet_limit_for(solr_field))
16
+ %>
17
+ <% paginator.items.each do |item| -%>
18
+ <li>
19
+ <% if facet_in_params?( solr_field, item.value ) %>
20
+ <%= render_selected_facet_value(solr_field, item) %>
21
+ <% else %>
22
+ <%= render_facet_value(solr_field, item) %>
23
+ <% end -%>
24
+ </li>
25
+ <% end %>
26
+
27
+ <% if(paginator.has_next?) %>
28
+ <li class="more_facets_link"><%= link_to('more »', params.merge(:id => solr_field, :action=>"facet"), :class => "more_facets_link") %></li>
29
+ <% end %>
30
+
31
+ </ul>
32
+ <% end %>
33
+
@@ -0,0 +1,28 @@
1
+ <% if @pagination.has_previous? || @pagination.has_next? %>
2
+ <div class="prev_next_links">
3
+ <% if @pagination.has_previous? -%>
4
+ <%= link_to('« Previous', catalog_facet_path( @pagination.params_for_previous_url( params) ) , :class=>:prev_page) %>
5
+ <% else -%>
6
+ <span class="disabled ui-state-active prev_page">« Previous</span>
7
+ <% end -%>
8
+
9
+ <% if @pagination.has_next? -%>
10
+ <%= link_to('Next »', catalog_facet_path( @pagination.params_for_next_url(params)), :class => :next_page ) %>
11
+ <% else -%>
12
+ <span class="disabled ui-state-active next_page">Next »</span>
13
+ <% end -%>
14
+
15
+ </div>
16
+ <% end %>
17
+
18
+ <div class="sort_options">
19
+ <% if @pagination.sort == 'index' -%>
20
+ <span class="disabled az">A-Z Sort</span><%= link_to_unless(@pagination.sort == 'count', "Numerical Sort",
21
+ @pagination.params_for_resort_url('count', params), :class => "sort_change numeric") %>
22
+ <% elsif @pagination.sort == 'count' -%>
23
+ <%= link_to("A-Z Sort", @pagination.params_for_resort_url('index', params),
24
+ :class => "sort_change az") %><span class="disabled numeric">Numerical Sort</span>
25
+ <% end -%>
26
+ </div>
27
+
28
+
@@ -0,0 +1,9 @@
1
+ <% # main container for facets/limits menu -%>
2
+ <div id="facets" class="facets">
3
+ <h2>Limit your search</h2>
4
+ <% facet_field_names.each do |solr_fname| %>
5
+ <div class="facet_limit blacklight-<%= solr_fname.parameterize %>">
6
+ <%= render_facet_limit(solr_fname) %>
7
+ </div>
8
+ <% end %>
9
+ </div>
@@ -0,0 +1,12 @@
1
+ <%-
2
+ # pass in local :document with a SolrDocument
3
+ method = (item_in_folder?(document[:id]) ? "delete" : "put")
4
+ label = (item_in_folder?(document[:id]) ? "Unselect" : "Select")
5
+ cssClass = (item_in_folder?(document[:id]) ? "deleteFolder" : "addFolder")
6
+ -%>
7
+
8
+ <%= form_tag( folder_path(document[:id]), :method => method, :class=> "folder_toggle #{cssClass}", "data-doc-id" => document[:id], :title=>h(document[document_show_link_field])) do -%>
9
+ <%= hidden_field(:bookmark, :title, :value => document[document_show_link_field]) %>
10
+ <%= submit_tag(label, :class=>"folder_submit", :id => "folder_submit_#{document[:id]}") %>
11
+ <% end %>
12
+
@@ -0,0 +1,6 @@
1
+ <%= render :partial=>'search_form' %>
2
+ <%= render :partial=>'home_text' %>
3
+
4
+ <% sidebar_items << capture do %>
5
+ <%= render :partial=>'facets' %>
6
+ <% end %>
@@ -0,0 +1,6 @@
1
+ <h3>Welcome!</h3>
2
+ <p>To modify this text to your specifications, copy this file located in the blacklight plugin directory:<br/>
3
+ &nbsp;&nbsp;&nbsp;vendor/plugins/blacklight/app/views/catalog/_home_text.html.erb</p>
4
+ <p>to your top level rails app:<br/>
5
+ &nbsp;&nbsp;&nbsp;app/views/catalog/_home_text.html.erb</p>
6
+ Note that you will need to create the 'catalog' directory under views.
@@ -0,0 +1,11 @@
1
+ <%# default partial to display solr document fields in catalog index view -%>
2
+ <dl class="defList">
3
+
4
+ <% index_field_names.each do |solr_fname| -%>
5
+ <% if document.has? solr_fname %>
6
+ <dt class="blacklight-<%= solr_fname.parameterize %>"><%= render_index_field_label :field => solr_fname %></dt>
7
+ <dd class="blacklight-<%= solr_fname.parameterize %>"><%= render_index_field_value :document => document, :field => solr_fname %></dd>
8
+ <% end -%>
9
+ <% end -%>
10
+
11
+ </dl>
@@ -0,0 +1,33 @@
1
+ <h1>Librarian View</h1>
2
+ <div id="marc_view">
3
+ <% fields = @document.to_marc.find_all{|f| ('000'..'999') === f.tag } %>
4
+ <div class="field">LEADER <%= @document.to_marc.leader %></div>
5
+ <%- fields.each do |field| -%>
6
+ <%- unless field.tag.to_s == "940" -%>
7
+ <div class="field">
8
+ <div class="tag_ind">
9
+ <span class="tag">
10
+ <%= h(field.tag) %>
11
+ </span>
12
+ <%- if field.is_a?(MARC::ControlField) -%>
13
+ <span class="control_field_values">
14
+ <%= h(field.value) %>
15
+ </span>
16
+ <%- else -%>
17
+ <div class="ind1">
18
+ <%= !field.indicator1.blank? ? field.indicator1 : "&nbsp;&nbsp;".html_safe -%>
19
+ </div>
20
+ <div class="ind2">
21
+ <%= !field.indicator2.blank? ? field.indicator2 : "&nbsp;&nbsp;".html_safe -%>
22
+ </div>
23
+ </div>
24
+ <div class="subfields">
25
+ <%- field.each do |sub| -%>
26
+ <span class="sub_code"><%= h(sub.code) %>|</span> <%= h(sub.value) %>
27
+ <%- end -%>
28
+ <%- end -%>
29
+ </div>
30
+ </div>
31
+ <%- end-%>
32
+ <%- end -%>
33
+ </div>
@@ -0,0 +1,3 @@
1
+ <%= tag :meta, :name => "totalResults", :content => @response.total %>
2
+ <%= tag :meta, :name => "startIndex", :content => (@response.docs.next_page == 2 ? 1 : @response.docs.previous_page * @response.docs.per_page + 1) %>
3
+ <%= tag :meta, :name => "itemsPerPage", :content => @response.docs.per_page %>
@@ -0,0 +1,6 @@
1
+ <% if @previous_document || @next_document %>
2
+ <div id="previousNextDocument">
3
+ <%= link_to_previous_document(@previous_document) %>
4
+ <%= link_to_next_document(@next_document) %>
5
+ </div>
6
+ <% end %>
@@ -0,0 +1,7 @@
1
+ <%= form_tag "http://www.refworks.com/express/expressimport.asp?vendor=#{application_name}&filter=MARC%20Format&encoding=65001", :name => "refworks", :target => "_blank" do %>
2
+
3
+ <%= hidden_field_tag "ImportData", render_refworks_texts(documents) %>
4
+ <%= submit_tag "Export to Refworks", :class => 'submit'%>
5
+ <%= link_to_function "Export to Refworks", "document.refworks.submit();" %>
6
+ <% end %>
7
+
@@ -0,0 +1,11 @@
1
+ <% if @response.docs.total_pages > 1 %>
2
+ <div class="pagination">
3
+ <% # will_paginate is called oddly because we want next/prev together
4
+ # at left for screen reader accessibility. We use CSS to restore
5
+ # a more conventional next-on-right.
6
+ %>
7
+ <h2>Results navigation</h2>
8
+ <%= will_paginate @response.docs, :page_links => false, :container => false, :renderer => Blacklight::CommaLinkRenderer %>
9
+ <%= will_paginate @response.docs, :next_label => '', :previous_label => '', :class => "page_links", :renderer => Blacklight::CommaLinkRenderer %>
10
+ </div>
11
+ <% end %>
@@ -0,0 +1,14 @@
1
+ <div id="search" class="search">
2
+ <%= form_tag catalog_index_path, :method => :get do %>
3
+ <h2 class="search"><%= label_tag(:q, "Search ") %></h2>
4
+ <%= text_field_tag :q, params[:q], :class => "q" %>
5
+ <%= label_tag(:search_field, " in ") %>
6
+ <%= select_tag(:search_field, options_for_select(search_fields, h(params[:search_field])), :title => "Targeted search options", :class=>"search_field") %>
7
+
8
+ <%= search_as_hidden_fields(:omit_keys => [:q, :search_field, :qt, :page]).html_safe %>
9
+
10
+ <%= submit_tag 'search', :class=>'submit' %>
11
+ <% end %>
12
+
13
+ <hr/>
14
+ </div>
@@ -0,0 +1,9 @@
1
+ <%# default partial to display solr document fields in catalog show view -%>
2
+ <dl class="defList">
3
+ <% document_show_fields.each do |solr_fname| -%>
4
+ <% if document.has? solr_fname %>
5
+ <dt class="blacklight-<%= solr_fname.parameterize %>"><%= render_document_show_field_label :field => solr_fname %></dt>
6
+ <dd class="blacklight-<%= solr_fname.parameterize %>"><%= render_document_show_field_value :document => document, :field => solr_fname %></dd>
7
+ <% end -%>
8
+ <% end -%>
9
+ </dl>
@@ -0,0 +1 @@
1
+ <p><%= link_back_to_catalog %></p>
@@ -0,0 +1,46 @@
1
+ <%-
2
+ # Compare with render_document_functions_partial helper, and
3
+ # _document_functions partial. BL actually has two groups
4
+ # of document-related tools. "document functions" by default
5
+ # contains Bookmark/Folder functionality shown on both results and
6
+ # item view. While "document tools" contains external export type
7
+ # functions by default only on detail.
8
+ -%>
9
+ <ul class="tools">
10
+
11
+ <% if (@document.respond_to?(:export_as_mla_citation_txt) || @document.respond_to?(:export_as_apa_citation_txt)) %>
12
+ <li class="cite">
13
+ <%= link_to "Cite This", citation_catalog_path(:id => @document[:id]), {:id => 'citeLink', :name => 'citation', :class => 'lightboxLink'} %>
14
+ </li>
15
+ <% end %>
16
+
17
+ <% if @document.export_formats.keys.include?( :refworks_marc_txt ) %>
18
+ <li class="refworks">
19
+ <%= link_to "Export to RefWorks", refworks_export_url(@document) %>
20
+ </li>
21
+ <% end %>
22
+
23
+ <% if @document.export_formats.keys.include?( :endnote ) %>
24
+ <li class="endnote">
25
+ <%= link_to "Export to EndNote", catalog_path(@document[:id], :format => 'endnote') %>
26
+ </li>
27
+ <% end %>
28
+
29
+ <% if @document.respond_to?( :to_email_text ) %>
30
+ <li class="email">
31
+ <%= link_to "Email This", email_catalog_path(:id => @document[:id]), {:id => 'emailLink', :name => 'email', :class => 'lightboxLink'} %>
32
+ </li>
33
+ <%- end -%>
34
+ <%- if @document.respond_to?( :to_sms_text ) -%>
35
+ <li class="sms">
36
+ <%= link_to "SMS This", sms_catalog_path(:id => @document[:id]), {:id => 'smsLink', :name => 'sms', :class => 'lightboxLink'} %>
37
+ </li>
38
+ <%- end -%>
39
+
40
+ <% if @document.respond_to?(:to_marc) %>
41
+ <li class="librarian_view">
42
+ <%= link_to "Librarian View", librarian_view_catalog_path(@document[:id]), {:id => 'librarianLink', :name => 'librarian_view', :class => 'lightboxLink'} %>
43
+ </li>
44
+ <% end %>
45
+
46
+ </ul>
@@ -0,0 +1,23 @@
1
+ <% carriers =
2
+ {
3
+ 'AT&T' => 'att',
4
+ 'Verizon' => 'verizon',
5
+ 'T Mobile' => 'tmobile',
6
+ 'Sprint' => 'sprint',
7
+ 'Nextel' => 'nextel',
8
+ 'Virgin Mobile' => 'vmobile',
9
+ 'Alltel' => 'alltel',
10
+ 'Cricket' => 'cricket'
11
+ }
12
+ %>
13
+ <h1>SMS This</h1>
14
+ <%= form_tag url_for(:controller => "catalog", :action => "sms"), :id => 'sms_form', :method => :post do %>
15
+ <%= label_tag(:to, "Phone Number:") %><br/>
16
+ <%= text_field_tag :to %><br/>
17
+ <%= label_tag(:carrier, "Carrier:") %><br/>
18
+ <%= select_tag(:carrier, options_for_select(carriers.to_a.sort.unshift(["Please select your carrier",'']), '')) %><br/>
19
+ <% @documents.each do |doc| %>
20
+ <%=hidden_field_tag "id[]", doc.get(:id)%>
21
+ <% end %>
22
+ <%= submit_tag "Send" %>
23
+ <% end %>
@@ -0,0 +1,5 @@
1
+ <% unless ::Rails.env=='production' %>
2
+ <% @footer = capture do %>
3
+ <div class="solrQuery"><%= URI.decode(@response.header.inspect) %></div>
4
+ <% end %>
5
+ <% end %>
@@ -0,0 +1,20 @@
1
+ <div id="sortAndPerPage">
2
+ <% unless @response.response['numFound'] < 2 %>
3
+ <%-# kind of hacky way to get this to work on catalog and folder controllers. May be able to simple do {:action=>"index"} but I'm not sure -%>
4
+ <%= form_tag params[:controller] == "folder" ? folder_index_path : catalog_index_path, :method=>:get, :class=>'per_page' do %>
5
+ <%= label_tag(:per_page) do %>
6
+ Show <%= select_tag(:per_page, options_for_select(['10', '20', '50', '100'], h(params[:per_page])), :title => "Number of results to display per page") %> per page
7
+ <% end %>
8
+ <%= search_as_hidden_fields(:omit_keys => [:page, :per_page]) %>
9
+ <%= submit_tag 'update' %>
10
+ <% end %>
11
+
12
+ <%-# kind of hacky way to get this to work on catalog and folder controllers. May be able to simple do {:action=>"index"} but I'm not sure -%>
13
+ <%= form_tag params[:controller] == "folder" ? folder_index_path : catalog_index_path, :method=>:get, :class=>'sort', :id => "sort_form" do %>
14
+ <%= label_tag(:sort, "Sort by ") %>
15
+ <%= select_tag(:sort, options_for_select(sort_fields, h(params[:sort]))) %>
16
+ <%= search_as_hidden_fields(:omit_keys => [:page, :sort]) %>
17
+ <%= submit_tag 'sort results' %>
18
+ <% end %>
19
+ <% end %>
20
+ </div>
@@ -0,0 +1 @@
1
+ <%= content_tag :abbr, '', :class => 'unapi-id', :title => document.id %>
@@ -0,0 +1 @@
1
+ <%= render :partial => 'citation' -%>
@@ -0,0 +1 @@
1
+ <%= render :partial => 'email_form' %>
@@ -0,0 +1 @@
1
+ <%= render_endnote_texts(@documents) %>
@@ -0,0 +1,28 @@
1
+ <div class="facet_extended_list">
2
+
3
+ <% sidebar_items << capture do %>
4
+ <p><%= link_back_to_catalog %></p>
5
+ <% end %>
6
+
7
+ <div class="facet_pagination top">
8
+ <%= render :partial=>'facet_pagination' %>
9
+ </div>
10
+
11
+ <h3><%= facet_field_labels[params[:id]] %></h3>
12
+
13
+ <ul class="facet_extended_list">
14
+ <% @pagination.items.each do |item| %>
15
+ <li>
16
+ <% if facet_in_params?( params[:id], item.value ) %>
17
+ <%= render_selected_facet_value(params[:id], item) %>
18
+ <% else %>
19
+ <%= render_facet_value(params[:id], item) %>
20
+ <% end -%>
21
+ </li>
22
+ <% end %>
23
+ </ul>
24
+
25
+ <div class="facet_pagination bottom">
26
+ <%= render :partial=>'facet_pagination' %>
27
+ </div>
28
+ </div>