hydra-core 5.0.0.pre1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (105) hide show
  1. data/.gitignore +2 -0
  2. data/Rakefile +5 -0
  3. data/app/helpers/blacklight_helper.rb +4 -0
  4. data/app/helpers/facets_helper.rb +4 -0
  5. data/app/helpers/hydra/blacklight_helper_behavior.rb +36 -0
  6. data/app/helpers/hydra/facets_helper_behavior.rb +25 -0
  7. data/app/models/hydra/datastream/properties.rb +24 -0
  8. data/app/models/mods_asset.rb +25 -0
  9. data/app/views/_flash_msg.html.erb +5 -0
  10. data/app/views/catalog/_citation.html.erb +11 -0
  11. data/app/views/catalog/_constraints_element.html.erb +34 -0
  12. data/app/views/catalog/_delete_partials/_default.html.erb +22 -0
  13. data/app/views/catalog/_edit_partials/_default.html.erb +57 -0
  14. data/app/views/catalog/_edit_partials/_default_details.html.erb +13 -0
  15. data/app/views/catalog/_facets.html.erb +37 -0
  16. data/app/views/catalog/_home.html.erb +6 -0
  17. data/app/views/catalog/_home_text.html.erb +4 -0
  18. data/app/views/catalog/_index_partials/_default.html.erb +20 -0
  19. data/app/views/catalog/_index_partials/_default_details.html.erb +14 -0
  20. data/app/views/catalog/_opensearch_response_metadata.html.erb +2 -0
  21. data/app/views/catalog/_show_partials/_default.html.erb +21 -0
  22. data/app/views/catalog/_show_partials/_default_details.html.erb +15 -0
  23. data/app/views/catalog/_show_partials/_facets.html.erb +52 -0
  24. data/app/views/catalog/_sms_form.html.erb +21 -0
  25. data/app/views/catalog/_sort_and_per_page.html.erb +23 -0
  26. data/app/views/catalog/_uva_tabs.html.erb +10 -0
  27. data/app/views/catalog/about.html.erb +0 -0
  28. data/app/views/catalog/show.html.erb +40 -0
  29. data/app/views/layouts/hydra-head.html.erb +47 -0
  30. data/config/jetty.yml +6 -0
  31. data/config/locales/hydra.en.yml +7 -0
  32. data/hydra-core.gemspec +40 -0
  33. data/lib/application_helper.rb +3 -0
  34. data/lib/generators/hydra/assets_generator.rb +50 -0
  35. data/lib/generators/hydra/cucumber_support_generator.rb +29 -0
  36. data/lib/generators/hydra/head_generator.rb +160 -0
  37. data/lib/generators/hydra/hyhead_fixtures_generator.rb +27 -0
  38. data/lib/generators/hydra/templates/catalog_controller.rb +162 -0
  39. data/lib/generators/hydra/templates/config/fedora.yml +14 -0
  40. data/lib/generators/hydra/templates/config/initializers/action_dispatch_http_upload_monkey_patch.rb +12 -0
  41. data/lib/generators/hydra/templates/config/initializers/hydra_config.rb +39 -0
  42. data/lib/generators/hydra/templates/config/role_map_cucumber.yml +10 -0
  43. data/lib/generators/hydra/templates/config/role_map_development.yml +12 -0
  44. data/lib/generators/hydra/templates/config/role_map_production.yml +2 -0
  45. data/lib/generators/hydra/templates/config/role_map_test.yml +15 -0
  46. data/lib/generators/hydra/templates/config/solr.yml +10 -0
  47. data/lib/generators/hydra/templates/config/solr_mappings.yml +22 -0
  48. data/lib/generators/hydra/templates/fedora_conf/conf/development/fedora.fcfg +946 -0
  49. data/lib/generators/hydra/templates/fedora_conf/conf/test/fedora.fcfg +946 -0
  50. data/lib/generators/hydra/templates/solr_conf/conf/schema.xml +692 -0
  51. data/lib/generators/hydra/templates/solr_conf/conf/solrconfig.xml +1887 -0
  52. data/lib/generators/hydra/templates/solr_conf/solr.xml +35 -0
  53. data/lib/hydra-core.rb +1 -0
  54. data/lib/hydra-head.rb +27 -0
  55. data/lib/hydra-head/engine.rb +14 -0
  56. data/lib/hydra-head/routes.rb +90 -0
  57. data/lib/hydra-head/version.rb +4 -0
  58. data/lib/hydra.rb +30 -0
  59. data/lib/hydra/catalog.rb +11 -0
  60. data/lib/hydra/controller.rb +25 -0
  61. data/lib/hydra/controller/controller_behavior.rb +39 -0
  62. data/lib/hydra/controller/repository_controller_behavior.rb +78 -0
  63. data/lib/hydra/controller/upload_behavior.rb +139 -0
  64. data/lib/hydra/global_configurable.rb +46 -0
  65. data/lib/hydra/model_methods.rb +109 -0
  66. data/lib/hydra/model_mixins/common_metadata.rb +25 -0
  67. data/lib/hydra/model_mixins/solr_document_extension.rb +24 -0
  68. data/lib/hydra/models/file_asset.rb +76 -0
  69. data/lib/hydra/repository_controller.rb +28 -0
  70. data/lib/hydra/solr.rb +9 -0
  71. data/lib/railties/active-fedora.rake +1 -0
  72. data/lib/railties/hydra-fixtures.rake +50 -0
  73. data/lib/railties/hydra_jetty.rake +53 -0
  74. data/spec/.gitignore +1 -0
  75. data/spec/controllers/catalog_controller_spec.rb +101 -0
  76. data/spec/controllers/catalog_valid_html_spec.rb +114 -0
  77. data/spec/factories.rb +11 -0
  78. data/spec/helpers/blacklight_helper_spec.rb +15 -0
  79. data/spec/helpers/facets_helper_spec.rb +15 -0
  80. data/spec/lib/catalog_spec.rb +16 -0
  81. data/spec/lib/global_configurable_spec.rb +98 -0
  82. data/spec/lib/model_methods_spec.rb +29 -0
  83. data/spec/lib/repository_controller_behavior_spec.rb +28 -0
  84. data/spec/models/mods_asset_spec.rb +21 -0
  85. data/spec/models/solr_document_spec.rb +17 -0
  86. data/spec/models/user_spec.rb +32 -0
  87. data/spec/rcov.opts +3 -0
  88. data/spec/spec.opts +4 -0
  89. data/spec/spec_helper.rb +26 -0
  90. data/spec/support/Gemfile +12 -0
  91. data/spec/support/app/models/generic_content.rb +23 -0
  92. data/spec/support/app/models/sample.rb +33 -0
  93. data/spec/support/app/models/solr_document.rb +5 -0
  94. data/spec/support/db/migrate/20111101221803_create_searches.rb +16 -0
  95. data/spec/support/lib/generators/test_app_generator.rb +33 -0
  96. data/spec/support/matchers/helper_matcher.rb +14 -0
  97. data/spec/support/matchers/solr_matchers.rb +60 -0
  98. data/spec/support/spec/fixtures/hydra_test_generic_content.foxml.xml +138 -0
  99. data/spec/support/spec/fixtures/hydrangea_fixture_mods_article1.foxml.xml +234 -0
  100. data/spec/unit/hydra-head-engine_spec.rb +8 -0
  101. data/spec/unit/hydra-head_spec.rb +8 -0
  102. data/tasks/hydra-head-fixtures.rake +58 -0
  103. data/tasks/hydra_jetty.rake +53 -0
  104. data/tasks/rspec.rake +53 -0
  105. metadata +469 -0
@@ -0,0 +1,2 @@
1
+ tmp/
2
+ Gemfile.lock
@@ -0,0 +1,5 @@
1
+ require 'rake/testtask'
2
+ require 'bundler'
3
+ Bundler::GemHelper.install_tasks
4
+
5
+ Dir.glob('tasks/*.rake').each { |r| import r }
@@ -0,0 +1,4 @@
1
+ module BlacklightHelper
2
+ include Hydra::BlacklightHelperBehavior
3
+ end
4
+
@@ -0,0 +1,4 @@
1
+ module FacetsHelper
2
+ include Hydra::FacetsHelperBehavior
3
+
4
+ end
@@ -0,0 +1,36 @@
1
+ module Hydra
2
+ module BlacklightHelperBehavior
3
+ include Blacklight::BlacklightHelperBehavior
4
+
5
+ def document_partial_path_templates
6
+ ["%2$s/%1$s"] + super
7
+ end
8
+
9
+ # Given a Fedora uri, generate a reasonable partial name
10
+ def document_partial_name(document)
11
+ display_type = document[blacklight_config.show.display_type]
12
+
13
+ return 'default' unless display_type
14
+
15
+ display_type.first.gsub(/^[^\/]+\/[^:]+:/,"").underscore.pluralize
16
+ end
17
+
18
+ # COPIED from vendor/plugins/blacklight/app/helpers/application_helper.rb
19
+ # Used in catalog/facet action, facets.rb view, for a click
20
+ # on a facet value. Add on the facet params to existing
21
+ # search constraints. Remove any paginator-specific request
22
+ # params, or other request params that should be removed
23
+ # for a 'fresh' display.
24
+ # Change the action to 'index' to send them back to
25
+ # catalog/index with their new facet choice.
26
+ def add_facet_params_and_redirect(field, value)
27
+ new_params = super
28
+
29
+ # Delete :qt, if needed - added to resolve NPE errors
30
+ new_params.delete(:qt)
31
+
32
+ new_params
33
+ end
34
+
35
+ end
36
+ end
@@ -0,0 +1,25 @@
1
+ module Hydra
2
+ module FacetsHelperBehavior
3
+ include Blacklight::FacetsHelperBehavior
4
+
5
+ # Removing the [remove] link and label class from the default selected facet display
6
+ def render_selected_facet_value(facet_solr_field, item)
7
+ content_tag(:span, render_facet_value(facet_solr_field, item, :suppress_link => true), :class => "selected")
8
+ end
9
+
10
+ # Override to remove the label class (easier integration with bootstrap)
11
+ # and handles arrays
12
+ def render_facet_value(facet_solr_field, item, options ={})
13
+ if item.is_a? Array
14
+ render_array_facet_value(facet_solr_field, item, options)
15
+ end
16
+
17
+ (link_to_unless(options[:suppress_link], item.value, add_facet_params_and_redirect(facet_solr_field, item.value), :class=>"facet_select") + " " + render_facet_count(item.hits)).html_safe
18
+ end
19
+
20
+ def render_array_facet_value(facet_solr_field, item, options)
21
+ (link_to_unless(options[:suppress_link], item[0], add_facet_params_and_redirect(facet_solr_field, item[0]), :class=>"facet_select") + " (" + format_num(item[1]) + ")").html_safe
22
+ end
23
+ end
24
+ end
25
+
@@ -0,0 +1,24 @@
1
+ # properties datastream: catch-all for info that didn't have another home. Particularly depositor.
2
+ module Hydra::Datastream
3
+ class Properties < ActiveFedora::NokogiriDatastream
4
+ set_terminology do |t|
5
+ t.root(:path=>"fields", :xmlns => '', :namespace_prefix => nil)
6
+
7
+ # This is where we put the user id of the object depositor -- impacts permissions/access controls
8
+ t.depositor :xmlns => '', :namespace_prefix => nil
9
+
10
+ # @deprecated Collection should be tracked in RELS-EXT RDF. collection term will be removed no later than release 6.x
11
+ t.collection :xmlns => '', :namespace_prefix => nil
12
+ # @deprecated Title should be tracked in descMetadata. title term will be removed no later than release 6.x
13
+ t.title :xmlns => '', :namespace_prefix => nil
14
+ end
15
+
16
+ def self.xml_template
17
+ builder = Nokogiri::XML::Builder.new do |xml|
18
+ xml.fields
19
+ end
20
+
21
+ builder.doc
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,25 @@
1
+ require 'hydra'
2
+ # An EXAMPLE Basic Model for Assets that conform to Hydra commonMetadata cModel and have basic MODS metadata (currently "Article" is the MODS exemplar)
3
+ class ModsAsset < ActiveFedora::Base
4
+
5
+ # declares a rightsMetadata datastream with type Hydra::Datastream::RightsMetadata
6
+ # basically, it is another expression of
7
+ # has_metadata :name => "rightsMetadata", :type => Hydra::Datastream::RightsMetadata
8
+ include Hydra::ModelMixins::CommonMetadata
9
+
10
+ ## Convenience methods for manipulating the rights metadata datastream
11
+ include Hydra::ModelMixins::RightsMetadata
12
+
13
+ # declares a descMetadata datastream with type Hydra::Datastream::ModsArticle
14
+ # basically, it is another expression of
15
+ # has_metadata :name => "descMetadata", :type => Hydra::Datastream::ModsArticle
16
+ #include Hydra::ModelMixins::ModsObject
17
+
18
+ # adds helpful methods for basic hydra objects
19
+ include Hydra::ModelMethods
20
+
21
+ # adds file_objects methods
22
+ include ActiveFedora::FileManagement
23
+
24
+
25
+ end
@@ -0,0 +1,5 @@
1
+ <% [:notice, :error, :alert].each do |type| %>
2
+ <% if flash[type] %>
3
+ <div class="ui-state-<%= type == :error ? 'error' : 'highlight' %> ui-corner-all msg <%= type.to_s %>"><%= flash[type] %></div>
4
+ <% end %>
5
+ <% end %>
@@ -0,0 +1,11 @@
1
+ <h1><%= document_show_html_title %></h1>
2
+
3
+ <% if @document.respond_to?(:export_as_mla_citation_txt) %>
4
+ <h4>MLA</h4>
5
+ <%= @document.send(:export_as_mla_citation_txt) %><br/><br/>
6
+ <% end %>
7
+
8
+ <% if @document.respond_to?(:export_as_apa_citation_txt) %>
9
+ <h4>APA</h4>
10
+ <%= @document.send(:export_as_apa_citation_txt) %>
11
+ <% end %>
@@ -0,0 +1,34 @@
1
+ <%# This view is overridden to change the alt attribute to be a title in the link_to below in order to conform to the HTML5 validity standard. This should ultimately be fixed in Blacklight. -%>
2
+ <%- # local params:
3
+ # label
4
+ # value
5
+ # options =>
6
+ # :remove => url for a remove constraint link
7
+ # :classes => array of classes to add to container span
8
+ options ||= {}
9
+ options[:escape_label] = true unless options.has_key?(:escape_label)
10
+ options[:escape_value] = true unless options.has_key?(:escape_value)
11
+ -%>
12
+
13
+ <span class="appliedFilter constraint <%= options[:classes].join(" ") if options[:classes] %>">
14
+ <%- unless label.blank? -%>
15
+ <span class="filterName"><%= options[:escape_label] ? h(label) : label %></span>
16
+ <%- end -%>
17
+ <%- unless value.blank? -%>
18
+ <span class="filterValue"><%= options[:escape_value] ? h(value) : value %></span>
19
+ <%- end -%>
20
+ <%- unless options[:remove].blank? -%>
21
+ <% accessible_remove_label =
22
+ if label.blank?
23
+ "Remove constraint #{options[:escape_value] ? h(value) : value}"
24
+ else
25
+ "Remove constraint #{options[:escape_value] ? h(value) : value}: #{options[:escape_value] ? h(value) : value}"
26
+ end
27
+ %>
28
+ <%= link_to(accessible_remove_label,
29
+ options[:remove],
30
+ :class=>'btnRemove imgReplace',
31
+ :title=>'remove'
32
+ ) %>
33
+ <%- end -%>
34
+ </span>
@@ -0,0 +1,22 @@
1
+ <%# default partial to delete display solr document fields in catalog show view -%>
2
+
3
+ <div class="document_viewer" id="cover_container">
4
+ <div id="delete_dialog">
5
+ <div id="delete_dialog_container">
6
+
7
+
8
+ <div>
9
+ <span>Permanently delete <%= @document['id'] %> and its assets from the repository?</span><br/>
10
+ <div id="deletable_assets"></div>
11
+ </div>
12
+
13
+ <div>
14
+ <%= button_to("Delete", hydra_asset_path(@document['id']), :confirm => 'Are you sure?', :method => :delete )%>
15
+ <%= button_to("Withdraw", withdraw_path(:id => @document['id']) ) %>
16
+ <%= button_to("Cancel", :action=>:edit, :controller => :catalog, :id => @document['id'] ) %>
17
+
18
+ </div>
19
+
20
+ </div>
21
+ </div>
22
+ </div>
@@ -0,0 +1,57 @@
1
+ <%# default partial to display solr document fields in catalog show view -%>
2
+
3
+ <%- stylesheet_links << "../plugin_assets/hydra-head/javascripts/date-picker/css/datepicker" %>
4
+ <%- stylesheet_links << ["../plugin_assets/hydra-head/javascripts/select_to_ui_slider/css/ui.slider.extras.css"] %>
5
+ <%- stylesheet_links << ["../plugin_assets/hydra-head/stylesheets/slider.css"] %>
6
+
7
+
8
+
9
+ <% @fedora_object = ActiveFedora::Base.find(params[:id])
10
+ @datastreams = @fedora_object.datastreams
11
+ %>
12
+
13
+ <div class="document_viewer" id="cover_container">
14
+ <dl>
15
+ <dt>pid:</dt>
16
+ <dd><%= @fedora_object.pid %></dd>
17
+ </dl>
18
+ <dl>
19
+ <dt>label:</dt>
20
+ <dd><%= @fedora_object.label %></dd>
21
+ <dt>state:</dt>
22
+ <dd><%= @fedora_object.state %></dd>
23
+ <dt>owner id:</dt>
24
+ <dd><%= @fedora_object.inner_object.ownerId %></dd>
25
+ </dl>
26
+ <dl>
27
+ <dt>created:</dt>
28
+ <dd><%= @fedora_object.create_date %></dd>
29
+ <dt>last modified:</dt>
30
+ <dd><%= @fedora_object.modified_date %></dd>
31
+ </dl>
32
+ <dl>
33
+ <dt>datastreams:</dt>
34
+ <dd>
35
+ <ul>
36
+ <% @datastreams.keys.sort!.each do |dsid| %>
37
+ <li><a href="#<%=dsid%>" class="inline"><%=dsid%></a>
38
+ <div style='display:none'>
39
+ <div id='<%=dsid%>'>
40
+ <h1><%=dsid%></h1>
41
+ <dl>
42
+ <%= ("<dt>label:</dt><dd>" + @datastreams[dsid].dsLabel + "</dd>").html_safe unless @datastreams[dsid].dsLabel.blank? %>
43
+ <%= ("<dt>last modified:</dt><dd>" + @datastreams[dsid].lastModifiedDate + "</dd>").html_safe unless @datastreams[dsid].lastModifiedDate.blank? %>
44
+ <%= ("<dt>mimetype:</dt><dd>" + @datastreams[dsid].mimeType + "</dd>").html_safe unless @datastreams[dsid].mimeType.blank? %>
45
+ <%= ("<dt>control group:</dt><dd>" + @datastreams[dsid].controlGroup + "</dd>").html_safe unless @datastreams[dsid].controlGroup.blank? %>
46
+ </dl>
47
+ </div>
48
+ </div></li>
49
+ <% end %>
50
+ </ul>
51
+ </dd>
52
+ </dl>
53
+
54
+ <%= render :partial => "hydra/permissions/index", :locals => {:document => document, :asset_id=>params[:id]}%>
55
+
56
+ </div>
57
+
@@ -0,0 +1,13 @@
1
+
2
+
3
+ <%# this should imitate the stuff in catalog/_show_partials/_default_details -%>
4
+ <%= form_tag hydra_update_url_for(:action=>"update", :controller=>"hydra/assets"), :id=>"document_metadata" "accept-charset"=>"utf-8" do %>
5
+
6
+ <div id="multipleEdit">
7
+ <dl class="defList fl-theme-mist">
8
+ <%= editable_metadata_field(@document_fedora, "descMetadata", :title, :label => "Title:") %>
9
+ </dl>
10
+ </div>
11
+ </div>
12
+ <% end %>
13
+ <%# -- end of code replicating catalog/_show_partials/_default_details -%>
@@ -0,0 +1,37 @@
1
+ <% # main container for facets/limits menu -%>
2
+ <div id="facets" class="facets">
3
+ <% facet_field_names.each do |solr_fname| %>
4
+
5
+ <% next if solr_fname == 'person_full_name_cid_facet' %>
6
+ <div>
7
+ <% display_facet = @response.facets.detect {|f| f.name == solr_fname} -%>
8
+ <% if display_facet && display_facet.items.length > 0 %>
9
+ <h3 id="facet_<%= facet_field_labels[solr_fname].downcase.gsub(/ /, '_') -%>"><%= facet_field_labels[solr_fname] -%></h3>
10
+ <ul>
11
+ <% paginator =
12
+ Blacklight::Solr::FacetPaginator.new(display_facet.items,
13
+ :limit => facet_limit_for(solr_fname))
14
+ %>
15
+ <% paginator.items.each do |item| -%>
16
+ <li>
17
+ <% if facet_in_params?( solr_fname, item.value ) %>
18
+ <%= render_selected_facet_value(solr_fname, item) %>
19
+ <% else %>
20
+ <% if item.value.blank? %>
21
+ <%#= render_facet_value(solr_fname, ["Unknown",item.hits]) %>
22
+ <% else %>
23
+ <%= render_facet_value(solr_fname, item) %>
24
+ <% end %>
25
+ <% end -%>
26
+ </li>
27
+ <% end %>
28
+
29
+ <% if(paginator.has_next?) %>
30
+ <li class="more_facets_link"><%= link_to('more »', params.merge(:id => solr_fname, :action=>"facet"), :class => "more_facets_link") %></li>
31
+ <% end %>
32
+
33
+ </ul>
34
+ <% end %>
35
+ </div>
36
+ <% end %>
37
+ </div>
@@ -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,4 @@
1
+ <div id="results" class="home-text">
2
+ <h1>Welcome to Hydra</h1>
3
+ <p>Edit or override this page (views/catalog/_home_text.html.erb)</p>
4
+ </div>
@@ -0,0 +1,20 @@
1
+ <tr class="document <%= cycle("even","odd") %>">
2
+ <td>
3
+ <%= link_to_document(document, :label => blacklight_config.show.heading.to_sym, :counter => (counter + 1 + @response.params[:start].to_i)) %>
4
+ </td>
5
+ <td>
6
+
7
+ </td>
8
+ <td>
9
+ <%= l DateTime.parse(document.fetch(:system_create_dt,nil)).to_time %>
10
+ </td>
11
+ <td>
12
+ <%= document.document_type(blacklight_config.show.display_type) %>
13
+ </td>
14
+ <td>
15
+ <%= get_file_asset_count(document)%>
16
+ </td>
17
+ <td>
18
+ Created
19
+ </td>
20
+ </tr>
@@ -0,0 +1,14 @@
1
+ <%# default partial to display solr document fields in catalog index view -%>
2
+ <dl class="defList">
3
+ <%#= get_relevance_bar(document[:score],"Relevance:") %>
4
+ <dt>Date: </dt>
5
+ <dd><%= render_document_show_field_value(:document=>document, :field=>"date_t") %></dd>
6
+ <dt>Title: </dt>
7
+ <dd><%= render_document_show_field_value(:document=>document, :field=>"title_t") %></dd>
8
+ <dt>Document Type: </dt>
9
+ <dd><%= render_document_show_field_value(:document=>document, :field=>"medium_t") %></dd>
10
+ <dt>Location: </dt>
11
+ <dd><%= render_document_show_field_value(:document=>document, :field=>"location_t") %></dd>
12
+ <dt>Date: </dt>
13
+ <dd><%= render_document_show_field_value(:document=>document, :field=>"date_t") %></dd>
14
+ </dl>
@@ -0,0 +1,2 @@
1
+ <!-- Suppressing opensearch tags (to maintain html5 validity) by overriding views/catalog/_opensearch_response_metadata.html.erb with an empty file. To undo this, just delete the file. -->
2
+
@@ -0,0 +1,21 @@
1
+ <%# default partial to display solr document fields in catalog show view -%>
2
+
3
+
4
+ <div class="document_viewer" id="cover_container">
5
+ <dl class="defList">
6
+ <dt>ID: </dt>
7
+ <dd><%= render_document_show_field_value(:document=>document, :field=>"id") %></dd>
8
+ <dt>Download:</dt>
9
+ <dd id="downloads">
10
+ <ul>
11
+ <% %>
12
+ </ul>
13
+ </dd>
14
+ <dt>Copyright: </dt>
15
+ <dd><%= render_document_show_field_value(:document=>document, :field=>"rights_t") %></dd>
16
+ </dl>
17
+ </div>
18
+ <div class="<%= params[:action]%>_details">
19
+ <%= render :partial => "#{params[:controller]}/_#{params[:action]}_partials/default_details", :locals => {:document => document}%>
20
+ </div>
21
+ <%= async_load_tag(hydra_asset_downloads_path(params[:id]), 'downloads') %>
@@ -0,0 +1,15 @@
1
+ <%# default partial to display solr document fields in catalog show view -%>
2
+ <div>
3
+ <dl class="defList">
4
+ <dt>Date: </dt>
5
+ <dd><%= render_document_show_field_value(:document=>document, :field=>"date_t") %></dd>
6
+ <dt>Title: </dt>
7
+ <dd><%= render_document_show_field_value(:document=>document, :field=>"title_t") %></dd>
8
+ <dt>Document Type: </dt>
9
+ <dd><%= render_document_show_field_value(:document=>document, :field=>"medium_t") %></dd>
10
+ <dt>Location: </dt>
11
+ <dd><%= render_document_show_field_value(:document=>document, :field=>"location_t") %></dd>
12
+ <dt>Date: </dt>
13
+ <dd><%= render_document_show_field_value(:document=>document, :field=>"date_t") %></dd>
14
+ </dl>
15
+ </div>
@@ -0,0 +1,52 @@
1
+ <% facets_display_heading ||= "" %>
2
+ <% # main container for facets/limits menu -%>
3
+ <div id="facets">
4
+ <h2><%=h facets_display_heading %></h2>
5
+ <% facet_field_names.each do |solr_fname| %>
6
+ <div>
7
+ <% display_facet = @response.facets.detect {|f| f.name == solr_fname} -%>
8
+ <%#- raise solr_fname.inspect unless display_facet -%>
9
+ <% if display_facet && display_facet.items.length > 0 %>
10
+ <h3 class="facet_selected"><%= facet_field_labels[solr_fname] -%></h3>
11
+ <ul>
12
+ <% item_counter = 0 %>
13
+ <% display_facet.items.each do |item| -%>
14
+ <% if item.hits > 0 %>
15
+ <% facet_count_for_value = facet_value_hits(@facet_lookup, solr_fname, item.value) %>
16
+ <% if facet_in_params? solr_fname, item.value %>
17
+ <li>
18
+ <span class="selected"><%= h(item.value) %> (<%= format_num facet_count_for_value %>)</span>
19
+ <% link_options = remove_facet_params(solr_fname, item.value, params).merge!Hash["controller" => "catalog", :action=> "index"] %>
20
+ [<%= link_to 'remove', url_for(link_options), :class=>'remove' %>]
21
+ </li>
22
+ <% else %>
23
+ <%- if item_counter > Blacklight.config[:facet_more_num]-1 -%>
24
+ <li class="more">
25
+ <%- else -%>
26
+ <li>
27
+ <%- end -%>
28
+ <% link_options = add_facet_params(solr_fname, item.value).merge!Hash["controller" => "catalog", :action=> "index"] %>
29
+ <%= link_to h(item.value), url_for(link_options) %> (<%= format_num facet_count_for_value %>)
30
+ </li>
31
+ <% end -%>
32
+ <% end -%>
33
+ <% item_counter += 1 %>
34
+ <% end %>
35
+ <%= display_facet.items.length > Blacklight.config[:facet_more_num] ? "<li class='more_li'><a href='' class='more_link' title='more #{pluralize(2, facet_field_labels[solr_fname])[2..-1].downcase}'>more<span class='off_screen'> #{pluralize(2, facet_field_labels[solr_fname])[2..-1].downcase}</span></a></li>" : "" %>
36
+ <%= display_facet.items.length > Blacklight.config[:facet_more_num] ? "<li class='less_li' style='display:none;'><a href='' class='more_link' title='less #{pluralize(2, facet_field_labels[solr_fname])[2..-1].downcase}'>less<span class='off_screen'> #{pluralize(2, facet_field_labels[solr_fname])[2..-1].downcase}</span></a></li>" : "" %>
37
+ </ul>
38
+ <% end %>
39
+ </div>
40
+ <% end %>
41
+ </div>
42
+ <script type="text/javascript">
43
+ $(".more").toggle();
44
+ $('.more_link').each(function(){
45
+ $(this).click(function(){
46
+ $(this).parent().parent().children("li.more").toggle();
47
+ $(this).parent().parent().children("li.more_li").toggle();
48
+ $(this).parent().parent().children("li.less_li").toggle();
49
+ return false;
50
+ });
51
+ });
52
+ </script>