geoblacklight 2.4.0 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.circleci/config.yml +152 -64
- data/.rubocop.yml +15 -13
- data/.rubocop_todo.yml +66 -10
- data/README.md +1 -1
- data/Rakefile +1 -0
- data/app/assets/javascripts/geoblacklight/downloaders/downloader.js +1 -1
- data/app/assets/javascripts/geoblacklight/modules/svg_tooltips.js +31 -0
- data/app/assets/javascripts/geoblacklight/viewers/esri.js +2 -2
- data/app/assets/javascripts/geoblacklight/viewers/esri/tiled_map_layer.js +1 -1
- data/app/assets/javascripts/geoblacklight/viewers/wms.js +2 -2
- data/app/assets/stylesheets/geoblacklight/geoblacklight.scss +2 -0
- data/app/assets/stylesheets/geoblacklight/modules/_base.scss +33 -0
- data/app/assets/stylesheets/geoblacklight/{_blacklight_overrides.scss → modules/_blacklight_overrides.scss} +0 -0
- data/app/assets/stylesheets/geoblacklight/{_styles.scss → modules/_styles.scss} +1 -0
- data/app/assets/stylesheets/geoblacklight/modules/downloads.scss +37 -54
- data/app/assets/stylesheets/geoblacklight/modules/item.scss +1 -0
- data/app/assets/stylesheets/geoblacklight/modules/results.scss +16 -28
- data/app/assets/stylesheets/geoblacklight/modules/sidebar.scss +12 -42
- data/app/assets/stylesheets/geoblacklight/modules/toolbar.scss +17 -59
- data/app/controllers/download_controller.rb +12 -12
- data/app/controllers/relation_controller.rb +1 -0
- data/app/controllers/wms_controller.rb +1 -0
- data/app/helpers/arcgis_helper.rb +1 -0
- data/app/helpers/blacklight_helper.rb +1 -0
- data/app/helpers/carto_helper.rb +1 -0
- data/app/helpers/geoblacklight_helper.rb +25 -72
- data/app/models/concerns/geoblacklight/solr_document.rb +7 -6
- data/app/models/concerns/geoblacklight/solr_document/arcgis.rb +2 -1
- data/app/models/concerns/geoblacklight/solr_document/carto.rb +1 -13
- data/app/models/concerns/geoblacklight/solr_document/citation.rb +1 -0
- data/app/models/concerns/geoblacklight/solr_document/finder.rb +1 -0
- data/app/models/concerns/geoblacklight/solr_document/inspection.rb +2 -1
- data/app/models/concerns/geoblacklight/spatial_search_behavior.rb +3 -1
- data/app/presenters/geoblacklight/document_presenter.rb +2 -1
- data/app/views/catalog/_arcgis.html.erb +4 -0
- data/app/views/catalog/_carto.html.erb +4 -0
- data/app/views/catalog/_downloads_primary.html.erb +8 -1
- data/app/views/catalog/_header_icons.html.erb +3 -3
- data/app/views/catalog/_home_text.html.erb +3 -0
- data/app/views/catalog/_index_split_default.html.erb +21 -21
- data/app/views/relation/_ancestors.html.erb +1 -4
- data/app/views/relation/_descendants.html.erb +2 -5
- data/app/views/relation/index.html.erb +20 -8
- data/app/views/relation/index.json.jbuilder +2 -1
- data/app/views/shared/_header_navbar.html.erb +0 -2
- data/bin/coverage.rb +36 -0
- data/config/initializers/rails_config.rb +1 -0
- data/config/locales/geoblacklight.en.yml +3 -2
- data/geoblacklight.gemspec +3 -6
- data/lib/generators/geoblacklight/assets_generator.rb +46 -0
- data/lib/generators/geoblacklight/install_generator.rb +3 -9
- data/lib/generators/geoblacklight/templates/assets/_blacklight.scss +1 -0
- data/lib/generators/geoblacklight/templates/assets/_customizations.scss +28 -0
- data/{app/assets/stylesheets/geoblacklight/application.scss → lib/generators/geoblacklight/templates/assets/_geoblacklight.scss} +0 -1
- data/lib/generators/geoblacklight/templates/assets/application.scss +7 -0
- data/lib/generators/geoblacklight/templates/{geoblacklight.js → assets/geoblacklight.js} +0 -0
- data/lib/generators/geoblacklight/templates/catalog_controller.rb +3 -2
- data/lib/generators/geoblacklight/templates/settings.yml +0 -6
- data/lib/generators/geoblacklight/webpacker_generator.rb +1 -0
- data/lib/geoblacklight.rb +1 -0
- data/lib/geoblacklight/bounding_box.rb +1 -0
- data/lib/geoblacklight/catalog_helper_override.rb +1 -0
- data/lib/geoblacklight/constants.rb +1 -0
- data/lib/geoblacklight/download.rb +2 -1
- data/lib/geoblacklight/download/geojson_download.rb +1 -0
- data/lib/geoblacklight/download/geotiff_download.rb +1 -0
- data/lib/geoblacklight/download/hgl_download.rb +1 -0
- data/lib/geoblacklight/download/kmz_download.rb +2 -1
- data/lib/geoblacklight/download/shapefile_download.rb +1 -0
- data/lib/geoblacklight/engine.rb +1 -2
- data/lib/geoblacklight/exceptions.rb +1 -0
- data/lib/geoblacklight/geoblacklight_helper_behavior.rb +1 -0
- data/lib/geoblacklight/item_viewer.rb +1 -0
- data/lib/geoblacklight/metadata.rb +1 -0
- data/lib/geoblacklight/metadata/base.rb +1 -0
- data/lib/geoblacklight/metadata/fgdc.rb +1 -0
- data/lib/geoblacklight/metadata/html.rb +2 -2
- data/lib/geoblacklight/metadata/iso19139.rb +1 -0
- data/lib/geoblacklight/metadata_transformer.rb +1 -0
- data/lib/geoblacklight/metadata_transformer/base.rb +1 -0
- data/lib/geoblacklight/metadata_transformer/fgdc.rb +1 -0
- data/lib/geoblacklight/metadata_transformer/iso19139.rb +1 -0
- data/lib/geoblacklight/reference.rb +1 -0
- data/lib/geoblacklight/references.rb +7 -3
- data/lib/geoblacklight/relation/ancestors.rb +1 -0
- data/lib/geoblacklight/relation/descendants.rb +1 -0
- data/lib/geoblacklight/relation/relation_response.rb +2 -1
- data/lib/geoblacklight/routes.rb +1 -0
- data/lib/geoblacklight/routes/downloadable.rb +1 -0
- data/lib/geoblacklight/routes/exportable.rb +1 -0
- data/lib/geoblacklight/routes/wms.rb +1 -0
- data/lib/geoblacklight/version.rb +2 -1
- data/lib/geoblacklight/view_helper_override.rb +1 -0
- data/lib/geoblacklight/wms_layer.rb +1 -0
- data/lib/geoblacklight/wms_layer/feature_info_response.rb +1 -0
- data/lib/tasks/geoblacklight.rake +33 -32
- data/spec/controllers/catalog_controller_spec.rb +1 -0
- data/spec/controllers/download_controller_spec.rb +1 -0
- data/spec/controllers/relation_controller_spec.rb +1 -0
- data/spec/controllers/wms_controller_spec.rb +1 -0
- data/spec/factories/user.rb +1 -0
- data/spec/features/bookmarks_spec.rb +1 -0
- data/spec/features/configurable_basemap_spec.rb +1 -0
- data/spec/features/data_dictionary_download_spec.rb +1 -0
- data/spec/features/download_layer_spec.rb +1 -0
- data/spec/features/empty_search_spec.rb +1 -0
- data/spec/features/esri_viewer_spec.rb +1 -5
- data/spec/features/exports_spec.rb +4 -12
- data/spec/features/help_text_spec.rb +1 -0
- data/spec/features/home_page_spec.rb +6 -0
- data/spec/features/iiif_viewer_spec.rb +1 -0
- data/spec/features/index_map_spec.rb +1 -0
- data/spec/features/layer_inspection_spec.rb +1 -0
- data/spec/features/layer_opacity_spec.rb +1 -0
- data/spec/features/layer_preview_spec.rb +1 -0
- data/spec/features/layer_with_no_references_spec.rb +1 -0
- data/spec/features/linkified_attribute_table_spec.rb +1 -0
- data/spec/features/metadata_panel_spec.rb +1 -0
- data/spec/features/missing_metadata_spec.rb +1 -0
- data/spec/features/multiple_downloads_spec.rb +15 -0
- data/spec/features/oembed_spec.rb +1 -0
- data/spec/features/relations_spec.rb +10 -29
- data/spec/features/saved_searches_spec.rb +1 -0
- data/spec/features/search_bar_spec.rb +1 -0
- data/spec/features/search_results_map_spec.rb +1 -6
- data/spec/features/search_results_overlap_ratio_spec.rb +4 -3
- data/spec/features/search_spec.rb +1 -0
- data/spec/features/show_page_metadata_spec.rb +1 -0
- data/spec/features/sms_spec.rb +1 -0
- data/spec/features/split_view.html.erb_spec.rb +2 -1
- data/spec/features/suppressed_records_spec.rb +1 -0
- data/spec/features/web_services_modal_spec.rb +1 -0
- data/spec/fixtures/solr_documents/multiple-downloads.json +30 -0
- data/spec/helpers/arcgis_helper_spec.rb +1 -0
- data/spec/helpers/carto_helper_spec.rb +1 -0
- data/spec/helpers/geoblacklight_helper_spec.rb +47 -14
- data/spec/javascripts/geoblacklight/viewers/esri/tiled_map_layer_spec.js +12 -0
- data/spec/lib/geoblacklight/bounding_box_spec.rb +1 -0
- data/spec/lib/geoblacklight/controller_override_spec.rb +1 -0
- data/spec/lib/geoblacklight/document_presenter_spec.rb +3 -2
- data/spec/lib/geoblacklight/download/geojson_download_spec.rb +1 -0
- data/spec/lib/geoblacklight/download/geotiff_download_spec.rb +1 -0
- data/spec/lib/geoblacklight/download/hgl_download_spec.rb +1 -0
- data/spec/lib/geoblacklight/download/kmz_download_spec.rb +1 -0
- data/spec/lib/geoblacklight/download/shapefile_download_spec.rb +1 -0
- data/spec/lib/geoblacklight/download_spec.rb +2 -1
- data/spec/lib/geoblacklight/geoblacklight_helper_behavior_spec.rb +1 -0
- data/spec/lib/geoblacklight/item_viewer_spec.rb +1 -0
- data/spec/lib/geoblacklight/metadata/base_spec.rb +1 -0
- data/spec/lib/geoblacklight/metadata/html_spec.rb +1 -0
- data/spec/lib/geoblacklight/metadata_spec.rb +1 -0
- data/spec/lib/geoblacklight/metadata_transformer/base_spec.rb +3 -2
- data/spec/lib/geoblacklight/metadata_transformer/fgdc_spec.rb +3 -2
- data/spec/lib/geoblacklight/metadata_transformer/iso19139_spec.rb +3 -2
- data/spec/lib/geoblacklight/metadata_transformer_spec.rb +4 -3
- data/spec/lib/geoblacklight/reference_spec.rb +1 -0
- data/spec/lib/geoblacklight/references_spec.rb +2 -3
- data/spec/lib/geoblacklight/relation/ancestors_spec.rb +1 -0
- data/spec/lib/geoblacklight/relation/descendants_spec.rb +1 -0
- data/spec/lib/geoblacklight/relation/relation_response_spec.rb +1 -0
- data/spec/lib/geoblacklight/view_helper_override_spec.rb +1 -0
- data/spec/lib/geoblacklight/wms_layer/feature_info_response_spec.rb +5 -4
- data/spec/lib/geoblacklight/wms_layer_spec.rb +1 -0
- data/spec/models/concerns/geoblacklight/solr_document/carto_spec.rb +1 -20
- data/spec/models/concerns/geoblacklight/solr_document/citation_spec.rb +1 -0
- data/spec/models/concerns/geoblacklight/solr_document/finder_spec.rb +1 -0
- data/spec/models/concerns/geoblacklight/solr_document/inspection_spec.rb +1 -0
- data/spec/models/concerns/geoblacklight/solr_document_spec.rb +1 -0
- data/spec/models/concerns/geoblacklight/spatial_search_behavior_spec.rb +15 -2
- data/spec/routing/catalog_routing_spec.rb +1 -0
- data/spec/spec_helper.rb +12 -9
- data/spec/support/backport_test_helpers.rb +1 -0
- data/spec/support/features.rb +1 -0
- data/spec/support/features/session_helpers.rb +1 -0
- data/spec/support/fixtures.rb +1 -0
- data/spec/tasks/geoblacklight_spec.rb +4 -3
- data/spec/teaspoon_env.rb +1 -0
- data/spec/test_app_templates/lib/generators/test_app_generator.rb +1 -0
- data/spec/views/catalog/_document_split.html.erb_spec.rb +1 -0
- data/spec/views/catalog/_index_split.html.erb_spec.rb +1 -0
- data/spec/views/catalog/_results_pagination.html.erb_spec.rb +1 -0
- data/spec/views/catalog/_show_downloads.html.erb_spec.rb +1 -0
- data/spec/views/catalog/_show_tools.html.erb_spec.rb +2 -4
- data/template.rb +1 -0
- metadata +42 -68
- data/app/assets/stylesheets/geoblacklight/_geoblacklight.scss +0 -36
- data/app/assets/stylesheets/geoblacklight/modules/relations.scss +0 -15
- data/app/views/catalog/_exports.html.erb +0 -3
- data/app/views/catalog/_show_tools.html.erb +0 -25
- data/lib/generators/geoblacklight/templates/geoblacklight.scss +0 -4
- data/vendor/assets/javascripts/readmore.js +0 -0
- data/vendor/assets/javascripts/readmore.min.js +0 -0
@@ -1,8 +1,5 @@
|
|
1
|
-
<li class="list-group-item relations-ancestors">
|
2
|
-
<b><%= t('geoblacklight.relations.ancestor') %></b>
|
3
|
-
</li>
|
4
1
|
<% @relations.ancestors['docs'].each do |ancestor| %>
|
5
|
-
<li class="list-group-item">
|
2
|
+
<li class="list-group-item border-bottom-0">
|
6
3
|
<%= link_to solr_document_path(ancestor['layer_slug_s']) do %>
|
7
4
|
<%= relations_icon(ancestor, 'pagelines-brands') %>
|
8
5
|
<%= ancestor['dc_title_s'] %>
|
@@ -1,8 +1,5 @@
|
|
1
|
-
<li class="list-group-item relations-descendants">
|
2
|
-
<b><%= t('geoblacklight.relations.descendant', count: @relations.descendants['numFound']) %></b>
|
3
|
-
</li>
|
4
1
|
<% @relations.descendants['docs'][0..2].each do |descendant| %>
|
5
|
-
<li class="list-group-item">
|
2
|
+
<li class="list-group-item border-bottom-0">
|
6
3
|
<%= link_to solr_document_path(descendant['layer_slug_s']) do %>
|
7
4
|
<%= relations_icon(descendant, 'leaf') %>
|
8
5
|
<%= descendant['dc_title_s'] %>
|
@@ -10,7 +7,7 @@
|
|
10
7
|
</li>
|
11
8
|
<% end %>
|
12
9
|
<% unless (@relations.descendants['numFound'].to_i <= 3) %>
|
13
|
-
<li class="list-group-item">
|
10
|
+
<li class="list-group-item border-bottom-0">
|
14
11
|
<%= link_to search_catalog_path({f: {"#{Settings.FIELDS.SOURCE}" => [@relations.link_id]}}) do %>
|
15
12
|
<%= t('geoblacklight.relations.browse_all', count: @relations.descendants['numFound']) %>
|
16
13
|
<% end %>
|
@@ -1,13 +1,25 @@
|
|
1
1
|
<% unless @relations.empty? %>
|
2
|
-
|
3
|
-
<div class="card
|
4
|
-
|
2
|
+
<% unless @relations.ancestors['numFound'].to_i.zero? %>
|
3
|
+
<div class="card relations">
|
4
|
+
<div class="card-header">
|
5
|
+
<h2 class="mb-0 h6"><%= t('geoblacklight.relations.ancestor') %></h2>
|
6
|
+
</div>
|
7
|
+
|
8
|
+
<ul class="list-group list-group-flush">
|
9
|
+
<%= render 'ancestors' %>
|
10
|
+
</ul>
|
5
11
|
</div>
|
12
|
+
<% end %>
|
6
13
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
14
|
+
<% unless @relations.descendants['numFound'].to_i.zero? %>
|
15
|
+
<div class="card relations">
|
16
|
+
<div class="card-header">
|
17
|
+
<h2 class="mb-0 h6"><%= t('geoblacklight.relations.descendant') %></h2>
|
18
|
+
</div>
|
11
19
|
|
12
|
-
|
20
|
+
<ul class="list-group list-group-flush">
|
21
|
+
<%= render 'descendants' %>
|
22
|
+
</ul>
|
23
|
+
</div>
|
24
|
+
<% end %>
|
13
25
|
<% end %>
|
data/bin/coverage.rb
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
# Borrowed from https://github.com/pulibrary/figgy/blob/master/scripts/combine_coverage.rb
|
3
|
+
require 'active_support/inflector'
|
4
|
+
require 'simplecov'
|
5
|
+
|
6
|
+
class SimpleCovHelper
|
7
|
+
def self.report_coverage(base_dir: './coverage_results')
|
8
|
+
min_cov = ENV['MINIMUM_COVERAGE'] || 100
|
9
|
+
SimpleCov.configure do
|
10
|
+
minimum_coverage(min_cov.to_i)
|
11
|
+
end
|
12
|
+
new(base_dir: base_dir).merge_results
|
13
|
+
end
|
14
|
+
|
15
|
+
attr_reader :base_dir
|
16
|
+
|
17
|
+
def initialize(base_dir:)
|
18
|
+
@base_dir = base_dir
|
19
|
+
end
|
20
|
+
|
21
|
+
def all_results
|
22
|
+
Dir["#{base_dir}/.resultset*.json"]
|
23
|
+
end
|
24
|
+
|
25
|
+
def merge_results
|
26
|
+
results = all_results.map { |file| SimpleCov::Result.from_hash(JSON.parse(File.read(file))) }
|
27
|
+
results = SimpleCov::ResultMerger.merge_results(*results)
|
28
|
+
results.format!
|
29
|
+
covered_percent = results.covered_percent.round(2)
|
30
|
+
return unless covered_percent < SimpleCov.minimum_coverage[:line]
|
31
|
+
$stderr.printf("Coverage (%.2f%%) is below the expected minimum coverage (%.2f%%).\n", covered_percent, SimpleCov.minimum_coverage[:line])
|
32
|
+
Kernel.exit SimpleCov::ExitCodes::MINIMUM_COVERAGE
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
SimpleCovHelper.report_coverage
|
@@ -29,6 +29,7 @@ en:
|
|
29
29
|
data_type: 'Data type'
|
30
30
|
placename: 'Placename'
|
31
31
|
subject: 'Subject'
|
32
|
+
version: 'GeoBlacklight version %{version}'
|
32
33
|
tools:
|
33
34
|
login_to_view: 'Login to View and Download'
|
34
35
|
open_carto: 'Open in Carto'
|
@@ -65,10 +66,10 @@ en:
|
|
65
66
|
services_close: 'Close'
|
66
67
|
relations:
|
67
68
|
ancestor: 'Source Datasets'
|
68
|
-
descendant: 'Derived Datasets
|
69
|
+
descendant: 'Derived Datasets'
|
69
70
|
browse_all: "Browse all %{count} records..."
|
70
|
-
title: 'Data Relations'
|
71
71
|
metadata:
|
72
|
+
toggle_summary: 'Toggle summary'
|
72
73
|
view_metadata: 'View Metadata'
|
73
74
|
more_details: 'More details at'
|
74
75
|
metadata_error: 'The metadata view for selected schema is not available'
|
data/geoblacklight.gemspec
CHANGED
@@ -19,30 +19,27 @@ Gem::Specification.new do |spec|
|
|
19
19
|
spec.require_paths = ['lib']
|
20
20
|
spec.required_rubygems_version = '>= 2.5.2'
|
21
21
|
|
22
|
-
spec.add_dependency 'rails', '
|
22
|
+
spec.add_dependency 'rails', '>= 5.2.4', '< 6.1'
|
23
23
|
spec.add_dependency 'blacklight', '~> 7.0'
|
24
|
-
spec.add_dependency 'font-awesome-rails'
|
25
24
|
spec.add_dependency 'config'
|
26
25
|
spec.add_dependency 'faraday', '~> 1.0'
|
27
26
|
spec.add_dependency 'faraday_middleware', '~> 1.0.0.rc1'
|
28
27
|
spec.add_dependency 'coderay'
|
29
|
-
spec.add_dependency 'geoblacklight-icons', '>= 0.2'
|
30
28
|
spec.add_dependency 'deprecation'
|
31
29
|
spec.add_dependency 'geo_combine', '~> 0.4'
|
32
30
|
spec.add_dependency 'mime-types'
|
33
31
|
spec.add_dependency 'handlebars_assets'
|
34
|
-
spec.add_dependency 'webpacker'
|
32
|
+
spec.add_dependency 'webpacker', '~> 4.0'
|
35
33
|
|
36
34
|
spec.add_development_dependency 'solr_wrapper'
|
37
35
|
spec.add_development_dependency 'rails-controller-testing'
|
38
|
-
spec.add_development_dependency 'rspec-rails'
|
36
|
+
spec.add_development_dependency 'rspec-rails'
|
39
37
|
spec.add_development_dependency 'engine_cart', '~> 2.0'
|
40
38
|
spec.add_development_dependency 'capybara', '>= 2.5.0'
|
41
39
|
spec.add_development_dependency 'webdrivers'
|
42
40
|
spec.add_development_dependency 'factory_bot_rails'
|
43
41
|
spec.add_development_dependency 'database_cleaner', '~> 1.3'
|
44
42
|
spec.add_development_dependency 'bixby'
|
45
|
-
spec.add_development_dependency 'coveralls'
|
46
43
|
spec.add_development_dependency 'simplecov', '~> 0.16'
|
47
44
|
spec.add_development_dependency 'foreman'
|
48
45
|
spec.add_development_dependency 'teaspoon'
|
@@ -0,0 +1,46 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'rails/generators'
|
4
|
+
|
5
|
+
module Geoblacklight
|
6
|
+
class AssetsGenerator < Rails::Generators::Base
|
7
|
+
source_root File.expand_path('templates', __dir__)
|
8
|
+
|
9
|
+
desc <<-DESCRIPTION
|
10
|
+
This generator makes the following changes to your application:
|
11
|
+
1. Copies GBL javascript into the application
|
12
|
+
2. Removes stock Rails and Blacklight stylesheets from the application
|
13
|
+
3. Copies GBL stylesheets into the local application
|
14
|
+
4. Sets asset initializer values into the local application
|
15
|
+
DESCRIPTION
|
16
|
+
|
17
|
+
def add_javascript
|
18
|
+
copy_file 'assets/geoblacklight.js', 'app/assets/javascripts/geoblacklight.js'
|
19
|
+
|
20
|
+
if Rails.version.to_i == 6
|
21
|
+
append_to_file 'app/assets/javascripts/application.js',
|
22
|
+
"\n// Required by GeoBlacklight\n//= require geoblacklight"
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
def remove_stylesheets
|
27
|
+
remove_file 'app/assets/stylesheets/application.css'
|
28
|
+
remove_file 'app/assets/stylesheets/blacklight.scss'
|
29
|
+
end
|
30
|
+
|
31
|
+
def add_stylesheets
|
32
|
+
copy_file 'assets/application.scss', 'app/assets/stylesheets/application.scss'
|
33
|
+
copy_file 'assets/_blacklight.scss', 'app/assets/stylesheets/_blacklight.scss'
|
34
|
+
copy_file 'assets/_customizations.scss', 'app/assets/stylesheets/_customizations.scss'
|
35
|
+
copy_file 'assets/_geoblacklight.scss', 'app/assets/stylesheets/_geoblacklight.scss'
|
36
|
+
end
|
37
|
+
|
38
|
+
def add_initializers
|
39
|
+
append_to_file 'config/initializers/assets.rb',
|
40
|
+
"\nRails.application.config.assets.precompile += %w( favicon.ico )\n"
|
41
|
+
|
42
|
+
append_to_file 'config/initializers/assets.rb',
|
43
|
+
"\nRails.application.config.assets.paths << Rails.root.join('vendor', 'assets', 'images')\n"
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
require 'rails/generators'
|
2
3
|
|
3
4
|
module Geoblacklight
|
@@ -30,15 +31,8 @@ module Geoblacklight
|
|
30
31
|
inject_into_file 'config/routes.rb', routes, before: /^end/
|
31
32
|
end
|
32
33
|
|
33
|
-
def
|
34
|
-
|
35
|
-
copy_file 'geoblacklight.js', 'app/assets/javascripts/geoblacklight.js'
|
36
|
-
|
37
|
-
append_to_file 'config/initializers/assets.rb',
|
38
|
-
"\nRails.application.config.assets.precompile += %w( favicon.ico )\n"
|
39
|
-
|
40
|
-
append_to_file 'config/initializers/assets.rb',
|
41
|
-
"\nRails.application.config.assets.paths << Rails.root.join('vendor', 'assets', 'images')\n"
|
34
|
+
def generate_assets
|
35
|
+
generate 'geoblacklight:assets'
|
42
36
|
end
|
43
37
|
|
44
38
|
def create_blacklight_catalog
|
@@ -0,0 +1 @@
|
|
1
|
+
@import 'blacklight/blacklight';
|
@@ -0,0 +1,28 @@
|
|
1
|
+
// Local Application Customizations
|
2
|
+
|
3
|
+
// Set Header Logo
|
4
|
+
$logo-image: image_url('blacklight/logo.svg') !default;
|
5
|
+
|
6
|
+
.navbar-brand { /* The main logo image for the Blacklight instance */
|
7
|
+
@if $logo-image {
|
8
|
+
background: transparent $logo-image no-repeat top left;
|
9
|
+
}
|
10
|
+
}
|
11
|
+
|
12
|
+
// Optional
|
13
|
+
// Override default Bootstrap variables here
|
14
|
+
|
15
|
+
// Example: Bootstrap Colors
|
16
|
+
$blue: #007bff !default;
|
17
|
+
$indigo: #6610f2 !default;
|
18
|
+
$purple: #6f42c1 !default;
|
19
|
+
$pink: #e83e8c !default;
|
20
|
+
$red: #dc3545 !default;
|
21
|
+
$orange: #fd7e14 !default;
|
22
|
+
$yellow: #ffc107 !default;
|
23
|
+
$green: #28a745 !default;
|
24
|
+
$teal: #20c997 !default;
|
25
|
+
$cyan: #17a2b8 !default;
|
26
|
+
|
27
|
+
// Example: Bootstrap Link color
|
28
|
+
$link-color: $blue;
|
File without changes
|
@@ -245,8 +245,9 @@ class CatalogController < ApplicationController
|
|
245
245
|
# Custom tools for GeoBlacklight
|
246
246
|
config.add_show_tools_partial :web_services, if: proc { |_context, _config, options| options[:document] && (Settings.WEBSERVICES_SHOWN & options[:document].references.refs.map(&:type).map(&:to_s)).any? }
|
247
247
|
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? }
|
248
|
-
config.add_show_tools_partial :
|
249
|
-
config.add_show_tools_partial :
|
248
|
+
config.add_show_tools_partial :carto, partial: 'carto', if: proc { |_context, _config, options| options[:document] && options[:document].carto_reference.present? }
|
249
|
+
config.add_show_tools_partial :arcgis, partial: 'arcgis', if: proc { |_context, _config, options| options[:document] && options[:document].arcgis_urls.present? }
|
250
|
+
config.add_show_tools_partial :data_dictionary, partial: 'data_dictionary', if: proc { |_context, _config, options| options[:document] && options[:document].data_dictionary_download.present? }
|
250
251
|
|
251
252
|
# Configure basemap provider for GeoBlacklight maps (uses https only basemap
|
252
253
|
# providers with open licenses)
|
@@ -4,12 +4,6 @@ APPLICATION_LOGO_URL: 'http://geoblacklight.org/images/geoblacklight-logo.png'
|
|
4
4
|
# Carto OneClick Service https://carto.com/engine/open-in-carto/
|
5
5
|
CARTO_ONECLICK_LINK: 'http://oneclick.carto.com/'
|
6
6
|
|
7
|
-
# Hide Carto export link
|
8
|
-
# CARTO_HIDE: true
|
9
|
-
|
10
|
-
# Hide ArcGIS export link
|
11
|
-
# ARCGIS_HIDE: true
|
12
|
-
|
13
7
|
# ArcGIS Online Base URL
|
14
8
|
ARCGIS_BASE_URL: 'https://www.arcgis.com/home/webmap/viewer.html'
|
15
9
|
|
data/lib/geoblacklight.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
module Geoblacklight
|
2
3
|
class Download
|
3
4
|
def initialize(document, options = {})
|
@@ -14,7 +15,7 @@ module Geoblacklight
|
|
14
15
|
end
|
15
16
|
|
16
17
|
def self.file_path
|
17
|
-
Settings.DOWNLOAD_PATH ||
|
18
|
+
Settings.DOWNLOAD_PATH || Rails.root.join('tmp', 'cache', 'downloads')
|
18
19
|
end
|
19
20
|
|
20
21
|
def file_path_and_name
|
@@ -1,9 +1,10 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
module Geoblacklight
|
2
3
|
class KmzDownload < Geoblacklight::Download
|
3
4
|
KMZ_DOWNLOAD_PARAMS = { service: 'wms',
|
4
5
|
version: '1.1.0',
|
5
6
|
request: 'GetMap',
|
6
|
-
srsName: 'EPSG:
|
7
|
+
srsName: 'EPSG:3857',
|
7
8
|
format: 'application/vnd.google-earth.kmz',
|
8
9
|
width: 2000, height: 2000 }.freeze
|
9
10
|
|
data/lib/geoblacklight/engine.rb
CHANGED
@@ -1,11 +1,10 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
require 'blacklight'
|
2
|
-
require 'font-awesome-rails'
|
3
3
|
require 'coderay'
|
4
4
|
require 'config'
|
5
5
|
require 'faraday'
|
6
6
|
require 'faraday_middleware'
|
7
7
|
require 'nokogiri'
|
8
|
-
require 'geoblacklight-icons'
|
9
8
|
require 'mime/types'
|
10
9
|
require 'handlebars_assets'
|
11
10
|
|