Sha256: a91cbab974e5b107feb9e667052a0df2c00d7f4a2eeec832a4f09b93b4db85e5

Contents?: true

Size: 980 Bytes

Versions: 3

Compression:

Stored size: 980 Bytes

Contents

module Geoblacklight
  module ViewHelperOverride
    include CatalogHelperOverride

    def spatial_parameters?
      params[:bbox]
    end

    # Overrides BL method to enable results for spatial only params
    def has_search_parameters?
      spatial_parameters? || super
    end

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

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

    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

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

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

      return content
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
geoblacklight-0.6.2 lib/geoblacklight/view_helper_override.rb
geoblacklight-0.6.1 lib/geoblacklight/view_helper_override.rb
geoblacklight-0.6.0 lib/geoblacklight/view_helper_override.rb