From 35a79ee98079c97e3d82e0ab0f02f19d69437a15 Mon Sep 17 00:00:00 2001 From: zhouyu Date: Wed, 29 Nov 2023 13:47:16 -0800 Subject: [PATCH 1/2] home page --- app/views/catalog/_home_text.html.erb | 22 ++++++++++++++++++++++ config/locales/blacklight.en.yml | 3 --- config/locales/geoblacklight.en.yml | 13 +++++++++++++ 3 files changed, 35 insertions(+), 3 deletions(-) create mode 100644 app/views/catalog/_home_text.html.erb delete mode 100644 config/locales/blacklight.en.yml create mode 100644 config/locales/geoblacklight.en.yml diff --git a/app/views/catalog/_home_text.html.erb b/app/views/catalog/_home_text.html.erb new file mode 100644 index 0000000..e6ce527 --- /dev/null +++ b/app/views/catalog/_home_text.html.erb @@ -0,0 +1,22 @@ +
+
+
+ <%= content_tag :h3, t('geoblacklight.home.category_heading') %> +
+ <%= render(Geoblacklight::HomepageFeatureFacetComponent.new(icon: 'tags', label: 'geoblacklight.home.theme', facet_field: Settings.FIELDS.THEME, response: @response)) %> + <%= render(Geoblacklight::HomepageFeatureFacetComponent.new(icon: 'arrow-circle-down', label: 'geoblacklight.home.resource_class', facet_field: Settings.FIELDS.RESOURCE_CLASS, response: @response)) %> +
+
+ <%= render(Geoblacklight::HomepageFeatureFacetComponent.new(icon: 'globe', label: 'geoblacklight.home.placename', facet_field: Settings.FIELDS.SPATIAL_COVERAGE, response: @response)) %> + <%= render(Geoblacklight::HomepageFeatureFacetComponent.new(icon: 'home', label: 'geoblacklight.home.institution', facet_field: Settings.FIELDS.PROVIDER, response: @response)) %> +
+
+
+ <%= content_tag :h3, t('geoblacklight.home.map_heading') %> + <%= content_tag :div, '', id: 'map', aria: { label: t('geoblacklight.map.label') }, data: { map: 'home', 'catalog-path'=> search_catalog_path , 'map-geom' => Settings.HOMEPAGE_MAP_GEOM, basemap: geoblacklight_basemap, leaflet_options: leaflet_options } %> +
+
+
+ <%= t('geoblacklight.home.version', version: Geoblacklight::VERSION ) %> +
+
diff --git a/config/locales/blacklight.en.yml b/config/locales/blacklight.en.yml deleted file mode 100644 index de4317c..0000000 --- a/config/locales/blacklight.en.yml +++ /dev/null @@ -1,3 +0,0 @@ -en: - blacklight: - application_name: 'GeoBlacklight' \ No newline at end of file diff --git a/config/locales/geoblacklight.en.yml b/config/locales/geoblacklight.en.yml new file mode 100644 index 0000000..e1dcb6e --- /dev/null +++ b/config/locales/geoblacklight.en.yml @@ -0,0 +1,13 @@ +en: + geoblacklight: + home: + headline: 'Explore and discover...' + search_heading: 'Find the maps and data you need' + category_heading: 'Find by...' + map_heading: 'Find by location' + institution: 'Institution' + placename: 'Placename' + resource_class: 'Resource Class' + subject: 'Subject' + theme: 'Theme' + version: 'GeoBlacklight version %{version}' \ No newline at end of file From cb0a1c36b6e448bdc8266b42d8e565c401d6b23d Mon Sep 17 00:00:00 2001 From: zhouyu Date: Wed, 29 Nov 2023 14:42:27 -0800 Subject: [PATCH 2/2] remove tools --- app/controllers/catalog_controller.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/controllers/catalog_controller.rb b/app/controllers/catalog_controller.rb index fa4b253..dfed232 100644 --- a/app/controllers/catalog_controller.rb +++ b/app/controllers/catalog_controller.rb @@ -306,18 +306,18 @@ class CatalogController < ApplicationController # Tools from Blacklight config.add_results_collection_tool(:sort_widget) config.add_results_collection_tool(:per_page_widget) - config.add_show_tools_partial(:bookmark, partial: 'bookmark_control', if: :render_bookmarks_control?) + # config.add_show_tools_partial(:bookmark, partial: 'bookmark_control', if: :render_bookmarks_control?) config.add_show_tools_partial(:citation) - config.add_show_tools_partial(:email, callback: :email_action, validator: :validate_email_params) - config.add_show_tools_partial(:sms, if: :render_sms_action?, callback: :sms_action, validator: :validate_sms_params) + # config.add_show_tools_partial(:email, callback: :email_action, validator: :validate_email_params) + # config.add_show_tools_partial(:sms, if: :render_sms_action?, callback: :sms_action, validator: :validate_sms_params) # Custom tools for GeoBlacklight config.add_show_tools_partial :metadata, if: proc { |_context, _config, options| options[:document] && (Settings.METADATA_SHOWN & options[:document].references.refs.map(&:type).map(&:to_s)).any? } - config.add_show_tools_partial :carto, partial: 'carto', if: proc { |_context, _config, options| - options[:document] && options[:document].carto_reference.present? - } + # config.add_show_tools_partial :carto, partial: 'carto', if: proc { |_context, _config, options| + # options[:document] && options[:document].carto_reference.present? + # } config.add_show_tools_partial :arcgis, partial: 'arcgis', if: proc { |_context, _config, options| options[:document] && options[:document].arcgis_urls.present? }