Module: Geoblacklight::ViewHelperOverride

Includes:
CatalogHelperOverride
Defined in:
lib/geoblacklight/view_helper_override.rb

Instance Method Summary collapse

Methods included from CatalogHelperOverride

#remove_spatial_filter_group

Instance Method Details

#has_search_parameters?Boolean

Overrides BL method to enable results for spatial only params

Returns:

  • (Boolean)

10
11
12
# File 'lib/geoblacklight/view_helper_override.rb', line 10

def has_search_parameters?
  spatial_parameters? || super
end

#query_has_constraints?(params = params) ⇒ Boolean

Returns:

  • (Boolean)

14
15
16
# File 'lib/geoblacklight/view_helper_override.rb', line 14

def query_has_constraints?(params = params)
  has_search_parameters? || super
end

#render_constraints_filters(params = params) ⇒ Object


27
28
29
30
31
32
33
34
35
36
37
# File 'lib/geoblacklight/view_helper_override.rb', line 27

def render_constraints_filters(params = params)
  content = super(params)

  if params[:bbox]
    content << render_constraint_element('Bounding Box',
      params[:bbox],
      remove: search_action_path(remove_spatial_filter_group(:bbox, params)))
  end

  return content
end

#render_search_to_s(params) ⇒ Object


18
19
20
# File 'lib/geoblacklight/view_helper_override.rb', line 18

def render_search_to_s(params)
  super + render_search_to_s_bbox(params)
end

#render_search_to_s_bbox(params) ⇒ Object


22
23
24
25
# File 'lib/geoblacklight/view_helper_override.rb', line 22

def render_search_to_s_bbox(params)
  return ''.html_safe if params['bbox'].blank?
  render_search_to_s_element('Bounding box', render_filter_value(params['bbox']) )
end

#spatial_parameters?Boolean

Returns:

  • (Boolean)

5
6
7
# File 'lib/geoblacklight/view_helper_override.rb', line 5

def spatial_parameters?
  params[:bbox]
end