geoblacklight_admin 0.0.1 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (186) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +59 -36
  3. data/Rakefile +47 -14
  4. data/app/assets/javascripts/geoblacklight_admin.js +2 -1
  5. data/app/assets/stylesheets/geoblacklight_admin/_core.scss +5 -0
  6. data/app/assets/stylesheets/geoblacklight_admin/modules/_chosen.scss +425 -0
  7. data/app/assets/stylesheets/geoblacklight_admin/modules/_forms.scss +108 -0
  8. data/app/controllers/admin/admin_controller.rb +4 -2
  9. data/app/controllers/admin/advanced_search_controller.rb +123 -103
  10. data/app/controllers/admin/api_controller.rb +123 -108
  11. data/app/controllers/admin/bookmarks_controller.rb +4 -4
  12. data/app/controllers/admin/bulk_actions_controller.rb +9 -4
  13. data/app/controllers/admin/concerns/upload_util.rb +2 -0
  14. data/app/controllers/admin/document_accesses_controller.rb +10 -4
  15. data/app/controllers/admin/document_assets_controller.rb +14 -11
  16. data/app/controllers/admin/document_downloads_controller.rb +12 -10
  17. data/app/controllers/admin/documents_controller.rb +32 -15
  18. data/app/controllers/admin/elements_controller.rb +6 -5
  19. data/app/controllers/admin/form_elements_controller.rb +4 -4
  20. data/app/controllers/admin/ids_controller.rb +107 -87
  21. data/app/controllers/admin/import_documents_controller.rb +1 -1
  22. data/app/controllers/admin/imports_controller.rb +7 -3
  23. data/app/controllers/admin/mappings_controller.rb +6 -4
  24. data/app/controllers/admin/notifications_controller.rb +1 -1
  25. data/app/controllers/admin/search_controller.rb +3 -2
  26. data/app/controllers/admin/users_controller.rb +2 -2
  27. data/app/helpers/form_input_helper.rb +4 -4
  28. data/app/helpers/geoblacklight_admin_helper.rb +1 -1
  29. data/app/indexers/document_indexer.rb +1 -1
  30. data/app/jobs/export_job.rb +9 -6
  31. data/app/jobs/export_json_bulk_job.rb +95 -0
  32. data/app/jobs/export_json_job.rb +14 -12
  33. data/app/models/admin/bookmark.rb +18 -0
  34. data/app/models/api_search_builder.rb +3 -1
  35. data/app/models/blacklight_api.rb +6 -6
  36. data/app/models/blacklight_api_facets.rb +7 -2
  37. data/app/models/blacklight_api_ids.rb +3 -4
  38. data/app/models/bulk_action.rb +1 -1
  39. data/app/models/document/bbox_validator.rb +9 -5
  40. data/app/models/document/date_range_validator.rb +13 -10
  41. data/app/models/document/geom_validator.rb +4 -2
  42. data/app/models/document.rb +15 -7
  43. data/app/models/element.rb +9 -7
  44. data/app/models/form_control.rb +2 -0
  45. data/app/models/form_element.rb +2 -0
  46. data/app/models/form_feature.rb +2 -0
  47. data/app/models/form_group.rb +2 -0
  48. data/app/models/form_header.rb +2 -0
  49. data/app/models/geoblacklight_admin/schema.rb +5 -2
  50. data/app/models/geoblacklight_admin.rb +2 -0
  51. data/app/models/import/csv_duplicates_validator.rb +2 -1
  52. data/app/models/import/csv_header_validator.rb +2 -1
  53. data/app/models/import.rb +4 -7
  54. data/app/models/user.rb +1 -1
  55. data/app/services/export_csv_service.rb +5 -1
  56. data/app/views/admin/advanced_search/facets.json.jbuilder +9 -8
  57. data/app/views/admin/advanced_search/index.json.jbuilder +8 -7
  58. data/app/views/admin/api/_field.json.jbuilder +1 -1
  59. data/app/views/admin/api/fetch.json.jbuilder +8 -7
  60. data/app/views/admin/api/index.json.jbuilder +8 -7
  61. data/app/views/admin/bookmarks/index.html.erb +2 -2
  62. data/app/views/admin/bulk_actions/index.html.erb +3 -3
  63. data/app/views/admin/bulk_actions/show.html.erb +1 -1
  64. data/app/views/admin/document_accesses/_form.html.erb +1 -1
  65. data/app/views/admin/document_accesses/destroy_all.html.erb +3 -3
  66. data/app/views/admin/document_accesses/edit.html.erb +1 -1
  67. data/app/views/admin/document_accesses/import.html.erb +2 -2
  68. data/app/views/admin/document_accesses/index.html.erb +9 -9
  69. data/app/views/admin/document_accesses/new.html.erb +1 -1
  70. data/app/views/admin/document_downloads/_form.html.erb +1 -1
  71. data/app/views/admin/document_downloads/destroy_all.html.erb +2 -2
  72. data/app/views/admin/document_downloads/edit.html.erb +2 -3
  73. data/app/views/admin/document_downloads/import.html.erb +1 -1
  74. data/app/views/admin/document_downloads/index.html.erb +9 -9
  75. data/app/views/admin/document_downloads/new.html.erb +1 -1
  76. data/app/views/admin/document_downloads/show.html.erb +2 -2
  77. data/app/views/admin/documents/_document_bookmark.html.erb +1 -1
  78. data/app/views/admin/documents/_form_nav.html.erb +3 -1
  79. data/app/views/admin/documents/_json_btaa_aardvark.jbuilder +1 -3
  80. data/app/views/admin/documents/_json_file.jbuilder +14 -0
  81. data/app/views/admin/documents/_result_selected_options.html.erb +3 -1
  82. data/app/views/admin/documents/edit.html.erb +1 -1
  83. data/app/views/admin/documents/features/_multiple_download_links.html.erb +2 -2
  84. data/app/views/admin/documents/fetch.json_file.jbuilder +9 -0
  85. data/app/views/admin/documents/index.html.erb +2 -4
  86. data/app/views/admin/documents/index.json_file.jbuilder +9 -0
  87. data/app/views/admin/documents/versions.html.erb +1 -1
  88. data/app/views/admin/elements/_element.json.jbuilder +4 -1
  89. data/app/views/admin/elements/_form.html.erb +1 -1
  90. data/app/views/admin/elements/edit.html.erb +2 -2
  91. data/app/views/admin/elements/index.html.erb +4 -4
  92. data/app/views/admin/elements/index.json.jbuilder +2 -0
  93. data/app/views/admin/elements/new.html.erb +1 -1
  94. data/app/views/admin/elements/show.html.erb +6 -6
  95. data/app/views/admin/elements/show.json.jbuilder +2 -0
  96. data/app/views/admin/form_elements/_form.html.erb +1 -1
  97. data/app/views/admin/form_elements/_form_element.json.jbuilder +2 -0
  98. data/app/views/admin/form_elements/edit.html.erb +2 -2
  99. data/app/views/admin/form_elements/index.html.erb +2 -2
  100. data/app/views/admin/form_elements/index.json.jbuilder +2 -0
  101. data/app/views/admin/form_elements/new.html.erb +1 -1
  102. data/app/views/admin/form_elements/show.html.erb +2 -2
  103. data/app/views/admin/form_elements/show.json.jbuilder +2 -0
  104. data/app/views/admin/ids/fetch.json.jbuilder +8 -7
  105. data/app/views/admin/ids/index.json.jbuilder +3 -2
  106. data/app/views/admin/import_documents/show.html.haml +1 -1
  107. data/app/views/admin/imports/_import.json.jbuilder +2 -1
  108. data/app/views/admin/imports/_show_failed_tab.html.erb +2 -2
  109. data/app/views/admin/imports/_show_success_tab.html.erb +1 -1
  110. data/app/views/admin/imports/edit.html.erb +3 -3
  111. data/app/views/admin/imports/index.html.erb +3 -3
  112. data/app/views/admin/layouts/application.html.erb +4 -4
  113. data/app/views/admin/mappings/_form.html.erb +1 -1
  114. data/app/views/admin/mappings/_mapping.json.jbuilder +2 -1
  115. data/app/views/admin/mappings/edit.html.erb +2 -2
  116. data/app/views/admin/mappings/new.html.erb +1 -1
  117. data/app/views/admin/mappings/show.html.erb +2 -2
  118. data/app/views/admin/notifications/index.html.erb +3 -3
  119. data/app/views/admin/search/index.html.erb +2 -2
  120. data/app/views/admin/shared/_navbar.html.erb +11 -6
  121. data/app/views/admin/shared/_toast.html.erb +1 -1
  122. data/app/views/admin/users/index.html.erb +1 -1
  123. data/app/views/catalog/_show_gbl_admin.html.erb +3 -0
  124. data/config/locales/documents.en.yml +3 -0
  125. data/config/routes.rb +37 -33
  126. data/db/migrate/20230316183001_add_geoblacklight_admin_gem.rb +409 -0
  127. data/db/seeds.rb +7 -6
  128. data/db/seeds_elements.csv +56 -55
  129. data/db/seeds_elements.numbers +0 -0
  130. data/db/seeds_form_elements.csv +65 -64
  131. data/db/seeds_form_elements.numbers +0 -0
  132. data/lib/generators/geoblacklight_admin/config_generator.rb +61 -94
  133. data/lib/generators/geoblacklight_admin/install_generator.rb +3 -12
  134. data/lib/generators/geoblacklight_admin/jobs_generator.rb +3 -2
  135. data/lib/generators/geoblacklight_admin/models_generator.rb +0 -1
  136. data/lib/generators/geoblacklight_admin/templates/_show_sidebar.html.erb +19 -0
  137. data/lib/generators/geoblacklight_admin/templates/_user_util_links.html.erb +1 -1
  138. data/lib/generators/geoblacklight_admin/templates/config/database.yml +9 -5
  139. data/lib/generators/geoblacklight_admin/templates/config/geomg_aardvark_schema.json +12 -6
  140. data/lib/generators/geoblacklight_admin/templates/config/initializers/devise.rb +315 -0
  141. data/lib/generators/geoblacklight_admin/templates/config/initializers/geoblacklight_admin.rb +1 -2
  142. data/lib/generators/geoblacklight_admin/templates/config/initializers/kithe.rb +2 -0
  143. data/lib/generators/geoblacklight_admin/templates/config/initializers/mime_types.rb +15 -0
  144. data/lib/generators/geoblacklight_admin/templates/config/initializers/pagy.rb +152 -68
  145. data/lib/generators/geoblacklight_admin/templates/config/initializers/simple_form.rb +178 -0
  146. data/lib/generators/geoblacklight_admin/templates/config/initializers/simple_form_bootstrap.rb +365 -0
  147. data/lib/generators/geoblacklight_admin/templates/config/settings.yml +293 -0
  148. data/lib/generators/geoblacklight_admin/templates/javascript/controllers/results_controller.js +10 -0
  149. data/lib/generators/geoblacklight_admin/templates/package.json +3 -0
  150. data/lib/generators/geoblacklight_admin/templates/solr/conf/schema.xml +3 -3
  151. data/lib/generators/geoblacklight_admin/views_generator.rb +2 -3
  152. data/lib/geoblacklight_admin/engine.rb +5 -6
  153. data/lib/geoblacklight_admin/version.rb +1 -1
  154. data/lib/geoblacklight_admin.rb +1 -1
  155. data/lib/tasks/geoblacklight_admin.rake +15 -11
  156. metadata +101 -63
  157. data/.editorconfig +0 -18
  158. data/.gitignore +0 -75
  159. data/.standard.yml +0 -4
  160. data/Gemfile +0 -59
  161. data/LICENSE +0 -21
  162. data/app/assets/images/.keep +0 -0
  163. data/app/controllers/admin/concerns/.keep +0 -0
  164. data/app/models/bookmark.rb +0 -17
  165. data/app/models/concerns/.keep +0 -0
  166. data/db/migrate/20230316183001_add_geoblacklight_admin.rb +0 -399
  167. data/geoblacklight_admin.gemspec +0 -67
  168. data/lib/generators/geoblacklight_admin/example_docs_generator.rb +0 -18
  169. data/lib/generators/geoblacklight_admin/templates/.env.development.example +0 -28
  170. data/lib/generators/geoblacklight_admin/templates/.solr_wrapper.yml +0 -7
  171. data/lib/generators/geoblacklight_admin/templates/solr/snapshots/.keep +0 -0
  172. data/lib/tasks/.keep +0 -0
  173. data/spec/test_app_templates/lib/generators/test_app_generator.rb +0 -35
  174. data/template.rb +0 -16
  175. /data/{app/views/admin → lib/generators/geoblacklight_admin/templates}/devise/confirmations/new.html.erb +0 -0
  176. /data/{app/views/admin → lib/generators/geoblacklight_admin/templates}/devise/invitations/edit.html.erb +0 -0
  177. /data/{app/views/admin → lib/generators/geoblacklight_admin/templates}/devise/invitations/new.html.erb +0 -0
  178. /data/{app/views/admin → lib/generators/geoblacklight_admin/templates}/devise/mailer/invitation_instructions.html.erb +0 -0
  179. /data/{app/views/admin → lib/generators/geoblacklight_admin/templates}/devise/mailer/invitation_instructions.text.erb +0 -0
  180. /data/{app/views/admin → lib/generators/geoblacklight_admin/templates}/devise/passwords/edit.html.erb +0 -0
  181. /data/{app/views/admin → lib/generators/geoblacklight_admin/templates}/devise/passwords/new.html.erb +0 -0
  182. /data/{app/views/admin → lib/generators/geoblacklight_admin/templates}/devise/registrations/edit.html.erb +0 -0
  183. /data/{app/views/admin → lib/generators/geoblacklight_admin/templates}/devise/registrations/new.html.erb +0 -0
  184. /data/{app/views/admin → lib/generators/geoblacklight_admin/templates}/devise/sessions/new.html.erb +0 -0
  185. /data/{app/views/admin → lib/generators/geoblacklight_admin/templates}/devise/shared/_links.html.erb +0 -0
  186. /data/{app/views/admin → lib/generators/geoblacklight_admin/templates}/devise/unlocks/new.html.erb +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d9c753d49a11dda454f74746f46edbcbc094ab8ed65e5a6ea4a3addd1850efa9
4
- data.tar.gz: db199042de538a4e2d0548db3444a86ef81b78f2d88216dfbcae1d05b53f9923
3
+ metadata.gz: f18e2477b4c86505e2db4f96deecdd1cb1c7a3da7e6a5ec914d62cb03d96462f
4
+ data.tar.gz: 65686ca5de9a294a3232e87c9639b0ee4dec85e2eb6f4d858f0dd47da81b3e97
5
5
  SHA512:
6
- metadata.gz: 757f8f91ff005aeaa92a11dfa2d292b68383781cfdbd9cf9db5f54bb39aea4c25be30b81d9b493ee1383bcbb210d1239a68eab436c0d54e41078e69f14a11003
7
- data.tar.gz: 107dbebee2ed281bd0284e2fe4e0b60c25344cc38952d6b3363703c3ffe4ae492fdcc6aac1d6da6f8b9f5caa825375e42e7c2d190da9202a5e7f835f27bb8335
6
+ metadata.gz: 9a55943084756c68c07211e72de617cf1440f7128912bac6549ffcc95ac51733d2e3d21c165fb8f24acd6dda315c9a316056bda088e5eae65081552c9e6ce302
7
+ data.tar.gz: '090b8cdcac146e2fc720004f923dc73e4cedb3a00c75ea13d90f1ec0c3786b57be9ae65a9d29858e09dea66eb43bfcfbf68b3e0288c5414ff3b0b04bbe41cc92'
data/README.md CHANGED
@@ -1,13 +1,14 @@
1
1
  # geoblacklight_admin
2
2
 
3
- GeoBlacklight Admin is a [GeoBlacklight](https://github.com/geoblacklight/geoblacklight) plugin, built on [Kithe](https://github.com/sciencehistory/kithe), that provides a complex web-form for editing documents and an CSV-based import/export workflow for OpenGeoMetadata's [Aardvark schema](https://opengeometadata.org/ogm-aardvark/). It's a Rubygem port of the Big Ten Academic Alliance's production workflow tool [GEOMG](https://github.com/geobtaa/geomg).
3
+ ![CI](https://github.com/geobtaa/geoblacklight_admin/actions/workflows/ci.yml/badge.svg)
4
4
 
5
- ## Warning: Pre-Alpha
5
+ GeoBlacklight Admin is a [GeoBlacklight](https://github.com/geoblacklight/geoblacklight) plugin, built on [Kithe](https://github.com/sciencehistory/kithe), that provides a complex web-form for editing documents and an CSV-based import/export workflow for OpenGeoMetadata's [Aardvark schema](https://opengeometadata.org/ogm-aardvark/). GBL Admin is based on the Big Ten Academic Alliance's production workflow tool [GEOMG](https://github.com/geobtaa/geomg).
6
6
 
7
- > :warning: This gem is not ready for public adoption yet, but hopefully someday soon (Late Summer 2023?). Feel free to kick the tires if you are curious and know GeoBlacklight's codebase/stack well.
7
+ [![GeoBlackliht Admin](https://raw.githubusercontent.com/geobtaa/geoblacklight_admin/develop/docs/gbl_admin_screenshot.png)](https://youtu.be/lWjcr-Ow228 "GeoBlacklight Admin")
8
8
 
9
9
  ## Requirements
10
10
 
11
+ * Rails v6.1 (not v7 yet)
11
12
  * Blacklight v7 (not v8)
12
13
  * GeoBlacklight v4 (not v3)
13
14
  * Solr v8.4+
@@ -15,38 +16,26 @@ GeoBlacklight Admin is a [GeoBlacklight](https://github.com/geoblacklight/geobla
15
16
  * Redis (for Sidekiq)
16
17
  * OpenGeoMetadata's Aardvark Schema
17
18
 
18
- ## Install Notes
19
+ ## Installation
19
20
 
20
- ### Terminal 1 - Drop/Create application PG database
21
- ```bash
22
- psql postgres
23
- DROP DATABASE geoblacklight_development;
24
- CREATE DATABASE geoblacklight_development;
25
- ```
21
+ ### PostgreSQL
26
22
 
27
- ### Terminal 2 - Bundle and run generator
28
- ```bash
29
- bundle install
30
- bundle exec rake engine_cart:generate
31
- ```
23
+ You need a PostgreSQL database to use this project.
32
24
 
33
- When the .internal_test_app is built, edit `geoblacklight_admin_helper.rb`, and uncomment this Pagy include. Why including Pagy here breaks the entire generator build is beyond me...
25
+ * Homebrew: https://wiki.postgresql.org/wiki/Homebrew
26
+ * Docker: https://www.docker.com/blog/how-to-use-the-postgres-docker-official-image/
34
27
 
35
- ```bash
36
- # @TODO:
37
- # Cannot generate app if uncommented...
38
- # Uncomment after app is generated to fix view errors
39
- # include ::Pagy::Frontend
40
- ```
28
+ ### Install Template
29
+
30
+ Use Ruby v3.2 and Rails v6.1.7.4 to bootstrap a new GeoBlacklight + GBL Admin application using the template script:
41
31
 
42
- ### Terminal 2 - Seed and spin up server
43
32
  ```bash
44
- cd .internal_test_app
45
- bundle exec rake db:seed
33
+ rails _6.1.7.4_ new gbl_admin -m https://raw.githubusercontent.com/geobtaa/geoblacklight_admin/develop/template.rb
34
+ cd gbl_admin
46
35
  bundle exec rake gbl_admin:server
47
36
  ```
48
37
 
49
- You're now done generating the test app and populating the Elements / FormElements tables with the basic Aardvark controls.
38
+ You have now generated the .internal_test_app and populated the Elements / FormElements tables for OMG Aardvark support.
50
39
 
51
40
  ### View App in Browser
52
41
 
@@ -54,12 +43,48 @@ You're now done generating the test app and populating the Elements / FormElemen
54
43
  2. Click on the "Sign in" link
55
44
  3. Enter email: admin@geoblacklight.org and password: 123456
56
45
  4. Click on the "GBL Admin" link
57
- 5. Import some CSV
46
+ 5. Import some CSV (test/fixtures/files/btaa_sample_records.csv)
58
47
 
59
48
  -----
60
49
 
61
- ### TODOs - Running list of things to accomplish
50
+ ## Run Project for Local Development
51
+ Drop and recreate databases (or engine_cart:generate will fail)
52
+
53
+ ### Drop/Create application PG database
54
+ ```bash
55
+ psql postgres
56
+ DROP DATABASE geoblacklight_development;
57
+ CREATE DATABASE geoblacklight_development;
58
+ ```
59
+
60
+ ```bash
61
+ cd project root
62
+ bundle install
63
+ bundle exec rake engine_cart:regenerate
64
+ ```
65
+
66
+ ### Run Solr
67
+ ```bash
68
+ bin/rails geoblacklight:solr
69
+ ```
70
+
71
+ ### Run App
72
+ ```bash
73
+ cd .internal_test_app
74
+ bundle exec rails server
75
+ ```
62
76
 
77
+ ### Lint App
78
+ ```bash
79
+ standardrb .
80
+ ```
81
+
82
+ ### Test App
83
+ ```bash
84
+ RAILS_ENV=test bundle exec rails test
85
+ ```
86
+
87
+ ## TODOs
63
88
  * ~~SolrWrapper - Add persist option~~
64
89
  * ~~BlacklightApi returns not auth'd message (not requiring auth for now (not sensitive data))~~
65
90
  * ~~Facet links need /admin nesting~~
@@ -72,13 +97,11 @@ You're now done generating the test app and populating the Elements / FormElemen
72
97
  * ~~Add GBL Admin link to nav~~
73
98
  * ~~Routes - Get devise user~~
74
99
  * ~~No route matches [GET] "/users/sign_out"~~
75
- * Bookmarks need to be Admin::Bookmarks
100
+ * ~~Bookmarks need to be Admin::Bookmarks~~
101
+ * ~~GitHub Actions / CI integration~~
102
+ * ~~Port the GEOMG test suite~~
103
+ * ~~Project gem dependency injection redundancy...~~
104
+ * DRY up Engine routing
76
105
  * Remove legacy GEOMG / B1G everywhere...
77
106
  * Send GBLADMIN JavaScript pack to NPM like Blacklight
78
- * Port the GEOMG test suite
79
- * GitHub Actions / CI integration
80
- * Project gem dependency injection redundancy...
81
- * Likely a lot more polish to be uncovered...
82
-
83
-
84
-
107
+ * Likely some more polish to be uncovered...
data/Rakefile CHANGED
@@ -1,14 +1,17 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "rubygems"
3
4
  require "rails"
4
- begin
5
- require "bundler/setup"
6
- require "bundler/gem_tasks"
7
- rescue LoadError
8
- puts "You must `gem install bundler` and `bundle install` to run rake tasks"
9
- end
10
5
 
11
- Bundler::GemHelper.install_tasks
6
+ require "bundler/setup"
7
+
8
+ # Not using test/dummy app; using engine_cart
9
+ # APP_RAKEFILE = File.expand_path(".internal_test_app/Rakefile", __dir__) if
10
+ # load "rails/tasks/engine.rake"
11
+
12
+ load "rails/tasks/statistics.rake"
13
+
14
+ require "bundler/gem_tasks"
12
15
 
13
16
  require "solr_wrapper"
14
17
 
@@ -21,20 +24,48 @@ RuboCop::RakeTask.new(:rubocop)
21
24
  require "solr_wrapper/rake_task"
22
25
  require "engine_cart/rake_task"
23
26
  require "geoblacklight_admin/version"
27
+ require "rake/testtask"
28
+
29
+ # Searches for files ending in _test.rb in the test directory
30
+ Rake::TestTask.new do |t|
31
+ t.libs << "lib"
32
+ t.libs << "test"
33
+ t.pattern = "test/**/*_test.rb"
34
+ t.verbose = true
35
+ end
36
+
37
+ # Will use test as defaut task if rake is run by itself
38
+ task default: :test
24
39
 
25
40
  desc "Run test suite"
26
- task ci: ["engine_cart:generate"] do
27
- ENV["environment"] = "test"
28
- # run the tests
29
- Rake::Task["test"].invoke
41
+ task ci: ["geoblacklight:generate"] do
42
+ within_test_app do
43
+ system "RAILS_ENV=test bin/rails db:migrate"
44
+ system "RAILS_ENV=test rake db:seed"
45
+ system "RAILS_ENV=test rails webpacker:compile"
46
+ end
47
+
48
+ # Run RSpec tests with Coverage
49
+ Rake::Task["geoblacklight:coverage"].invoke
30
50
  end
31
51
 
32
52
  namespace :geoblacklight do
53
+ desc "Run tests with coverage"
54
+ task :coverage do
55
+ ENV["COVERAGE"] = "true"
56
+ # Rake::Task["spec"].invoke
57
+ Rake::Task["test"].invoke
58
+ end
59
+
60
+ desc "Create the test rails app"
61
+ task generate: ["engine_cart:generate"] do
62
+ # Intentionally Empty Block
63
+ end
64
+
33
65
  namespace :internal do
34
66
  task seed: ["engine_cart:generate"] do
35
67
  within_test_app do
36
- # @TODO - Seed Elements / FormElements
37
- # system "bundle exec rake gbl_admin:seed"
68
+ system "bundle exec rake db:seed"
38
69
  system "bundle exec rake geoblacklight:downloads:mkdir"
39
70
  end
40
71
  end
@@ -51,7 +82,9 @@ namespace :geoblacklight do
51
82
  end
52
83
 
53
84
  SolrWrapper.wrap(port: "8983") do |solr|
54
- solr.with_collection(name: "blacklight-core", dir: File.join(File.expand_path(".", File.dirname(__FILE__)), "solr", "conf")) do
85
+ solr.with_collection(name: "blacklight-core",
86
+ dir: File.join(File.expand_path(".", File.dirname(__FILE__)),
87
+ "solr", "conf")) do
55
88
  Rake::Task["geoblacklight:internal:seed"].invoke
56
89
 
57
90
  within_test_app do
@@ -12,7 +12,8 @@
12
12
  //
13
13
 
14
14
  //= require jquery3
15
- //= require cocoon
15
+ //= require rails-ujs
16
+ //= require @nathanvda/cocoon/cocoon.js
16
17
  //= require chosen-jquery/lib/chosen.jquery.js
17
18
 
18
19
  // VENDOR
@@ -19,6 +19,7 @@
19
19
  // Modules
20
20
  @import "modules/autocomplete";
21
21
  @import "modules/blazer";
22
+ @import "modules/chosen";
22
23
  @import "modules/code";
23
24
  @import "modules/datepicker";
24
25
  @import "modules/elements";
@@ -44,4 +45,8 @@ footer {
44
45
 
45
46
  div.container-fluid {
46
47
  margin-top: 5rem;
48
+ }
49
+
50
+ .navbar-brand.gbl-admin {
51
+ background: none;
47
52
  }
@@ -0,0 +1,425 @@
1
+ $chosen-sprite: image-url('chosen-sprite.png') !default;
2
+ $chosen-sprite-retina: image-url('chosen-sprite@2x.png') !default;
3
+
4
+ /* @group Base */
5
+ .chosen-container {
6
+ position: relative;
7
+ display: inline-block;
8
+ vertical-align: middle;
9
+ font-size: 13px;
10
+ user-select: none;
11
+ * {
12
+ box-sizing: border-box;
13
+ }
14
+ .chosen-drop {
15
+ position: absolute;
16
+ top: 100%;
17
+ z-index: 1010;
18
+ width: 100%;
19
+ border: 1px solid #aaa;
20
+ border-top: 0;
21
+ background: #fff;
22
+ box-shadow: 0 4px 5px rgba(#000,.15);
23
+ clip: rect(0,0,0,0);
24
+ clip-path: inset(100% 100%);
25
+ }
26
+ &.chosen-with-drop .chosen-drop {
27
+ clip: auto;
28
+ clip-path: none;
29
+ }
30
+ a{
31
+ cursor: pointer;
32
+ }
33
+
34
+ .search-choice, .chosen-single{
35
+ .group-name{
36
+ margin-right: 4px;
37
+ overflow: hidden;
38
+ white-space: nowrap;
39
+ text-overflow: ellipsis;
40
+ font-weight: normal;
41
+ color: #999999;
42
+ &:after {
43
+ content: ":";
44
+ padding-left: 2px;
45
+ vertical-align: top;
46
+ }
47
+ }
48
+ }
49
+ }
50
+ /* @end */
51
+
52
+ /* @group Single Chosen */
53
+ .chosen-container-single{
54
+ .chosen-single {
55
+ position: relative;
56
+ display: block;
57
+ overflow: hidden;
58
+ padding: 0 0 0 8px;
59
+ height: 25px;
60
+ border: 1px solid #aaa;
61
+ border-radius: 5px;
62
+ background-color: #fff;
63
+ background: linear-gradient(#fff 20%, #f6f6f6 50%, #eee 52%, #f4f4f4 100%);
64
+ background-clip: padding-box;
65
+ box-shadow: 0 0 3px #fff inset, 0 1px 1px rgba(#000,.1);
66
+ color: #444;
67
+ text-decoration: none;
68
+ white-space: nowrap;
69
+ line-height: 24px;
70
+ }
71
+ .chosen-default {
72
+ color: #999;
73
+ }
74
+ .chosen-single span {
75
+ display: block;
76
+ overflow: hidden;
77
+ margin-right: 26px;
78
+ text-overflow: ellipsis;
79
+ white-space: nowrap;
80
+ }
81
+ .chosen-single-with-deselect span {
82
+ margin-right: 38px;
83
+ }
84
+ .chosen-single abbr {
85
+ position: absolute;
86
+ top: 6px;
87
+ right: 26px;
88
+ display: block;
89
+ width: 12px;
90
+ height: 12px;
91
+ background: $chosen-sprite -42px 1px no-repeat;
92
+ font-size: 1px;
93
+ &:hover {
94
+ background-position: -42px -10px;
95
+ }
96
+ }
97
+ &.chosen-disabled .chosen-single abbr:hover {
98
+ background-position: -42px -10px;
99
+ }
100
+ .chosen-single div {
101
+ position: absolute;
102
+ top: 0;
103
+ right: 0;
104
+ display: block;
105
+ width: 18px;
106
+ height: 100%;
107
+ b {
108
+ display: block;
109
+ width: 100%;
110
+ height: 100%;
111
+ background: $chosen-sprite no-repeat 0px 2px;
112
+ }
113
+ }
114
+ .chosen-search {
115
+ position: relative;
116
+ z-index: 1010;
117
+ margin: 0;
118
+ padding: 3px 4px;
119
+ white-space: nowrap;
120
+
121
+ input[type="text"] {
122
+ margin: 1px 0;
123
+ padding: 4px 20px 4px 5px;
124
+ width: 100%;
125
+ height: auto;
126
+ outline: 0;
127
+ border: 1px solid #aaa;
128
+ background: $chosen-sprite no-repeat 100% -20px;
129
+ font-size: 1em;
130
+ font-family: sans-serif;
131
+ line-height: normal;
132
+ border-radius: 0;
133
+ }
134
+ }
135
+ .chosen-drop {
136
+ margin-top: -1px;
137
+ border-radius: 0 0 4px 4px;
138
+ background-clip: padding-box;
139
+ }
140
+ &.chosen-container-single-nosearch .chosen-search {
141
+ position: absolute;
142
+ clip: rect(0,0,0,0);
143
+ clip-path: inset(100% 100%);
144
+ }
145
+ }
146
+ /* @end */
147
+
148
+ /* @group Results */
149
+ .chosen-container .chosen-results {
150
+ color: #444;
151
+ position: relative;
152
+ overflow-x: hidden;
153
+ overflow-y: auto;
154
+ margin: 0 4px 4px 0;
155
+ padding: 0 0 0 4px;
156
+ max-height: 240px;
157
+ -webkit-overflow-scrolling: touch;
158
+ li {
159
+ display: none;
160
+ margin: 0;
161
+ padding: 5px 6px;
162
+ list-style: none;
163
+ line-height: 15px;
164
+ word-wrap: break-word;
165
+ -webkit-touch-callout: none;
166
+ &.active-result {
167
+ display: list-item;
168
+ cursor: pointer;
169
+ }
170
+ &.disabled-result {
171
+ display: list-item;
172
+ color: #ccc;
173
+ cursor: default;
174
+ }
175
+ &.highlighted {
176
+ background-color: #3875d7;
177
+ background-image: linear-gradient(#3875d7 20%, #2a62bc 90%);
178
+ color: #fff;
179
+ }
180
+ &.no-results {
181
+ color: #777;
182
+ display: list-item;
183
+ background: #f4f4f4;
184
+ }
185
+ &.group-result {
186
+ display: list-item;
187
+ font-weight: bold;
188
+ cursor: default;
189
+ }
190
+ &.group-option {
191
+ padding-left: 15px;
192
+ }
193
+ em {
194
+ font-style: normal;
195
+ text-decoration: underline;
196
+ }
197
+ }
198
+ }
199
+ /* @end */
200
+
201
+ /* @group Multi Chosen */
202
+ .chosen-container-multi{
203
+ .chosen-choices {
204
+ position: relative;
205
+ overflow: hidden;
206
+ margin: 0;
207
+ padding: 0 5px;
208
+ width: 100%;
209
+ height: auto;
210
+ border: 1px solid #aaa;
211
+ background-color: #fff;
212
+ background-image: linear-gradient(#eee 1%, #fff 15%);
213
+ cursor: text;
214
+ }
215
+ .chosen-choices li {
216
+ float: left;
217
+ list-style: none;
218
+ &.search-field {
219
+ margin: 0;
220
+ padding: 0;
221
+ white-space: nowrap;
222
+ input[type="text"] {
223
+ margin: 1px 0;
224
+ padding: 0;
225
+ height: 25px;
226
+ outline: 0;
227
+ border: 0 !important;
228
+ background: transparent !important;
229
+ box-shadow: none;
230
+ color: #999;
231
+ font-size: 100%;
232
+ font-family: sans-serif;
233
+ line-height: normal;
234
+ border-radius: 0;
235
+ width: 25px;
236
+ }
237
+ }
238
+ &.search-choice {
239
+ position: relative;
240
+ margin: 3px 5px 3px 0;
241
+ padding: 3px 20px 3px 5px;
242
+ border: 1px solid #aaa;
243
+ max-width: 100%;
244
+ border-radius: 3px;
245
+ background-color: #eeeeee;
246
+ background-image: linear-gradient(#f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eee 100%);
247
+ background-size: 100% 19px;
248
+ background-repeat: repeat-x;
249
+ background-clip: padding-box;
250
+ box-shadow: 0 0 2px #fff inset, 0 1px 0 rgba(#000,.05);
251
+ color: #333;
252
+ line-height: 13px;
253
+ cursor: default;
254
+ span {
255
+ word-wrap: break-word;
256
+ }
257
+ .search-choice-close {
258
+ position: absolute;
259
+ top: 4px;
260
+ right: 3px;
261
+ display: block;
262
+ width: 12px;
263
+ height: 12px;
264
+ background: $chosen-sprite -42px 1px no-repeat;
265
+ font-size: 1px;
266
+ &:hover {
267
+ background-position: -42px -10px;
268
+ }
269
+ }
270
+ }
271
+ &.search-choice-disabled {
272
+ padding-right: 5px;
273
+ border: 1px solid #ccc;
274
+ background-color: #e4e4e4;
275
+ background-image: linear-gradient(#f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eee 100%);
276
+ color: #666;
277
+ }
278
+ &.search-choice-focus {
279
+ background: #d4d4d4;
280
+ .search-choice-close {
281
+ background-position: -42px -10px;
282
+ }
283
+ }
284
+ }
285
+ .chosen-results {
286
+ margin: 0;
287
+ padding: 0;
288
+ }
289
+ .chosen-drop .result-selected {
290
+ display: list-item;
291
+ color: #ccc;
292
+ cursor: default;
293
+ }
294
+ }
295
+ /* @end */
296
+
297
+ /* @group Active */
298
+ .chosen-container-active{
299
+ .chosen-single {
300
+ border: 1px solid #5897fb;
301
+ box-shadow: 0 0 5px rgba(#000,.3);
302
+ }
303
+ &.chosen-with-drop{
304
+ .chosen-single {
305
+ border: 1px solid #aaa;
306
+ -moz-border-radius-bottomright: 0;
307
+ border-bottom-right-radius: 0;
308
+ -moz-border-radius-bottomleft: 0;
309
+ border-bottom-left-radius: 0;
310
+ background-image: linear-gradient(#eee 20%, #fff 80%);
311
+ box-shadow: 0 1px 0 #fff inset;
312
+ }
313
+ .chosen-single div {
314
+ border-left: none;
315
+ background: transparent;
316
+ b {
317
+ background-position: -18px 2px;
318
+ }
319
+ }
320
+ }
321
+ .chosen-choices {
322
+ border: 1px solid #5897fb;
323
+ box-shadow: 0 0 5px rgba(#000,.3);
324
+ li.search-field input[type="text"] {
325
+ color: #222 !important;
326
+ }
327
+ }
328
+ }
329
+ /* @end */
330
+
331
+ /* @group Disabled Support */
332
+ .chosen-disabled {
333
+ opacity: 0.5 !important;
334
+ cursor: default;
335
+ .chosen-single {
336
+ cursor: default;
337
+ }
338
+ .chosen-choices .search-choice .search-choice-close {
339
+ cursor: default;
340
+ }
341
+ }
342
+ /* @end */
343
+
344
+ /* @group Right to Left */
345
+ .chosen-rtl {
346
+ text-align: right;
347
+ .chosen-single {
348
+ overflow: visible;
349
+ padding: 0 8px 0 0;
350
+ }
351
+ .chosen-single span {
352
+ margin-right: 0;
353
+ margin-left: 26px;
354
+ direction: rtl;
355
+ }
356
+ .chosen-single-with-deselect span {
357
+ margin-left: 38px;
358
+ }
359
+ .chosen-single div {
360
+ right: auto;
361
+ left: 3px;
362
+ }
363
+ .chosen-single abbr {
364
+ right: auto;
365
+ left: 26px;
366
+ }
367
+ .chosen-choices li {
368
+ float: right;
369
+ &.search-field input[type="text"] {
370
+ direction: rtl;
371
+ }
372
+ &.search-choice {
373
+ margin: 3px 5px 3px 0;
374
+ padding: 3px 5px 3px 19px;
375
+ .search-choice-close {
376
+ right: auto;
377
+ left: 4px;
378
+ }
379
+ }
380
+ }
381
+ &.chosen-container-single .chosen-results {
382
+ margin: 0 0 4px 4px;
383
+ padding: 0 4px 0 0;
384
+ }
385
+ .chosen-results li.group-option {
386
+ padding-right: 15px;
387
+ padding-left: 0;
388
+ }
389
+ &.chosen-container-active.chosen-with-drop .chosen-single div {
390
+ border-right: none;
391
+ }
392
+ .chosen-search input[type="text"] {
393
+ padding: 4px 5px 4px 20px;
394
+ background: $chosen-sprite no-repeat -30px -20px;
395
+ direction: rtl;
396
+ }
397
+ &.chosen-container-single{
398
+ .chosen-single div b {
399
+ background-position: 6px 2px;
400
+ }
401
+ &.chosen-with-drop{
402
+ .chosen-single div b {
403
+ background-position: -12px 2px;
404
+ }
405
+ }
406
+ }
407
+ }
408
+
409
+ /* @end */
410
+
411
+ /* @group Retina compatibility */
412
+ @media only screen and (-webkit-min-device-pixel-ratio: 1.5), only screen and (min-resolution: 144dpi), only screen and (min-resolution: 1.5dppx) {
413
+ .chosen-rtl .chosen-search input[type="text"],
414
+ .chosen-container-single .chosen-single abbr,
415
+ .chosen-container-single .chosen-single div b,
416
+ .chosen-container-single .chosen-search input[type="text"],
417
+ .chosen-container-multi .chosen-choices .search-choice .search-choice-close,
418
+ .chosen-container .chosen-results-scroll-down span,
419
+ .chosen-container .chosen-results-scroll-up span {
420
+ background-image: $chosen-sprite-retina !important;
421
+ background-size: 52px 37px !important;
422
+ background-repeat: no-repeat !important;
423
+ }
424
+ }
425
+ /* @end */