geoblacklight 0.11.1 → 0.12.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (83) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -1
  3. data/.rubocop.yml +45 -0
  4. data/CONTRIBUTING.md +38 -0
  5. data/Gemfile +27 -6
  6. data/README.md +2 -9
  7. data/Rakefile +20 -11
  8. data/app/assets/javascripts/geoblacklight/basemaps.js +6 -3
  9. data/app/assets/javascripts/geoblacklight/modules/layer_opacity.js +13 -5
  10. data/app/assets/javascripts/geoblacklight/viewers/map.js +7 -0
  11. data/app/assets/javascripts/geoblacklight/viewers/wms.js +2 -5
  12. data/app/assets/stylesheets/geoblacklight/modules/item.scss +1 -1
  13. data/app/controllers/download_controller.rb +18 -14
  14. data/app/controllers/wms_controller.rb +1 -1
  15. data/app/helpers/geoblacklight_helper.rb +17 -11
  16. data/{lib → app/models/concerns}/geoblacklight/solr_document.rb +13 -8
  17. data/{lib → app/models/concerns}/geoblacklight/solr_document/carto_db.rb +0 -0
  18. data/{lib → app/models/concerns}/geoblacklight/solr_document/finder.rb +1 -2
  19. data/app/models/concerns/geoblacklight/solr_document/inspection.rb +15 -0
  20. data/{lib → app/presenters}/geoblacklight/document_presenter.rb +0 -0
  21. data/app/views/catalog/_show_default_viewer_container.html.erb +1 -1
  22. data/config/initializers/rails_config.rb +2 -2
  23. data/geoblacklight.gemspec +3 -4
  24. data/lib/generators/geoblacklight/install_generator.rb +17 -16
  25. data/lib/generators/geoblacklight/templates/catalog_controller.rb +1 -5
  26. data/lib/generators/geoblacklight/templates/geoblacklight.css.scss +0 -1
  27. data/lib/generators/geoblacklight/templates/geoblacklight.js +0 -1
  28. data/lib/geoblacklight.rb +1 -6
  29. data/lib/geoblacklight/bounding_box.rb +2 -1
  30. data/lib/geoblacklight/catalog_helper_override.rb +0 -1
  31. data/lib/geoblacklight/download.rb +12 -7
  32. data/lib/geoblacklight/download/hgl_download.rb +2 -3
  33. data/lib/geoblacklight/download/kmz_download.rb +9 -3
  34. data/lib/geoblacklight/download/shapefile_download.rb +5 -1
  35. data/lib/geoblacklight/engine.rb +1 -3
  36. data/lib/geoblacklight/exceptions.rb +1 -1
  37. data/lib/geoblacklight/metadata.rb +0 -1
  38. data/lib/geoblacklight/references.rb +3 -4
  39. data/lib/geoblacklight/routes.rb +5 -3
  40. data/lib/geoblacklight/search_builder.rb +3 -2
  41. data/lib/geoblacklight/version.rb +1 -1
  42. data/lib/geoblacklight/view_helper_override.rb +9 -10
  43. data/lib/geoblacklight/wms_layer.rb +12 -15
  44. data/lib/geoblacklight/wms_layer/feature_info_response.rb +1 -1
  45. data/spec/controllers/catalog_controller_spec.rb +1 -1
  46. data/spec/controllers/download_controller_spec.rb +7 -7
  47. data/spec/features/home_page_spec.rb +1 -1
  48. data/spec/features/layer_opacity_spec.rb +9 -0
  49. data/spec/features/metadata_panel_spec.rb +6 -4
  50. data/spec/features/saved_searches_spec.rb +1 -1
  51. data/spec/features/split_view.html.erb_spec.rb +3 -3
  52. data/spec/helpers/geoblacklight_helpers_spec.rb +3 -4
  53. data/spec/lib/geoblacklight/bounding_box_spec.rb +7 -7
  54. data/spec/lib/geoblacklight/controller_override_spec.rb +1 -1
  55. data/spec/lib/geoblacklight/document_presenter_spec.rb +1 -1
  56. data/spec/lib/geoblacklight/download/geojson_download_spec.rb +5 -5
  57. data/spec/lib/geoblacklight/download/geotiff_download_spec.rb +5 -5
  58. data/spec/lib/geoblacklight/download/hgl_download_spec.rb +6 -6
  59. data/spec/lib/geoblacklight/download/kmz_download_spec.rb +5 -5
  60. data/spec/lib/geoblacklight/download/shapefile_download_spec.rb +5 -5
  61. data/spec/lib/geoblacklight/download_spec.rb +14 -14
  62. data/spec/lib/geoblacklight/geoblacklight_helper_behavior_spec.rb +2 -1
  63. data/spec/lib/geoblacklight/item_viewer_spec.rb +5 -5
  64. data/spec/lib/geoblacklight/metadata_spec.rb +3 -3
  65. data/spec/lib/geoblacklight/reference_spec.rb +3 -3
  66. data/spec/lib/geoblacklight/references_spec.rb +34 -34
  67. data/spec/lib/geoblacklight/search_builder_spec.rb +7 -15
  68. data/spec/lib/geoblacklight/view_helper_override_spec.rb +15 -15
  69. data/spec/lib/geoblacklight/wms_layer/feature_info_response_spec.rb +10 -10
  70. data/spec/lib/geoblacklight/wms_layer_spec.rb +7 -7
  71. data/spec/{lib → models/concerns}/geoblacklight/solr_document/carto_db_spec.rb +0 -0
  72. data/spec/{lib → models/concerns}/geoblacklight/solr_document/finder_spec.rb +2 -2
  73. data/spec/models/concerns/geoblacklight/solr_document/inspection_spec.rb +16 -0
  74. data/spec/{lib → models/concerns}/geoblacklight/solr_document_spec.rb +24 -24
  75. data/spec/spec_helper.rb +6 -7
  76. data/spec/support/features.rb +1 -1
  77. data/spec/support/features/session_helpers.rb +1 -1
  78. data/spec/teaspoon_env.rb +38 -33
  79. data/spec/test_app_templates/lib/generators/test_app_generator.rb +4 -4
  80. data/spec/views/catalog/_document_split.html.erb_spec.rb +1 -1
  81. data/spec/views/catalog/_index_split.html.erb_spec.rb +1 -1
  82. metadata +31 -33
  83. data/lib/geoblacklight/config.rb +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 106c28b41125452b5d2c19d0d0c1fbeefaa6e631
4
- data.tar.gz: 9ea22aed584240ada2cc9ccb162389e05c39cd28
3
+ metadata.gz: dfda49bfa6025f3416c022717d15dcd41c134703
4
+ data.tar.gz: 0423a836a4df4ae842fdc528ae74c22b0ecb9090
5
5
  SHA512:
6
- metadata.gz: 468e4f97b1f872c0faba11f0d9c03681801b112a63096d4241b498270e8637a4de03f33eabd8093454e94f9c6ea7ba0cf82c667d98734dd75c1f77ac1093cad5
7
- data.tar.gz: 7454480d52a43d167ec83b42bb9f072b8954f6d3c2bb5089d919e26a3194c3d2dd273844fded3edd565d5a7a2563e2809f88ec5701c6fc21d721435a867085c5
6
+ metadata.gz: a97618a0fd0ba4623f1e3d7c6cb78273c01b76da95eba0005fd471e65b87068e85ff0e23863b21571a5b3bb8c092f7ecd3ace080b5e116f5f42c9ab4f8cfd73d
7
+ data.tar.gz: 473b5f90e4a81b9e05714344b8d1d8878c43fa5de0b410316753aaca2b7bd52265fb250bf50e368aae9c818521c019f1bdea3a7ca93fe0c6786db3a7582514f8
data/.gitignore CHANGED
@@ -15,5 +15,5 @@ spec/reports
15
15
  test/tmp
16
16
  test/version_tmp
17
17
  tmp
18
- spec/internal
19
18
  jetty
19
+ .internal_test_app
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
- # load local rails test instance Gemfile
19
- file = File.expand_path("Gemfile", ENV['ENGINE_CART_DESTINATION'] || ENV['RAILS_ROOT'] || File.expand_path("../spec/internal", __FILE__))
20
- if File.exists?(file)
21
- puts "Loading #{file} ..." if $DEBUG # `ruby -d` or `bundle -v`
22
- instance_eval File.read(file)
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
- ###[Contributing](https://github.com/geoblacklight/geoblacklight/wiki/Contributing)
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
- RSpec::Core::RakeTask.new(:spec)
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 "Load fixtures"
23
- task :fixtures => ['engine_cart:generate'] do
31
+ desc 'Load fixtures'
32
+ task fixtures: ['engine_cart:generate'] do
24
33
  EngineCart.within_test_app do
25
- system "rake geoblacklight:solr:seed RAILS_ENV=test"
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("TEASPOON_RAILS_ENV='./spec/internal/config/environment' teaspoon --require=spec/internal/spec/teaspoon_env.rb")
41
+ system('teaspoon --require=.internal_test_app/spec/teaspoon_env.rb')
33
42
  end
34
43
 
35
- desc "Execute Continuous Integration build"
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'] = "test"
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["fixtures"].invoke
55
+ Rake::Task['fixtures'].invoke
47
56
 
48
57
  # run the tests
49
- Rake::Task["spec"].invoke
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: '&copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors, &copy; <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: '&copy; <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: '&copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors, &copy; <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(layerGroup) {
8
- var options = {
9
- position: 'topleft',
10
- layer: layerGroup.getLayers()[0]
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) {
@@ -2,7 +2,7 @@
2
2
  height: 440px;
3
3
  }
4
4
 
5
- [data-protocol="wms"][data-available="true"] {
5
+ [data-inspect="true"][data-available="true"] {
6
6
  cursor: crosshair;
7
7
  }
8
8
 
@@ -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
- when 'shapefile'
85
- Geoblacklight::ShapefileDownload.new(@document).get
86
- when 'kmz'
87
- Geoblacklight::KmzDownload.new(@document).get
88
- when 'geojson'
89
- Geoblacklight::GeojsonDownload.new(@document).get
90
- when 'geotiff'
91
- Geoblacklight::GeotiffDownload.new(@document).get
92
- end
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), download_file_path(response), data: { download: 'trigger', download_id: params[:id], download_type: "generated-#{params[:type]}"})
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,6 +1,6 @@
1
1
  class WmsController < ApplicationController
2
2
  def handle
3
- response = Geoblacklight::WmsLayer.new(params).get_feature_info
3
+ response = Geoblacklight::WmsLayer.new(params).feature_info
4
4
 
5
5
  respond_to do |format|
6
6
  format.json { render json: response }
@@ -1,11 +1,10 @@
1
1
  module GeoblacklightHelper
2
-
3
- def sms_helper()
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, '', :class => 'fa fa-envelope fa-fw') + ' ' + t('blacklight.tools.email')
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 (text)
21
- if (text.length > 150)
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, partial: 'facet_tag_item', layout: 'facet_tag_layout')
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, '', class: "geoblacklight-icon geoblacklight-#{name.downcase.gsub(' ', '-')}", title: name
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 { |item| link_to item, catalog_index_path(f: { "#{facet}" => [item] }) }.join(', ').html_safe
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
- return true if document_available? && @document.viewer_protocol == 'wms'
80
+ document_available? && @document.inspectable?
75
81
  end
76
82
 
77
83
  ##