geoblacklight 0.11.1 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +1 -1
- data/.rubocop.yml +45 -0
- data/CONTRIBUTING.md +38 -0
- data/Gemfile +27 -6
- data/README.md +2 -9
- data/Rakefile +20 -11
- data/app/assets/javascripts/geoblacklight/basemaps.js +6 -3
- data/app/assets/javascripts/geoblacklight/modules/layer_opacity.js +13 -5
- data/app/assets/javascripts/geoblacklight/viewers/map.js +7 -0
- data/app/assets/javascripts/geoblacklight/viewers/wms.js +2 -5
- data/app/assets/stylesheets/geoblacklight/modules/item.scss +1 -1
- data/app/controllers/download_controller.rb +18 -14
- data/app/controllers/wms_controller.rb +1 -1
- data/app/helpers/geoblacklight_helper.rb +17 -11
- data/{lib → app/models/concerns}/geoblacklight/solr_document.rb +13 -8
- data/{lib → app/models/concerns}/geoblacklight/solr_document/carto_db.rb +0 -0
- data/{lib → app/models/concerns}/geoblacklight/solr_document/finder.rb +1 -2
- data/app/models/concerns/geoblacklight/solr_document/inspection.rb +15 -0
- data/{lib → app/presenters}/geoblacklight/document_presenter.rb +0 -0
- data/app/views/catalog/_show_default_viewer_container.html.erb +1 -1
- data/config/initializers/rails_config.rb +2 -2
- data/geoblacklight.gemspec +3 -4
- data/lib/generators/geoblacklight/install_generator.rb +17 -16
- data/lib/generators/geoblacklight/templates/catalog_controller.rb +1 -5
- data/lib/generators/geoblacklight/templates/geoblacklight.css.scss +0 -1
- data/lib/generators/geoblacklight/templates/geoblacklight.js +0 -1
- data/lib/geoblacklight.rb +1 -6
- data/lib/geoblacklight/bounding_box.rb +2 -1
- data/lib/geoblacklight/catalog_helper_override.rb +0 -1
- data/lib/geoblacklight/download.rb +12 -7
- data/lib/geoblacklight/download/hgl_download.rb +2 -3
- data/lib/geoblacklight/download/kmz_download.rb +9 -3
- data/lib/geoblacklight/download/shapefile_download.rb +5 -1
- data/lib/geoblacklight/engine.rb +1 -3
- data/lib/geoblacklight/exceptions.rb +1 -1
- data/lib/geoblacklight/metadata.rb +0 -1
- data/lib/geoblacklight/references.rb +3 -4
- data/lib/geoblacklight/routes.rb +5 -3
- data/lib/geoblacklight/search_builder.rb +3 -2
- data/lib/geoblacklight/version.rb +1 -1
- data/lib/geoblacklight/view_helper_override.rb +9 -10
- data/lib/geoblacklight/wms_layer.rb +12 -15
- data/lib/geoblacklight/wms_layer/feature_info_response.rb +1 -1
- data/spec/controllers/catalog_controller_spec.rb +1 -1
- data/spec/controllers/download_controller_spec.rb +7 -7
- data/spec/features/home_page_spec.rb +1 -1
- data/spec/features/layer_opacity_spec.rb +9 -0
- data/spec/features/metadata_panel_spec.rb +6 -4
- data/spec/features/saved_searches_spec.rb +1 -1
- data/spec/features/split_view.html.erb_spec.rb +3 -3
- data/spec/helpers/geoblacklight_helpers_spec.rb +3 -4
- data/spec/lib/geoblacklight/bounding_box_spec.rb +7 -7
- data/spec/lib/geoblacklight/controller_override_spec.rb +1 -1
- data/spec/lib/geoblacklight/document_presenter_spec.rb +1 -1
- data/spec/lib/geoblacklight/download/geojson_download_spec.rb +5 -5
- data/spec/lib/geoblacklight/download/geotiff_download_spec.rb +5 -5
- data/spec/lib/geoblacklight/download/hgl_download_spec.rb +6 -6
- data/spec/lib/geoblacklight/download/kmz_download_spec.rb +5 -5
- data/spec/lib/geoblacklight/download/shapefile_download_spec.rb +5 -5
- data/spec/lib/geoblacklight/download_spec.rb +14 -14
- data/spec/lib/geoblacklight/geoblacklight_helper_behavior_spec.rb +2 -1
- data/spec/lib/geoblacklight/item_viewer_spec.rb +5 -5
- data/spec/lib/geoblacklight/metadata_spec.rb +3 -3
- data/spec/lib/geoblacklight/reference_spec.rb +3 -3
- data/spec/lib/geoblacklight/references_spec.rb +34 -34
- data/spec/lib/geoblacklight/search_builder_spec.rb +7 -15
- data/spec/lib/geoblacklight/view_helper_override_spec.rb +15 -15
- data/spec/lib/geoblacklight/wms_layer/feature_info_response_spec.rb +10 -10
- data/spec/lib/geoblacklight/wms_layer_spec.rb +7 -7
- data/spec/{lib → models/concerns}/geoblacklight/solr_document/carto_db_spec.rb +0 -0
- data/spec/{lib → models/concerns}/geoblacklight/solr_document/finder_spec.rb +2 -2
- data/spec/models/concerns/geoblacklight/solr_document/inspection_spec.rb +16 -0
- data/spec/{lib → models/concerns}/geoblacklight/solr_document_spec.rb +24 -24
- data/spec/spec_helper.rb +6 -7
- data/spec/support/features.rb +1 -1
- data/spec/support/features/session_helpers.rb +1 -1
- data/spec/teaspoon_env.rb +38 -33
- data/spec/test_app_templates/lib/generators/test_app_generator.rb +4 -4
- data/spec/views/catalog/_document_split.html.erb_spec.rb +1 -1
- data/spec/views/catalog/_index_split.html.erb_spec.rb +1 -1
- metadata +31 -33
- data/lib/geoblacklight/config.rb +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dfda49bfa6025f3416c022717d15dcd41c134703
|
4
|
+
data.tar.gz: 0423a836a4df4ae842fdc528ae74c22b0ecb9090
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a97618a0fd0ba4623f1e3d7c6cb78273c01b76da95eba0005fd471e65b87068e85ff0e23863b21571a5b3bb8c092f7ecd3ace080b5e116f5f42c9ab4f8cfd73d
|
7
|
+
data.tar.gz: 473b5f90e4a81b9e05714344b8d1d8878c43fa5de0b410316753aaca2b7bd52265fb250bf50e368aae9c818521c019f1bdea3a7ca93fe0c6786db3a7582514f8
|
data/.gitignore
CHANGED
data/.rubocop.yml
ADDED
@@ -0,0 +1,45 @@
|
|
1
|
+
require: rubocop-rspec
|
2
|
+
|
3
|
+
AllCops:
|
4
|
+
RunRailsCops: true
|
5
|
+
DisplayCopNames: true
|
6
|
+
|
7
|
+
Include:
|
8
|
+
- '**/Rakefile'
|
9
|
+
|
10
|
+
Exclude:
|
11
|
+
- 'db/**/*'
|
12
|
+
- 'vendor/**/*'
|
13
|
+
- '.internal_test_app/**/*'
|
14
|
+
- 'lib/generators/geoblacklight/templates/**/*'
|
15
|
+
|
16
|
+
Metrics/LineLength:
|
17
|
+
Max: 100
|
18
|
+
Exclude:
|
19
|
+
- 'spec/**/*'
|
20
|
+
- 'Rakefile'
|
21
|
+
- 'lib/generators/geoblacklight/install_generator.rb'
|
22
|
+
|
23
|
+
# TODO: Refactor large methods.
|
24
|
+
Metrics/AbcSize:
|
25
|
+
Max: 23
|
26
|
+
|
27
|
+
Metrics/MethodLength:
|
28
|
+
Max: 15
|
29
|
+
|
30
|
+
# TODO: Add top-level class and module documentation.
|
31
|
+
Style/Documentation:
|
32
|
+
Enabled: false
|
33
|
+
|
34
|
+
# Overrides method in blacklight. Must use method name.
|
35
|
+
Style/PredicateName:
|
36
|
+
Exclude:
|
37
|
+
- 'lib/geoblacklight/view_helper_override.rb'
|
38
|
+
|
39
|
+
RSpec/FilePath:
|
40
|
+
Enabled: false
|
41
|
+
|
42
|
+
# Rubocop bug causes view specs to fail.
|
43
|
+
# https://github.com/nevir/rubocop-rspec/issues/47
|
44
|
+
RSpec/DescribeClass:
|
45
|
+
Enabled: false
|
data/CONTRIBUTING.md
ADDED
@@ -0,0 +1,38 @@
|
|
1
|
+
## Contributing
|
2
|
+
GeoBlacklight is a collaborative open source projects where contributions are welcome. This contributing guide is borrowed in part from the [Hydra Contributing Guide](https://github.com/projecthydra/hydra/blob/master/CONTRIBUTING.md) and the [Blacklight Contributing Wiki](https://github.com/projectblacklight/blacklight/wiki/Contributing-to-Blacklight).
|
3
|
+
|
4
|
+
### Reporting issues
|
5
|
+
Did you find a bug in GeoBlacklight or interested in a new feature? Make sure to add an issue for it in the [issue tracker](https://github.com/geoblacklight/geoblacklight/issues).
|
6
|
+
|
7
|
+
- Make sure you have a [GitHub account](https://github.com/signup/free)
|
8
|
+
- Submit a [Github issue](./issues) by:
|
9
|
+
- Clearly describing the issue
|
10
|
+
- Provide a descriptive summary
|
11
|
+
- Explain the expected behavior
|
12
|
+
- Explain the actual behavior
|
13
|
+
- Provide steps to reproduce the actual behavior
|
14
|
+
|
15
|
+
|
16
|
+
### Contributing code or documentation
|
17
|
+
GeoBlacklight welcomes code and documentation contributions. We follow the [pull request](https://help.github.com/articles/using-pull-requests/) model for contributing on GitHub.
|
18
|
+
|
19
|
+
#### Pull request overview
|
20
|
+
1. Fork it ( http://github.com/my-github-username/geoblacklight/fork )
|
21
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
22
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
23
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
24
|
+
5. Create new Pull Request
|
25
|
+
|
26
|
+
#### Merging Changes
|
27
|
+
|
28
|
+
- It is considered "poor from" to merge your own request.
|
29
|
+
- Please take the time to review the changes and get a sense of what is being changed. Things to consider:
|
30
|
+
- Does the commit message explain what is going on?
|
31
|
+
- Does the code changes have tests? _Not all changes need new tests, some changes are refactorings_
|
32
|
+
- Do all new methods, modules, and classes have comments? Do changed methods, modules, and classes have comments?
|
33
|
+
- Does the commit contain more than it should? Are two separate concerns being addressed in one commit?
|
34
|
+
- Did the Travis tests complete successfully?
|
35
|
+
- If you are uncertain, bring other contributors into the conversation by creating a comment that includes their @username.
|
36
|
+
- If you like the pull request, but want others to chime in, create a +1 comment and tag a user.
|
37
|
+
|
38
|
+
If you wish to ask questions or participate further, email the [GeoBlacklight Working Group](https://groups.google.com/forum/#!forum/geoblacklight-working-group) at [geoblacklight-working-group@googlegroups.com](mailto:geoblacklight-working-group@googlegroups.com).
|
data/Gemfile
CHANGED
@@ -8,16 +8,37 @@ gemspec
|
|
8
8
|
# it'll want sprockets 2.11.0 and we'll have a conflict
|
9
9
|
gem 'sprockets', '2.11.0'
|
10
10
|
|
11
|
-
group :test do
|
11
|
+
group :development, :test do
|
12
12
|
# Peg simplecov to < 0.8 until this is resolved:
|
13
13
|
# https://github.com/colszowka/simplecov/issues/281
|
14
14
|
gem 'simplecov', '~> 0.7.1', require: false
|
15
15
|
gem 'coveralls', require: false
|
16
|
+
gem 'rubocop', '0.35.1', require: false
|
17
|
+
gem 'rubocop-rspec', '1.3.1', require: false
|
16
18
|
end
|
17
19
|
|
18
|
-
#
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
20
|
+
# BEGIN ENGINE_CART BLOCK
|
21
|
+
# engine_cart: 0.8.0
|
22
|
+
# engine_cart stanza: 0.8.0
|
23
|
+
# the below comes from engine_cart, a gem used to test this Rails engine gem in the context of a Rails app.
|
24
|
+
file = File.expand_path("Gemfile", ENV['ENGINE_CART_DESTINATION'] || ENV['RAILS_ROOT'] || File.expand_path(".internal_test_app", File.dirname(__FILE__)))
|
25
|
+
if File.exist?(file)
|
26
|
+
begin
|
27
|
+
eval_gemfile file
|
28
|
+
rescue Bundler::GemfileError => e
|
29
|
+
Bundler.ui.warn '[EngineCart] Skipping Rails application dependencies:'
|
30
|
+
Bundler.ui.warn e.message
|
31
|
+
end
|
32
|
+
else
|
33
|
+
Bundler.ui.warn "[EngineCart] Unable to find test application dependencies in #{file}, using placeholder dependencies"
|
34
|
+
|
35
|
+
gem 'rails', ENV['RAILS_VERSION'] if ENV['RAILS_VERSION']
|
36
|
+
|
37
|
+
if ENV['RAILS_VERSION'].nil? || ENV['RAILS_VERSION'] =~ /^4.2/
|
38
|
+
gem 'responders', "~> 2.0"
|
39
|
+
gem 'sass-rails', ">= 5.0"
|
40
|
+
else
|
41
|
+
gem 'sass-rails', "< 5.0"
|
42
|
+
end
|
23
43
|
end
|
44
|
+
# END ENGINE_CART BLOCK
|
data/README.md
CHANGED
@@ -28,15 +28,8 @@ $ rake geoblacklight:configure_solr
|
|
28
28
|
Or install with [Docker](https://github.com/geoblacklight/geoblacklight-docker)
|
29
29
|
For more information see the [installation guide](https://github.com/geoblacklight/geoblacklight/wiki/Installation)
|
30
30
|
|
31
|
-
###
|
32
|
-
|
33
|
-
1. Fork it ( http://github.com/my-github-username/geoblacklight/fork )
|
34
|
-
2. Create your feature branch (`git checkout -b my-new-feature`)
|
35
|
-
3. Commit your changes (`git commit -am 'Add some feature'`)
|
36
|
-
4. Push to the branch (`git push origin my-new-feature`)
|
37
|
-
5. Create new Pull Request
|
38
|
-
|
39
|
-
Also, if you wish to ask questions or participate further, email the [GeoBlacklight Working Group](https://groups.google.com/forum/#!forum/geoblacklight-working-group) at [geoblacklight-working-group@googlegroups.com](mailto:geoblacklight-working-group@googlegroups.com).
|
31
|
+
### Contributing
|
32
|
+
Interested in contributing to GeoBlacklight? Please see our [contributing](CONTRIBUTING.md) guide.
|
40
33
|
|
41
34
|
###[Development](https://github.com/geoblacklight/geoblacklight/wiki/Development)
|
42
35
|
|
data/Rakefile
CHANGED
@@ -12,41 +12,50 @@ APP_ROOT = File.dirname(__FILE__)
|
|
12
12
|
require 'rspec/core/rake_task'
|
13
13
|
require 'engine_cart/rake_task'
|
14
14
|
require 'jettywrapper'
|
15
|
+
require 'rubocop/rake_task'
|
15
16
|
|
16
|
-
Dir.glob('lib/tasks/configure_solr.rake').each { |r| load r}
|
17
|
+
Dir.glob('lib/tasks/configure_solr.rake').each { |r| load r }
|
17
18
|
|
18
19
|
task default: :ci
|
19
20
|
|
20
|
-
|
21
|
+
desc 'Run style checker'
|
22
|
+
RuboCop::RakeTask.new(:rubocop) do |task|
|
23
|
+
task.fail_on_error = true
|
24
|
+
end
|
25
|
+
|
26
|
+
desc 'Run test suite and style checker'
|
27
|
+
task spec: :rubocop do
|
28
|
+
RSpec::Core::RakeTask.new(:spec)
|
29
|
+
end
|
21
30
|
|
22
|
-
desc
|
23
|
-
task :
|
31
|
+
desc 'Load fixtures'
|
32
|
+
task fixtures: ['engine_cart:generate'] do
|
24
33
|
EngineCart.within_test_app do
|
25
|
-
system
|
34
|
+
system 'rake geoblacklight:solr:seed RAILS_ENV=test'
|
26
35
|
system 'rake geoblacklight:downloads:mkdir'
|
27
36
|
end
|
28
37
|
end
|
29
38
|
|
30
39
|
desc 'Run Teaspoon JavaScript tests'
|
31
40
|
task :teaspoon do
|
32
|
-
system(
|
41
|
+
system('teaspoon --require=.internal_test_app/spec/teaspoon_env.rb')
|
33
42
|
end
|
34
43
|
|
35
|
-
desc
|
44
|
+
desc 'Execute Continuous Integration build'
|
36
45
|
task :ci do
|
37
46
|
if Rails.env.test?
|
38
47
|
Rake::Task['engine_cart:generate'].invoke
|
39
48
|
Rake::Task['jetty:clean'].invoke
|
40
49
|
Rake::Task['geoblacklight:configure_solr'].invoke
|
41
|
-
ENV['environment'] =
|
50
|
+
ENV['environment'] = 'test'
|
42
51
|
jetty_params = Jettywrapper.load_config
|
43
|
-
jetty_params[:startup_wait]= 60
|
52
|
+
jetty_params[:startup_wait] = 60
|
44
53
|
|
45
54
|
Jettywrapper.wrap(jetty_params) do
|
46
|
-
Rake::Task[
|
55
|
+
Rake::Task['fixtures'].invoke
|
47
56
|
|
48
57
|
# run the tests
|
49
|
-
Rake::Task[
|
58
|
+
Rake::Task['spec'].invoke
|
50
59
|
end
|
51
60
|
# Run JavaScript tests
|
52
61
|
Rake::Task['teaspoon'].invoke
|
@@ -5,7 +5,8 @@ GeoBlacklight.Basemaps = {
|
|
5
5
|
'https://cartodb-basemaps-{s}.global.ssl.fastly.net/dark_all/{z}/{x}/{y}.png', {
|
6
6
|
attribution: '© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors, © <a href="http://cartodb.com/attributions">CartoDB</a>',
|
7
7
|
maxZoom: 18,
|
8
|
-
worldCopyJump: true
|
8
|
+
worldCopyJump: true,
|
9
|
+
detectRetina: true
|
9
10
|
}
|
10
11
|
),
|
11
12
|
mapquest: L.tileLayer(
|
@@ -13,14 +14,16 @@ GeoBlacklight.Basemaps = {
|
|
13
14
|
attribution: '© <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, Tiles Courtesy of <a href="http://www.mapquest.com/" target="_blank">MapQuest</a> <img src="//developer.mapquest.com/content/osm/mq_logo.png" alt="">',
|
14
15
|
maxZoom: 18,
|
15
16
|
worldCopyJump: true,
|
16
|
-
subdomains: '1234' // see http://developer.mapquest.com/web/products/open/map
|
17
|
+
subdomains: '1234', // see http://developer.mapquest.com/web/products/open/map
|
18
|
+
detectRetina: true
|
17
19
|
}
|
18
20
|
),
|
19
21
|
positron: L.tileLayer(
|
20
22
|
'https://cartodb-basemaps-{s}.global.ssl.fastly.net/light_all/{z}/{x}/{y}.png', {
|
21
23
|
attribution: '© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors, © <a href="http://cartodb.com/attributions">CartoDB</a>',
|
22
24
|
maxZoom: 18,
|
23
|
-
worldCopyJump: true
|
25
|
+
worldCopyJump: true,
|
26
|
+
detectRetina: true
|
24
27
|
}
|
25
28
|
)
|
26
29
|
};
|
@@ -4,11 +4,19 @@
|
|
4
4
|
'use strict';
|
5
5
|
|
6
6
|
L.Control.LayerOpacity = L.Control.extend({
|
7
|
-
initialize: function(
|
8
|
-
var options = {
|
9
|
-
|
10
|
-
|
11
|
-
|
7
|
+
initialize: function(layer) {
|
8
|
+
var options = { position: 'topleft' };
|
9
|
+
|
10
|
+
// check if layer is actually a layer group
|
11
|
+
if (typeof layer.getLayers !== 'undefined') {
|
12
|
+
|
13
|
+
// add first layer from layer group to options
|
14
|
+
options.layer = layer.getLayers()[0];
|
15
|
+
} else {
|
16
|
+
|
17
|
+
// add layer to options
|
18
|
+
options.layer = layer;
|
19
|
+
}
|
12
20
|
|
13
21
|
L.Util.setOptions(this, options);
|
14
22
|
},
|
@@ -46,6 +46,13 @@ GeoBlacklight.Viewer.Map = GeoBlacklight.Viewer.extend({
|
|
46
46
|
this.overlay.clearLayers();
|
47
47
|
},
|
48
48
|
|
49
|
+
/**
|
50
|
+
* Add an opacity control to map.
|
51
|
+
*/
|
52
|
+
addOpacityControl: function() {
|
53
|
+
this.map.addControl(new L.Control.LayerOpacity(this.overlay));
|
54
|
+
},
|
55
|
+
|
49
56
|
/**
|
50
57
|
* Selects basemap if specified in data options, if not return mapquest
|
51
58
|
*/
|
@@ -23,16 +23,13 @@ GeoBlacklight.Viewer.Wms = GeoBlacklight.Viewer.Map.extend({
|
|
23
23
|
transparent: true,
|
24
24
|
tiled: true,
|
25
25
|
CRS: 'EPSG:900913',
|
26
|
-
opacity: 0.75
|
26
|
+
opacity: 0.75,
|
27
|
+
detectRetina: true
|
27
28
|
});
|
28
29
|
this.overlay.addLayer(wmsLayer);
|
29
30
|
this.setupInspection();
|
30
31
|
},
|
31
32
|
|
32
|
-
addOpacityControl: function() {
|
33
|
-
this.map.addControl(new L.Control.LayerOpacity(this.overlay));
|
34
|
-
},
|
35
|
-
|
36
33
|
setupInspection: function() {
|
37
34
|
var _this = this;
|
38
35
|
this.map.on('click', function(e) {
|
@@ -59,7 +59,7 @@ class DownloadController < ApplicationController
|
|
59
59
|
# Creates an error flash message with failed download url
|
60
60
|
# @param [Geoblacklight::Exceptions::ExternalDownloadFailed] Download failed
|
61
61
|
# exception
|
62
|
-
# @return [String] error message to display in flash
|
62
|
+
# @return [String] error message to display in flash
|
63
63
|
def flash_error_message(exception)
|
64
64
|
if exception.url
|
65
65
|
message = t('geoblacklight.download.error_with_url',
|
@@ -71,6 +71,7 @@ class DownloadController < ApplicationController
|
|
71
71
|
else
|
72
72
|
message = t('geoblacklight.download.error')
|
73
73
|
end
|
74
|
+
message
|
74
75
|
end
|
75
76
|
|
76
77
|
private
|
@@ -81,26 +82,29 @@ class DownloadController < ApplicationController
|
|
81
82
|
|
82
83
|
def check_type
|
83
84
|
response = case params[:type]
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
85
|
+
when 'shapefile'
|
86
|
+
Geoblacklight::ShapefileDownload.new(@document).get
|
87
|
+
when 'kmz'
|
88
|
+
Geoblacklight::KmzDownload.new(@document).get
|
89
|
+
when 'geojson'
|
90
|
+
Geoblacklight::GeojsonDownload.new(@document).get
|
91
|
+
when 'geotiff'
|
92
|
+
Geoblacklight::GeotiffDownload.new(@document).get
|
93
|
+
end
|
94
|
+
response
|
93
95
|
end
|
94
96
|
|
95
97
|
def validate(response)
|
96
|
-
flash[:success] = view_context.link_to(t('geoblacklight.download.success', title: response),
|
98
|
+
flash[:success] = view_context.link_to(t('geoblacklight.download.success', title: response),
|
99
|
+
download_file_path(response),
|
100
|
+
data: { download: 'trigger',
|
101
|
+
download_id: params[:id],
|
102
|
+
download_type: "generated-#{params[:type]}" })
|
97
103
|
end
|
98
104
|
|
99
105
|
# Checks whether a document is public, if not require user to authenticate
|
100
106
|
def restricted_should_authenticate
|
101
|
-
unless @document.public?
|
102
|
-
authenticate_user!
|
103
|
-
end
|
107
|
+
authenticate_user! unless @document.public?
|
104
108
|
end
|
105
109
|
|
106
110
|
def file_name_to_id(file_name)
|
@@ -1,11 +1,10 @@
|
|
1
1
|
module GeoblacklightHelper
|
2
|
-
|
3
|
-
|
4
|
-
content_tag(:i, '', :class => 'fa fa-mobile fa-fw') + ' ' + t('blacklight.tools.sms')
|
2
|
+
def sms_helper
|
3
|
+
content_tag(:i, '', class: 'fa fa-mobile fa-fw') + ' ' + t('blacklight.tools.sms')
|
5
4
|
end
|
6
5
|
|
7
6
|
def email_helper
|
8
|
-
content_tag(:i, '', :
|
7
|
+
content_tag(:i, '', class: 'fa fa-envelope fa-fw') + ' ' + t('blacklight.tools.email')
|
9
8
|
end
|
10
9
|
|
11
10
|
def document_available?
|
@@ -17,9 +16,9 @@ module GeoblacklightHelper
|
|
17
16
|
end
|
18
17
|
|
19
18
|
def snippit(text)
|
20
|
-
if
|
21
|
-
if
|
22
|
-
text.slice(0,150) + '...'
|
19
|
+
if text
|
20
|
+
if text.length > 150
|
21
|
+
text.slice(0, 150) + '...'
|
23
22
|
else
|
24
23
|
text
|
25
24
|
end
|
@@ -29,11 +28,16 @@ module GeoblacklightHelper
|
|
29
28
|
end
|
30
29
|
|
31
30
|
def render_facet_tags(facet)
|
32
|
-
render_facet_limit(facets_from_request(facet).first,
|
31
|
+
render_facet_limit(facets_from_request(facet).first,
|
32
|
+
partial: 'facet_tag_item',
|
33
|
+
layout: 'facet_tag_layout')
|
33
34
|
end
|
34
35
|
|
35
36
|
def geoblacklight_icon(name)
|
36
|
-
content_tag :span,
|
37
|
+
content_tag :span,
|
38
|
+
'',
|
39
|
+
class: "geoblacklight-icon geoblacklight-#{name.downcase.tr(' ', '-')}",
|
40
|
+
title: name
|
37
41
|
end
|
38
42
|
|
39
43
|
def render_search_form_no_navbar
|
@@ -45,7 +49,9 @@ module GeoblacklightHelper
|
|
45
49
|
# passed in using the facet parameter
|
46
50
|
#
|
47
51
|
def render_facet_links(facet, items)
|
48
|
-
items.uniq.map
|
52
|
+
items.uniq.map do |item|
|
53
|
+
link_to item, catalog_index_path(f: { "#{facet}" => [item] })
|
54
|
+
end.join(', ').html_safe
|
49
55
|
end
|
50
56
|
|
51
57
|
##
|
@@ -71,7 +77,7 @@ module GeoblacklightHelper
|
|
71
77
|
end
|
72
78
|
|
73
79
|
def show_attribute_table?
|
74
|
-
|
80
|
+
document_available? && @document.inspectable?
|
75
81
|
end
|
76
82
|
|
77
83
|
##
|