blacklight_facet_extras 0.0.1pre4 → 0.0.1pre5

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.1pre4
1
+ 0.0.1pre5
@@ -0,0 +1,38 @@
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 = facet_values_for(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
+ <% if params[:f] and params[:f][solr_field] and not params[:f][solr_field].blank? %>
13
+ <h4><%= params[:f][solr_field].first %></h4>
14
+ <% end %>
15
+ <ul>
16
+ <% paginator =
17
+ Blacklight::Solr::FacetPaginator.new(display_facet.items,
18
+ :limit => facet_limit_for(solr_field))
19
+ %>
20
+
21
+ <% paginator.items.each do |item| -%>
22
+ <li>
23
+ <% if facet_in_params?( solr_field, item.value ) %>
24
+ <%= render_selected_facet_value(solr_field, item) %>
25
+ <% else %>
26
+ <%= render_facet_value(solr_field, item) %>
27
+ <% end -%>
28
+ </li>
29
+
30
+ <% end %>
31
+
32
+ <% if(paginator.has_next?) %>
33
+ <li class="more_facets_link"><%= link_to('more »', params.merge(:id => solr_field, :action=>"facet"), :class => "more_facets_link") %></li>
34
+ <% end %>
35
+
36
+ </ul>
37
+
38
+ <% end %>
@@ -1,4 +1,13 @@
1
1
  module BlacklightFacetExtras::Hierarchy::ViewHelperExtension
2
+ def render_facet_limit(solr_field)
3
+ config = facet_hierarchy_config(solr_field)
4
+ if ( config )
5
+ render(:partial => "catalog/_facet_partials/hierarchy", :locals=> {:solr_field => solr_field })
6
+ else
7
+ super(solr_field)
8
+ end
9
+ end
10
+
2
11
  def facet_values_for(solr_field)
3
12
  config = facet_hierarchy_config(solr_field)
4
13
  facet_field = super(solr_field)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blacklight_facet_extras
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1pre4
4
+ version: 0.0.1pre5
5
5
  prerelease: 5
6
6
  platform: ruby
7
7
  authors:
@@ -14,7 +14,7 @@ default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rails
17
- requirement: &2156245200 !ruby/object:Gem::Requirement
17
+ requirement: &2153365100 !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
20
  - - ~>
@@ -22,10 +22,10 @@ dependencies:
22
22
  version: '3.0'
23
23
  type: :runtime
24
24
  prerelease: false
25
- version_requirements: *2156245200
25
+ version_requirements: *2153365100
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: blacklight
28
- requirement: &2156244500 !ruby/object:Gem::Requirement
28
+ requirement: &2153364680 !ruby/object:Gem::Requirement
29
29
  none: false
30
30
  requirements:
31
31
  - - ! '>='
@@ -33,7 +33,7 @@ dependencies:
33
33
  version: '0'
34
34
  type: :runtime
35
35
  prerelease: false
36
- version_requirements: *2156244500
36
+ version_requirements: *2153364680
37
37
  description:
38
38
  email:
39
39
  - chris_beer@wgbh.org
@@ -45,6 +45,7 @@ files:
45
45
  - Rakefile
46
46
  - VERSION
47
47
  - app/views/catalog/_facet_limit.html.erb
48
+ - app/views/catalog/_facet_partials/_hierarchy.html.erb
48
49
  - app/views/catalog/_facet_partials/_pivot.html.erb
49
50
  - app/views/catalog/_facet_partials/_query.html.erb
50
51
  - app/views/catalog/_facet_partials/_range.html.erb