Skip to content

Commit

Permalink
CatalogController: set better check for displaying the data dict show…
Browse files Browse the repository at this point in the history
… tool
  • Loading branch information
ewlarson committed Jan 17, 2025
1 parent b2645ef commit 97be31b
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 42 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ gem 'twitter-typeahead-rails', '0.11.1.pre.corejavascript'
gem 'geoblacklight', '4.4'

# GBL Admin
gem 'geoblacklight_admin', git: "https://github.com/geobtaa/geoblacklight_admin.git", branch: "feature/data-dictionaries"
gem 'geoblacklight_admin', '~> 0.7.0'
gem 'git', ">= 1.13"
gem "rubyzip", ">= 1.3.0"
gem "awesome_print"
Expand Down
74 changes: 34 additions & 40 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -41,45 +41,6 @@ GIT
rails (>= 5.2, < 8.0)
statesman (>= 3.4)

GIT
remote: https://github.com/geobtaa/geoblacklight_admin.git
revision: 664bb7948112a131ca45cc0a4f9f62f9ebb9cbd3
branch: feature/data-dictionaries
specs:
geoblacklight_admin (0.6.3)
active_storage_validations (~> 1.0)
amazing_print
blacklight (~> 7.33)
blacklight_advanced_search
blacklight_range_limit
bootstrap (~> 4.0)
chosen-rails (~> 1.10)
cocoon (~> 1.2)
config (~> 4.0)
devise (~> 4.7)
devise-bootstrap-views (~> 1.0)
dotenv-rails (~> 2.8)
geoblacklight (~> 4.4)
haml (~> 5.2)
httparty (~> 0.21)
inline_svg (~> 1.9)
jquery-rails (~> 4.4)
kithe (~> 2.0)
mutex_m (~> 0.2.0)
noticed (~> 1.6)
pagy (~> 6.0)
paper_trail (~> 15.0)
pg (~> 1.4)
qa (~> 5.0)
rails (~> 7.0, < 7.3)
ruby-progressbar
simple_form (~> 5.0)
sprockets (~> 3.0)
statesman (~> 12.0)
vite_rails (~> 3.0)
vite_ruby (>= 3.5)
zeitwerk (~> 2.6)

GEM
remote: https://rubygems.org/
specs:
Expand Down Expand Up @@ -405,6 +366,39 @@ GEM
rgeo-geojson
sprockets-rails (~> 3.0)
vite_rails (~> 3.0)
geoblacklight_admin (0.7.0)
active_storage_validations (~> 1.0)
amazing_print
blacklight (~> 7.33)
blacklight_advanced_search
blacklight_range_limit
bootstrap (~> 4.0)
chosen-rails (~> 1.10)
cocoon (~> 1.2)
config (~> 4.0)
devise (~> 4.7)
devise-bootstrap-views (~> 1.0)
dotenv-rails (~> 2.8)
geoblacklight (~> 4.4)
haml (~> 5.2)
httparty (~> 0.21)
inline_svg (~> 1.9)
jquery-rails (~> 4.4)
kithe (~> 2.0)
mutex_m (~> 0.2.0)
noticed (~> 1.6)
pagy (~> 6.0)
paper_trail (~> 15.0)
pg (~> 1.4)
qa (~> 5.0)
rails (~> 7.0, < 7.3)
ruby-progressbar
simple_form (~> 5.0)
sprockets (~> 3.0)
statesman (~> 12.0)
vite_rails (~> 3.0)
vite_ruby (>= 3.5)
zeitwerk (~> 2.6)
geocoder (1.8.5)
base64 (>= 0.1.0)
csv (>= 3.0.0)
Expand Down Expand Up @@ -884,7 +878,7 @@ DEPENDENCIES
foreman
geoblacklight (= 4.4)
geoblacklight-icons!
geoblacklight_admin!
geoblacklight_admin (~> 0.7.0)
geoblacklight_sidecar_images!
git (>= 1.13)
haml
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/catalog_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -326,9 +326,9 @@ class CatalogController < ApplicationController
config.spell_max = 5

# Custom tools for GeoBlacklight
config.add_show_tools_partial :gbl_admin_data_dictionaries, partial: 'gbl_admin_data_dictionaries'
config.add_show_tools_partial :more_details, partial: 'more_details', if: proc { |_context, _config, options| options[:document] && (!options[:document].references.nil? & !options[:document].references.url.nil?)}
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 :gbl_admin_data_dictionaries, partial: 'gbl_admin_data_dictionaries', if: proc { |_context, _config, options| options[:document] && options[:document]&.kithe_model&.document_data_dictionaries&.present? }
config.add_show_tools_partial :arcgis, partial: 'arcgis', if: proc { |_context, _config, options| options[:document] && options[:document].arcgis_urls.present? }
config.add_show_tools_partial :data_dictionary, partial: 'data_dictionary', if: proc { |_context, _config, options| options[:document] && options[:document].data_dictionary_download.present? }
config.add_show_tools_partial(:citation, if: proc { |_context, _config, options| options[:document] && (options[:document].resource_class != 'Collections')})
Expand Down

0 comments on commit 97be31b

Please sign in to comment.