From 72e26386eb2d7a989077dbac89729ef03ffd9c9a Mon Sep 17 00:00:00 2001 From: Chris Beer Date: Mon, 13 Jan 2020 15:21:24 -0800 Subject: [PATCH] Use presenters to deliver the document url and title --- app/helpers/blacklight/maps_helper.rb | 12 ++---------- app/views/catalog/index.heatmaps.jbuilder | 5 +++++ 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/app/helpers/blacklight/maps_helper.rb b/app/helpers/blacklight/maps_helper.rb index 86c053c..db420ce 100644 --- a/app/helpers/blacklight/maps_helper.rb +++ b/app/helpers/blacklight/maps_helper.rb @@ -23,8 +23,8 @@ def sidebar_template
@@ -34,14 +34,6 @@ def sidebar_template private - ## - # Document path used for creating client side links to documents from a - # template - # @return String - def document_path - "#{search_catalog_path}/{#{blacklight_config.document_unique_id_param}}" - end - ## # Data attributes used in displaying the index map # @return Hash diff --git a/app/views/catalog/index.heatmaps.jbuilder b/app/views/catalog/index.heatmaps.jbuilder index a318f3b..9b090b9 100644 --- a/app/views/catalog/index.heatmaps.jbuilder +++ b/app/views/catalog/index.heatmaps.jbuilder @@ -1,6 +1,11 @@ presenter = Blacklight::JsonPresenter.new(@response, blacklight_config) json.response do + json.docs(presenter.documents) do |document| + json.url polymorphic_url(url_for_document(document)) + json.title index_presenter(document).heading + end + json.facet_heatmaps @response['facet_counts']['facet_heatmaps'] json.pages presenter.pagination_info end