geoblacklight_admin 0.0.1 → 0.1.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/README.md +27 -3
- data/Rakefile +30 -12
- data/app/assets/javascripts/geoblacklight_admin.js +1 -0
- data/app/assets/stylesheets/geoblacklight_admin/_core.scss +5 -0
- data/app/assets/stylesheets/geoblacklight_admin/modules/_chosen.scss +425 -0
- data/app/controllers/admin/admin_controller.rb +4 -2
- data/app/controllers/admin/advanced_search_controller.rb +123 -103
- data/app/controllers/admin/api_controller.rb +123 -108
- data/app/controllers/admin/bookmarks_controller.rb +4 -4
- data/app/controllers/admin/bulk_actions_controller.rb +9 -4
- data/app/controllers/admin/concerns/upload_util.rb +2 -0
- data/app/controllers/admin/document_accesses_controller.rb +10 -4
- data/app/controllers/admin/document_assets_controller.rb +14 -11
- data/app/controllers/admin/document_downloads_controller.rb +12 -10
- data/app/controllers/admin/documents_controller.rb +16 -8
- data/app/controllers/admin/elements_controller.rb +6 -5
- data/app/controllers/admin/form_elements_controller.rb +4 -4
- data/app/controllers/admin/ids_controller.rb +107 -87
- data/app/controllers/admin/import_documents_controller.rb +1 -1
- data/app/controllers/admin/imports_controller.rb +7 -3
- data/app/controllers/admin/mappings_controller.rb +6 -4
- data/app/controllers/admin/notifications_controller.rb +1 -1
- data/app/controllers/admin/search_controller.rb +1 -1
- data/app/controllers/admin/users_controller.rb +1 -1
- data/app/helpers/form_input_helper.rb +4 -4
- data/app/helpers/geoblacklight_admin_helper.rb +1 -1
- data/app/jobs/export_job.rb +2 -1
- data/app/models/admin/bookmark.rb +18 -0
- data/app/models/api_search_builder.rb +3 -1
- data/app/models/document/bbox_validator.rb +9 -5
- data/app/models/document/date_range_validator.rb +13 -10
- data/app/models/document/geom_validator.rb +4 -2
- data/app/models/document.rb +15 -7
- data/app/models/element.rb +9 -7
- data/app/models/form_control.rb +2 -0
- data/app/models/form_element.rb +2 -0
- data/app/models/form_feature.rb +2 -0
- data/app/models/form_group.rb +2 -0
- data/app/models/form_header.rb +2 -0
- data/app/models/geoblacklight_admin/schema.rb +5 -2
- data/app/models/geoblacklight_admin.rb +2 -0
- data/app/models/import/csv_duplicates_validator.rb +2 -1
- data/app/models/import/csv_header_validator.rb +2 -1
- data/app/models/import.rb +4 -7
- data/app/models/user.rb +1 -1
- data/app/services/export_csv_service.rb +5 -1
- data/app/views/admin/advanced_search/facets.json.jbuilder +9 -8
- data/app/views/admin/advanced_search/index.json.jbuilder +8 -7
- data/app/views/admin/api/_field.json.jbuilder +1 -1
- data/app/views/admin/api/fetch.json.jbuilder +8 -7
- data/app/views/admin/api/index.json.jbuilder +8 -7
- data/app/views/admin/bookmarks/index.html.erb +2 -2
- data/app/views/admin/bulk_actions/index.html.erb +3 -3
- data/app/views/admin/bulk_actions/show.html.erb +1 -1
- data/app/views/admin/document_accesses/_form.html.erb +1 -1
- data/app/views/admin/document_accesses/destroy_all.html.erb +2 -2
- data/app/views/admin/document_accesses/edit.html.erb +1 -1
- data/app/views/admin/document_accesses/import.html.erb +2 -2
- data/app/views/admin/document_accesses/index.html.erb +9 -9
- data/app/views/admin/document_accesses/new.html.erb +1 -1
- data/app/views/admin/document_downloads/_form.html.erb +1 -1
- data/app/views/admin/document_downloads/destroy_all.html.erb +1 -1
- data/app/views/admin/document_downloads/edit.html.erb +2 -3
- data/app/views/admin/document_downloads/import.html.erb +1 -1
- data/app/views/admin/document_downloads/index.html.erb +9 -9
- data/app/views/admin/document_downloads/new.html.erb +1 -1
- data/app/views/admin/document_downloads/show.html.erb +2 -2
- data/app/views/admin/documents/_document_bookmark.html.erb +1 -1
- data/app/views/admin/documents/_form_nav.html.erb +1 -1
- data/app/views/admin/documents/_json_btaa_aardvark.jbuilder +1 -3
- data/app/views/admin/documents/edit.html.erb +1 -1
- data/app/views/admin/documents/features/_multiple_download_links.html.erb +2 -2
- data/app/views/admin/documents/index.html.erb +2 -4
- data/app/views/admin/documents/versions.html.erb +1 -1
- data/app/views/admin/elements/_element.json.jbuilder +4 -1
- data/app/views/admin/elements/_form.html.erb +1 -1
- data/app/views/admin/elements/edit.html.erb +2 -2
- data/app/views/admin/elements/index.html.erb +3 -3
- data/app/views/admin/elements/index.json.jbuilder +2 -0
- data/app/views/admin/elements/new.html.erb +1 -1
- data/app/views/admin/elements/show.html.erb +6 -6
- data/app/views/admin/elements/show.json.jbuilder +2 -0
- data/app/views/admin/form_elements/_form.html.erb +1 -1
- data/app/views/admin/form_elements/_form_element.json.jbuilder +2 -0
- data/app/views/admin/form_elements/edit.html.erb +2 -2
- data/app/views/admin/form_elements/index.html.erb +1 -1
- data/app/views/admin/form_elements/index.json.jbuilder +2 -0
- data/app/views/admin/form_elements/new.html.erb +1 -1
- data/app/views/admin/form_elements/show.html.erb +2 -2
- data/app/views/admin/form_elements/show.json.jbuilder +2 -0
- data/app/views/admin/ids/fetch.json.jbuilder +8 -7
- data/app/views/admin/ids/index.json.jbuilder +3 -2
- data/app/views/admin/import_documents/show.html.haml +1 -1
- data/app/views/admin/imports/_import.json.jbuilder +2 -1
- data/app/views/admin/imports/_show_failed_tab.html.erb +2 -2
- data/app/views/admin/imports/_show_success_tab.html.erb +1 -1
- data/app/views/admin/imports/edit.html.erb +3 -3
- data/app/views/admin/imports/index.html.erb +3 -3
- data/app/views/admin/layouts/application.html.erb +4 -4
- data/app/views/admin/mappings/_form.html.erb +1 -1
- data/app/views/admin/mappings/_mapping.json.jbuilder +2 -1
- data/app/views/admin/mappings/edit.html.erb +2 -2
- data/app/views/admin/mappings/new.html.erb +1 -1
- data/app/views/admin/mappings/show.html.erb +2 -2
- data/app/views/admin/notifications/index.html.erb +3 -3
- data/app/views/admin/search/index.html.erb +2 -2
- data/app/views/admin/shared/_navbar.html.erb +8 -3
- data/app/views/catalog/_show_gbl_admin.html.erb +3 -0
- data/config/routes.rb +37 -33
- data/db/migrate/20230316183001_add_geoblacklight_admin_gem.rb +408 -0
- data/db/seeds.rb +7 -5
- data/lib/generators/geoblacklight_admin/config_generator.rb +43 -31
- data/lib/generators/geoblacklight_admin/install_generator.rb +2 -3
- data/lib/generators/geoblacklight_admin/jobs_generator.rb +3 -2
- data/lib/generators/geoblacklight_admin/models_generator.rb +0 -1
- data/lib/generators/geoblacklight_admin/templates/_show_sidebar.html.erb +19 -0
- data/lib/generators/geoblacklight_admin/templates/_user_util_links.html.erb +1 -1
- data/lib/generators/geoblacklight_admin/templates/config/database.yml +9 -5
- data/lib/generators/geoblacklight_admin/templates/config/initializers/geoblacklight_admin.rb +1 -2
- data/lib/generators/geoblacklight_admin/templates/config/initializers/pagy.rb +150 -68
- data/lib/generators/geoblacklight_admin/templates/config/settings.yml +241 -0
- data/lib/generators/geoblacklight_admin/templates/package.json +1 -0
- data/lib/generators/geoblacklight_admin/views_generator.rb +0 -1
- data/lib/geoblacklight_admin/engine.rb +5 -6
- data/lib/geoblacklight_admin/version.rb +1 -1
- data/lib/geoblacklight_admin.rb +1 -1
- data/lib/tasks/geoblacklight_admin.rake +10 -6
- metadata +79 -48
- data/.editorconfig +0 -18
- data/.gitignore +0 -75
- data/.standard.yml +0 -4
- data/Gemfile +0 -59
- data/LICENSE +0 -21
- data/app/assets/images/.keep +0 -0
- data/app/controllers/admin/concerns/.keep +0 -0
- data/app/models/bookmark.rb +0 -17
- data/app/models/concerns/.keep +0 -0
- data/db/migrate/20230316183001_add_geoblacklight_admin.rb +0 -399
- data/geoblacklight_admin.gemspec +0 -67
- data/lib/generators/geoblacklight_admin/templates/.env.development.example +0 -28
- data/lib/generators/geoblacklight_admin/templates/.solr_wrapper.yml +0 -7
- data/lib/generators/geoblacklight_admin/templates/solr/snapshots/.keep +0 -0
- data/lib/tasks/.keep +0 -0
- data/spec/test_app_templates/lib/generators/test_app_generator.rb +0 -35
- data/template.rb +0 -16
|
@@ -1,129 +1,208 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
# Pagy initializer file (
|
|
4
|
-
# Customize only what you really need and notice that Pagy works also without any of the following lines.
|
|
3
|
+
# Pagy initializer file (6.0.4)
|
|
4
|
+
# Customize only what you really need and notice that the core Pagy works also without any of the following lines.
|
|
5
5
|
# Should you just cherry pick part of this file, please maintain the require-order of the extras
|
|
6
6
|
|
|
7
|
+
# Pagy DEFAULT Variables
|
|
8
|
+
# See https://ddnexus.github.io/pagy/docs/api/pagy#variables
|
|
9
|
+
# All the Pagy::DEFAULT are set for all the Pagy instances but can be overridden per instance by just passing them to
|
|
10
|
+
# Pagy.new|Pagy::Countless.new|Pagy::Calendar::*.new or any of the #pagy* controller methods
|
|
11
|
+
|
|
12
|
+
# Instance variables
|
|
13
|
+
# See https://ddnexus.github.io/pagy/docs/api/pagy#instance-variables
|
|
14
|
+
# Pagy::DEFAULT[:page] = 1 # default
|
|
15
|
+
# Pagy::DEFAULT[:items] = 20 # default
|
|
16
|
+
# Pagy::DEFAULT[:outset] = 0 # default
|
|
17
|
+
|
|
18
|
+
# Other Variables
|
|
19
|
+
# See https://ddnexus.github.io/pagy/docs/api/pagy#other-variables
|
|
20
|
+
# Pagy::DEFAULT[:size] = [1,4,4,1] # default
|
|
21
|
+
# Pagy::DEFAULT[:page_param] = :page # default
|
|
22
|
+
# The :params can be also set as a lambda e.g ->(params){ params.exclude('useless').merge!('custom' => 'useful') }
|
|
23
|
+
# Pagy::DEFAULT[:params] = {} # default
|
|
24
|
+
# Pagy::DEFAULT[:fragment] = '#fragment' # example
|
|
25
|
+
# Pagy::DEFAULT[:link_extra] = 'data-remote="true"' # example
|
|
26
|
+
# Pagy::DEFAULT[:i18n_key] = 'pagy.item_name' # default
|
|
27
|
+
# Pagy::DEFAULT[:cycle] = true # example
|
|
28
|
+
# Pagy::DEFAULT[:request_path] = "/foo" # example
|
|
29
|
+
|
|
7
30
|
# Extras
|
|
8
|
-
# See https://ddnexus.github.io/pagy/
|
|
31
|
+
# See https://ddnexus.github.io/pagy/categories/extra
|
|
9
32
|
|
|
10
33
|
# Backend Extras
|
|
11
34
|
|
|
35
|
+
# Arel extra: For better performance utilizing grouped ActiveRecord collections:
|
|
36
|
+
# See: https://ddnexus.github.io/pagy/docs/extras/arel
|
|
37
|
+
# require 'pagy/extras/arel'
|
|
38
|
+
|
|
12
39
|
# Array extra: Paginate arrays efficiently, avoiding expensive array-wrapping and without overriding
|
|
13
|
-
# See https://ddnexus.github.io/pagy/extras/array
|
|
40
|
+
# See https://ddnexus.github.io/pagy/docs/extras/array
|
|
14
41
|
# require 'pagy/extras/array'
|
|
15
42
|
|
|
43
|
+
# Calendar extra: Add pagination filtering by calendar time unit (year, quarter, month, week, day)
|
|
44
|
+
# See https://ddnexus.github.io/pagy/docs/extras/calendar
|
|
45
|
+
# require 'pagy/extras/calendar'
|
|
46
|
+
# Default for each unit
|
|
47
|
+
# Pagy::Calendar::Year::DEFAULT[:order] = :asc # Time direction of pagination
|
|
48
|
+
# Pagy::Calendar::Year::DEFAULT[:format] = '%Y' # strftime format
|
|
49
|
+
#
|
|
50
|
+
# Pagy::Calendar::Quarter::DEFAULT[:order] = :asc # Time direction of pagination
|
|
51
|
+
# Pagy::Calendar::Quarter::DEFAULT[:format] = '%Y-Q%q' # strftime format
|
|
52
|
+
#
|
|
53
|
+
# Pagy::Calendar::Month::DEFAULT[:order] = :asc # Time direction of pagination
|
|
54
|
+
# Pagy::Calendar::Month::DEFAULT[:format] = '%Y-%m' # strftime format
|
|
55
|
+
#
|
|
56
|
+
# Pagy::Calendar::Week::DEFAULT[:order] = :asc # Time direction of pagination
|
|
57
|
+
# Pagy::Calendar::Week::DEFAULT[:format] = '%Y-%W' # strftime format
|
|
58
|
+
#
|
|
59
|
+
# Pagy::Calendar::Day::DEFAULT[:order] = :asc # Time direction of pagination
|
|
60
|
+
# Pagy::Calendar::Day::DEFAULT[:format] = '%Y-%m-%d' # strftime format
|
|
61
|
+
#
|
|
62
|
+
# Uncomment the following lines, if you need calendar localization without using the I18n extra
|
|
63
|
+
# module LocalizePagyCalendar
|
|
64
|
+
# def localize(time, opts)
|
|
65
|
+
# ::I18n.l(time, **opts)
|
|
66
|
+
# end
|
|
67
|
+
# end
|
|
68
|
+
# Pagy::Calendar.prepend LocalizePagyCalendar
|
|
69
|
+
|
|
16
70
|
# Countless extra: Paginate without any count, saving one query per rendering
|
|
17
|
-
# See https://ddnexus.github.io/pagy/extras/countless
|
|
71
|
+
# See https://ddnexus.github.io/pagy/docs/extras/countless
|
|
18
72
|
# require 'pagy/extras/countless'
|
|
19
|
-
# Pagy::
|
|
73
|
+
# Pagy::DEFAULT[:countless_minimal] = false # default (eager loading)
|
|
20
74
|
|
|
21
75
|
# Elasticsearch Rails extra: Paginate `ElasticsearchRails::Results` objects
|
|
22
|
-
# See https://ddnexus.github.io/pagy/extras/elasticsearch_rails
|
|
76
|
+
# See https://ddnexus.github.io/pagy/docs/extras/elasticsearch_rails
|
|
77
|
+
# Default :pagy_search method: change only if you use also
|
|
78
|
+
# the searchkick or meilisearch extra that defines the same
|
|
79
|
+
# Pagy::DEFAULT[:elasticsearch_rails_pagy_search] = :pagy_search
|
|
80
|
+
# Default original :search method called internally to do the actual search
|
|
81
|
+
# Pagy::DEFAULT[:elasticsearch_rails_search] = :search
|
|
23
82
|
# require 'pagy/extras/elasticsearch_rails'
|
|
24
83
|
|
|
84
|
+
# Headers extra: http response headers (and other helpers) useful for API pagination
|
|
85
|
+
# See http://ddnexus.github.io/pagy/extras/headers
|
|
86
|
+
# require 'pagy/extras/headers'
|
|
87
|
+
# Pagy::DEFAULT[:headers] = { page: 'Current-Page',
|
|
88
|
+
# items: 'Page-Items',
|
|
89
|
+
# count: 'Total-Count',
|
|
90
|
+
# pages: 'Total-Pages' } # default
|
|
91
|
+
|
|
92
|
+
# Meilisearch extra: Paginate `Meilisearch` result objects
|
|
93
|
+
# See https://ddnexus.github.io/pagy/docs/extras/meilisearch
|
|
94
|
+
# Default :pagy_search method: change only if you use also
|
|
95
|
+
# the elasticsearch_rails or searchkick extra that define the same method
|
|
96
|
+
# Pagy::DEFAULT[:meilisearch_pagy_search] = :pagy_search
|
|
97
|
+
# Default original :search method called internally to do the actual search
|
|
98
|
+
# Pagy::DEFAULT[:meilisearch_search] = :ms_search
|
|
99
|
+
# require 'pagy/extras/meilisearch'
|
|
100
|
+
|
|
101
|
+
# Metadata extra: Provides the pagination metadata to Javascript frameworks like Vue.js, react.js, etc.
|
|
102
|
+
# See https://ddnexus.github.io/pagy/docs/extras/metadata
|
|
103
|
+
# you must require the frontend helpers internal extra (BEFORE the metadata extra) ONLY if you need also the :sequels
|
|
104
|
+
# require 'pagy/extras/frontend_helpers'
|
|
105
|
+
# require 'pagy/extras/metadata'
|
|
106
|
+
# For performance reasons, you should explicitly set ONLY the metadata you use in the frontend
|
|
107
|
+
# Pagy::DEFAULT[:metadata] = %i[scaffold_url page prev next last] # example
|
|
108
|
+
|
|
25
109
|
# Searchkick extra: Paginate `Searchkick::Results` objects
|
|
26
|
-
# See https://ddnexus.github.io/pagy/extras/searchkick
|
|
110
|
+
# See https://ddnexus.github.io/pagy/docs/extras/searchkick
|
|
111
|
+
# Default :pagy_search method: change only if you use also
|
|
112
|
+
# the elasticsearch_rails or meilisearch extra that defines the same
|
|
113
|
+
# DEFAULT[:searchkick_pagy_search] = :pagy_search
|
|
114
|
+
# Default original :search method called internally to do the actual search
|
|
115
|
+
# Pagy::DEFAULT[:searchkick_search] = :search
|
|
27
116
|
# require 'pagy/extras/searchkick'
|
|
117
|
+
# uncomment if you are going to use Searchkick.pagy_search
|
|
118
|
+
# Searchkick.extend Pagy::Searchkick
|
|
28
119
|
|
|
29
120
|
# Frontend Extras
|
|
30
121
|
|
|
31
122
|
# Bootstrap extra: Add nav, nav_js and combo_nav_js helpers and templates for Bootstrap pagination
|
|
32
|
-
# See https://ddnexus.github.io/pagy/extras/bootstrap
|
|
123
|
+
# See https://ddnexus.github.io/pagy/docs/extras/bootstrap
|
|
33
124
|
require "pagy/extras/bootstrap"
|
|
34
125
|
|
|
35
126
|
# Bulma extra: Add nav, nav_js and combo_nav_js helpers and templates for Bulma pagination
|
|
36
|
-
# See https://ddnexus.github.io/pagy/extras/bulma
|
|
127
|
+
# See https://ddnexus.github.io/pagy/docs/extras/bulma
|
|
37
128
|
# require 'pagy/extras/bulma'
|
|
38
129
|
|
|
39
130
|
# Foundation extra: Add nav, nav_js and combo_nav_js helpers and templates for Foundation pagination
|
|
40
|
-
# See https://ddnexus.github.io/pagy/extras/foundation
|
|
131
|
+
# See https://ddnexus.github.io/pagy/docs/extras/foundation
|
|
41
132
|
# require 'pagy/extras/foundation'
|
|
42
133
|
|
|
43
134
|
# Materialize extra: Add nav, nav_js and combo_nav_js helpers for Materialize pagination
|
|
44
|
-
# See https://ddnexus.github.io/pagy/extras/materialize
|
|
135
|
+
# See https://ddnexus.github.io/pagy/docs/extras/materialize
|
|
45
136
|
# require 'pagy/extras/materialize'
|
|
46
137
|
|
|
47
138
|
# Navs extra: Add nav_js and combo_nav_js javascript helpers
|
|
48
139
|
# Notice: the other frontend extras add their own framework-styled versions,
|
|
49
140
|
# so require this extra only if you need the unstyled version
|
|
50
|
-
# See https://ddnexus.github.io/pagy/extras/navs
|
|
141
|
+
# See https://ddnexus.github.io/pagy/docs/extras/navs
|
|
51
142
|
# require 'pagy/extras/navs'
|
|
52
143
|
|
|
53
144
|
# Semantic extra: Add nav, nav_js and combo_nav_js helpers for Semantic UI pagination
|
|
54
|
-
# See https://ddnexus.github.io/pagy/extras/semantic
|
|
145
|
+
# See https://ddnexus.github.io/pagy/docs/extras/semantic
|
|
55
146
|
# require 'pagy/extras/semantic'
|
|
56
147
|
|
|
57
148
|
# UIkit extra: Add nav helper and templates for UIkit pagination
|
|
58
|
-
# See https://ddnexus.github.io/pagy/extras/uikit
|
|
149
|
+
# See https://ddnexus.github.io/pagy/docs/extras/uikit
|
|
59
150
|
# require 'pagy/extras/uikit'
|
|
60
151
|
|
|
61
152
|
# Multi size var used by the *_nav_js helpers
|
|
62
|
-
# See https://ddnexus.github.io/pagy/extras/navs#steps
|
|
63
|
-
# Pagy::
|
|
153
|
+
# See https://ddnexus.github.io/pagy/docs/extras/navs#steps
|
|
154
|
+
# Pagy::DEFAULT[:steps] = { 0 => [2,3,3,2], 540 => [3,5,5,3], 720 => [5,7,7,5] } # example
|
|
64
155
|
|
|
65
156
|
# Feature Extras
|
|
66
157
|
|
|
67
|
-
#
|
|
68
|
-
# See
|
|
69
|
-
# require 'pagy/extras/
|
|
70
|
-
#
|
|
71
|
-
|
|
72
|
-
#
|
|
73
|
-
# See https://ddnexus.github.io/pagy/extras/support
|
|
74
|
-
# require 'pagy/extras/support'
|
|
158
|
+
# Gearbox extra: Automatically change the number of items per page depending on the page number
|
|
159
|
+
# See https://ddnexus.github.io/pagy/docs/extras/gearbox
|
|
160
|
+
# require 'pagy/extras/gearbox'
|
|
161
|
+
# set to false only if you want to make :gearbox_extra an opt-in variable
|
|
162
|
+
# Pagy::DEFAULT[:gearbox_extra] = false # default true
|
|
163
|
+
# Pagy::DEFAULT[:gearbox_items] = [15, 30, 60, 100] # default
|
|
75
164
|
|
|
76
165
|
# Items extra: Allow the client to request a custom number of items per page with an optional selector UI
|
|
77
|
-
# See https://ddnexus.github.io/pagy/extras/items
|
|
166
|
+
# See https://ddnexus.github.io/pagy/docs/extras/items
|
|
78
167
|
# require 'pagy/extras/items'
|
|
79
|
-
#
|
|
80
|
-
# Pagy::
|
|
168
|
+
# set to false only if you want to make :items_extra an opt-in variable
|
|
169
|
+
# Pagy::DEFAULT[:items_extra] = false # default true
|
|
170
|
+
# Pagy::DEFAULT[:items_param] = :items # default
|
|
171
|
+
# Pagy::DEFAULT[:max_items] = 100 # default
|
|
81
172
|
|
|
82
173
|
# Overflow extra: Allow for easy handling of overflowing pages
|
|
83
|
-
# See https://ddnexus.github.io/pagy/extras/overflow
|
|
174
|
+
# See https://ddnexus.github.io/pagy/docs/extras/overflow
|
|
84
175
|
# require 'pagy/extras/overflow'
|
|
85
|
-
# Pagy::
|
|
176
|
+
# Pagy::DEFAULT[:overflow] = :empty_page # default (other options: :last_page and :exception)
|
|
86
177
|
|
|
87
|
-
#
|
|
88
|
-
# See https://ddnexus.github.io/pagy/extras/
|
|
89
|
-
#
|
|
90
|
-
# require 'pagy/extras/shared'
|
|
91
|
-
# require 'pagy/extras/metadata'
|
|
92
|
-
# For performance reason, you should explicitly set ONLY the metadata you use in the frontend
|
|
93
|
-
# Pagy::VARS[:metadata] = [:scaffold_url, :count, :page, :prev, :next, :last] # example
|
|
178
|
+
# Support extra: Extra support for features like: incremental, infinite, auto-scroll pagination
|
|
179
|
+
# See https://ddnexus.github.io/pagy/docs/extras/support
|
|
180
|
+
# require 'pagy/extras/support'
|
|
94
181
|
|
|
95
182
|
# Trim extra: Remove the page=1 param from links
|
|
96
|
-
# See https://ddnexus.github.io/pagy/extras/trim
|
|
183
|
+
# See https://ddnexus.github.io/pagy/docs/extras/trim
|
|
97
184
|
# require 'pagy/extras/trim'
|
|
185
|
+
# set to false only if you want to make :trim_extra an opt-in variable
|
|
186
|
+
# Pagy::DEFAULT[:trim_extra] = false # default true
|
|
98
187
|
|
|
99
|
-
#
|
|
100
|
-
# See https://ddnexus.github.io/pagy/
|
|
101
|
-
#
|
|
102
|
-
#
|
|
103
|
-
|
|
104
|
-
# Instance variables
|
|
105
|
-
# See https://ddnexus.github.io/pagy/api/pagy#instance-variables
|
|
106
|
-
Pagy::VARS[:items] = 10 # default
|
|
107
|
-
|
|
108
|
-
# Other Variables
|
|
109
|
-
# See https://ddnexus.github.io/pagy/api/pagy#other-variables
|
|
110
|
-
# Pagy::VARS[:size] = [1,4,4,1] # default
|
|
111
|
-
# Pagy::VARS[:page_param] = :page # default
|
|
112
|
-
# Pagy::VARS[:params] = {} # default
|
|
113
|
-
# Pagy::VARS[:anchor] = '#anchor' # example
|
|
114
|
-
# Pagy::VARS[:link_extra] = 'data-remote="true"' # example
|
|
188
|
+
# Standalone extra: Use pagy in non Rack environment/gem
|
|
189
|
+
# See https://ddnexus.github.io/pagy/docs/extras/standalone
|
|
190
|
+
# require 'pagy/extras/standalone'
|
|
191
|
+
# Pagy::DEFAULT[:url] = 'http://www.example.com/subdir' # optional default
|
|
115
192
|
|
|
116
193
|
# Rails
|
|
117
|
-
|
|
118
|
-
# Rails: extras assets path required by the helpers that use javascript
|
|
194
|
+
# Enable the .js file required by the helpers that use javascript
|
|
119
195
|
# (pagy*_nav_js, pagy*_combo_nav_js, and pagy_items_selector_js)
|
|
120
|
-
# See https://ddnexus.github.io/pagy/
|
|
196
|
+
# See https://ddnexus.github.io/pagy/docs/api/javascript
|
|
197
|
+
|
|
198
|
+
# With the asset pipeline
|
|
199
|
+
# Sprockets need to look into the pagy javascripts dir, so add it to the assets paths
|
|
121
200
|
# Rails.application.config.assets.paths << Pagy.root.join('javascripts')
|
|
122
201
|
|
|
123
202
|
# I18n
|
|
124
203
|
|
|
125
204
|
# Pagy internal I18n: ~18x faster using ~10x less memory than the i18n gem
|
|
126
|
-
# See https://ddnexus.github.io/pagy/api/
|
|
205
|
+
# See https://ddnexus.github.io/pagy/docs/api/i18n
|
|
127
206
|
# Notice: No need to configure anything in this section if your app uses only "en"
|
|
128
207
|
# or if you use the i18n extra below
|
|
129
208
|
#
|
|
@@ -136,23 +215,26 @@ Pagy::VARS[:items] = 10 # default
|
|
|
136
215
|
#
|
|
137
216
|
# load the "de", "en" and "es" built-in locales:
|
|
138
217
|
# (the first passed :locale will be used also as the default_locale)
|
|
139
|
-
# Pagy::I18n.load({locale: 'de'},
|
|
140
|
-
# {locale: 'en'},
|
|
141
|
-
# {locale: 'es'})
|
|
218
|
+
# Pagy::I18n.load({ locale: 'de' },
|
|
219
|
+
# { locale: 'en' },
|
|
220
|
+
# { locale: 'es' })
|
|
142
221
|
#
|
|
143
222
|
# load the "en" built-in locale, a custom "es" locale,
|
|
144
223
|
# and a totally custom locale complete with a custom :pluralize proc:
|
|
145
224
|
# (the first passed :locale will be used also as the default_locale)
|
|
146
|
-
# Pagy::I18n.load({locale: 'en'},
|
|
147
|
-
# {locale: 'es', filepath: 'path/to/pagy-es.yml'},
|
|
148
|
-
# {locale: 'xyz', # not built-in
|
|
149
|
-
#
|
|
150
|
-
#
|
|
225
|
+
# Pagy::I18n.load({ locale: 'en' },
|
|
226
|
+
# { locale: 'es', filepath: 'path/to/pagy-es.yml' },
|
|
227
|
+
# { locale: 'xyz', # not built-in
|
|
228
|
+
# filepath: 'path/to/pagy-xyz.yml',
|
|
229
|
+
# pluralize: lambda{ |count| ... } )
|
|
151
230
|
|
|
152
231
|
# I18n extra: uses the standard i18n gem which is ~18x slower using ~10x more memory
|
|
153
232
|
# than the default pagy internal i18n (see above)
|
|
154
|
-
# See https://ddnexus.github.io/pagy/extras/i18n
|
|
233
|
+
# See https://ddnexus.github.io/pagy/docs/extras/i18n
|
|
155
234
|
# require 'pagy/extras/i18n'
|
|
156
235
|
|
|
157
236
|
# Default i18n key
|
|
158
|
-
# Pagy::
|
|
237
|
+
# Pagy::DEFAULT[:i18n_key] = 'pagy.item_name' # default
|
|
238
|
+
|
|
239
|
+
# When you are done setting your own default freeze it, so it will not get changed accidentally
|
|
240
|
+
Pagy::DEFAULT.freeze
|
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
# Configurable Logo Used for CartoDB export
|
|
2
|
+
APPLICATION_LOGO_URL: 'http://geoblacklight.org/images/geoblacklight-logo.png'
|
|
3
|
+
|
|
4
|
+
# Carto OneClick Service https://carto.com/engine/open-in-carto/
|
|
5
|
+
CARTO_ONECLICK_LINK: 'http://oneclick.carto.com/'
|
|
6
|
+
|
|
7
|
+
# ArcGIS Online Base URL
|
|
8
|
+
ARCGIS_BASE_URL: 'https://www.arcgis.com/home/webmap/viewer.html'
|
|
9
|
+
|
|
10
|
+
# Download path can be configured using this setting
|
|
11
|
+
#DOWNLOAD_PATH: "./tmp/cache/downloads"
|
|
12
|
+
|
|
13
|
+
# The bq boost value for spatial search matches within a bounding box
|
|
14
|
+
BBOX_WITHIN_BOOST: '10'
|
|
15
|
+
|
|
16
|
+
# The bf boost value for overlap ratio
|
|
17
|
+
OVERLAP_RATIO_BOOST: '2'
|
|
18
|
+
|
|
19
|
+
# Homepage Map Geometry
|
|
20
|
+
# Leave null to default to entire world
|
|
21
|
+
# Add a stringified GeoJSON object to scope initial render (example from UMass)
|
|
22
|
+
HOMEPAGE_MAP_GEOM: null
|
|
23
|
+
# HOMEPAGE_MAP_GEOM: '{"type":"Polygon","coordinates":[[[-73.58,42.93],[-73.58,41.20],[-69.90,41.20],[-69.90,42.93]]]}'
|
|
24
|
+
|
|
25
|
+
# Non-search-field GeoBlacklight application permitted params
|
|
26
|
+
GBL_PARAMS:
|
|
27
|
+
- :bbox
|
|
28
|
+
- :email
|
|
29
|
+
- :file
|
|
30
|
+
- :format
|
|
31
|
+
- :id
|
|
32
|
+
- :logo
|
|
33
|
+
- :provider
|
|
34
|
+
- :type
|
|
35
|
+
- :BBOX
|
|
36
|
+
- :HEIGHT
|
|
37
|
+
- :LAYERS
|
|
38
|
+
- :QUERY_LAYERS
|
|
39
|
+
- :URL
|
|
40
|
+
- :WIDTH
|
|
41
|
+
- :X
|
|
42
|
+
- :Y
|
|
43
|
+
|
|
44
|
+
# Solr field mappings
|
|
45
|
+
FIELDS:
|
|
46
|
+
:ACCESS_RIGHTS: 'dct_accessRights_s'
|
|
47
|
+
:ALTERNATIVE_TITLE: 'dct_alternative_sm'
|
|
48
|
+
:CENTROID: 'dcat_centroid'
|
|
49
|
+
:CREATOR: 'dct_creator_sm'
|
|
50
|
+
:DATE_ISSUED: 'dct_issued_s'
|
|
51
|
+
:DATE_RANGE: 'gbl_dateRange_drsim'
|
|
52
|
+
:DESCRIPTION: 'dct_description_sm'
|
|
53
|
+
:FORMAT: 'dct_format_s'
|
|
54
|
+
:FILE_SIZE: 'gbl_fileSize_s'
|
|
55
|
+
:GEOREFERENCED: 'gbl_georeferenced_b'
|
|
56
|
+
:ID: 'id'
|
|
57
|
+
:IDENTIFIER: 'dct_identifier_sm'
|
|
58
|
+
:INDEX_YEAR: 'gbl_indexYear_im'
|
|
59
|
+
:IS_PART_OF: 'dct_isPartOf_sm'
|
|
60
|
+
:IS_REPLACED_BY: 'dct_isReplacedBy_sm'
|
|
61
|
+
:THEME: 'dcat_theme_sm'
|
|
62
|
+
:KEYWORD: 'dcat_keyword_sm'
|
|
63
|
+
:LANGUAGE: 'dct_language_sm'
|
|
64
|
+
:LAYER_MODIFIED: 'gbl_mdModified_dt'
|
|
65
|
+
:LICENSE: 'dct_license_sm'
|
|
66
|
+
:MEMBER_OF: 'pcdm_memberOf_sm'
|
|
67
|
+
:METADATA_VERSION: 'gbl_mdVersion_s'
|
|
68
|
+
:MODIFIED: 'gbl_mdModified_dt'
|
|
69
|
+
:OVERLAP_FIELD: 'solr_bboxtype'
|
|
70
|
+
:PUBLISHER: 'dct_publisher_sm'
|
|
71
|
+
:PROVIDER: 'schema_provider_s'
|
|
72
|
+
:REFERENCES: 'dct_references_s'
|
|
73
|
+
:RELATION: 'dct_relation_sm'
|
|
74
|
+
:REPLACES: 'dct_replaces_sm'
|
|
75
|
+
:RESOURCE_CLASS: 'gbl_resourceClass_sm'
|
|
76
|
+
:RESOURCE_TYPE: 'gbl_resourceType_sm'
|
|
77
|
+
:RIGHTS: 'dct_rights_sm'
|
|
78
|
+
:RIGHTS_HOLDER: 'dct_rightsHolder_sm'
|
|
79
|
+
:SOURCE: 'dct_source_sm'
|
|
80
|
+
:SPATIAL_COVERAGE: 'dct_spatial_sm'
|
|
81
|
+
:GEOMETRY: 'locn_geometry'
|
|
82
|
+
:SUBJECT: 'dct_subject_sm'
|
|
83
|
+
:SUPPRESSED: 'gbl_suppressed_b'
|
|
84
|
+
:TEMPORAL_COVERAGE: 'dct_temporal_sm'
|
|
85
|
+
:TITLE: 'dct_title_s'
|
|
86
|
+
:VERSION: 'dct_isVersionOf_sm'
|
|
87
|
+
:WXS_IDENTIFIER: 'gbl_wxsIdentifier_s'
|
|
88
|
+
:B1G_PUBLICATION_STATE: 'b1g_publication_state_s'
|
|
89
|
+
:B1G_ACCRUAL_METHOD: 'b1g_dct_accrualMethod_s'
|
|
90
|
+
:B1G_CODE: 'b1g_code_s'
|
|
91
|
+
:B1G_CHILD_RECORD: 'b1g_child_record_b'
|
|
92
|
+
:B1G_GEOMG_ID: 'geomg_id_s'
|
|
93
|
+
|
|
94
|
+
# Institution deployed at
|
|
95
|
+
INSTITUTION: 'Stanford'
|
|
96
|
+
|
|
97
|
+
# Metadata shown in tool panel
|
|
98
|
+
METADATA_SHOWN:
|
|
99
|
+
- 'mods'
|
|
100
|
+
- 'fgdc'
|
|
101
|
+
- 'iso19139'
|
|
102
|
+
- 'html'
|
|
103
|
+
|
|
104
|
+
# (For external Download) timeout and open_timeout parameters for Faraday
|
|
105
|
+
TIMEOUT_DOWNLOAD: 16
|
|
106
|
+
|
|
107
|
+
# (For WMS inspection) timeout and open_timeout parameters for Faraday
|
|
108
|
+
TIMEOUT_WMS: 4
|
|
109
|
+
|
|
110
|
+
# Use the geometry type for the data relations icon
|
|
111
|
+
USE_GEOM_FOR_RELATIONS_ICON: false
|
|
112
|
+
|
|
113
|
+
# Web services shown in tool panel
|
|
114
|
+
WEBSERVICES_SHOWN:
|
|
115
|
+
- 'wms'
|
|
116
|
+
- 'tms'
|
|
117
|
+
- 'wfs'
|
|
118
|
+
- 'xyz'
|
|
119
|
+
- 'wmts'
|
|
120
|
+
- 'tilejson'
|
|
121
|
+
- 'iiif'
|
|
122
|
+
- 'feature_layer'
|
|
123
|
+
- 'tiled_map_layer'
|
|
124
|
+
- 'dynamic_map_layer'
|
|
125
|
+
- 'image_map_layer'
|
|
126
|
+
|
|
127
|
+
# Relationships to display
|
|
128
|
+
RELATIONSHIPS_SHOWN:
|
|
129
|
+
MEMBER_OF:
|
|
130
|
+
field: pcdm_memberOf_sm
|
|
131
|
+
query_type: ancestors
|
|
132
|
+
icon: nil
|
|
133
|
+
label: geoblacklight.relations.member_of
|
|
134
|
+
PART_OF_ANCESTORS:
|
|
135
|
+
field: dct_isPartOf_sm
|
|
136
|
+
query_type: ancestors
|
|
137
|
+
icon: nil
|
|
138
|
+
label: geoblacklight.relations.part_of_ancestors
|
|
139
|
+
PART_OF_DESCENDANTS:
|
|
140
|
+
field: dct_isPartOf_sm
|
|
141
|
+
query_type: descendants
|
|
142
|
+
icon: child-item
|
|
143
|
+
label: geoblacklight.relations.part_of_descendants
|
|
144
|
+
RELATION:
|
|
145
|
+
field: dct_relation_sm
|
|
146
|
+
query_type: ancestors
|
|
147
|
+
icon: nil
|
|
148
|
+
label: geoblacklight.relations.relation
|
|
149
|
+
REPLACES:
|
|
150
|
+
field: dct_replaces_sm
|
|
151
|
+
query_type: ancestors
|
|
152
|
+
icon: nil
|
|
153
|
+
label: geoblacklight.relations.replaces
|
|
154
|
+
REPLACED_BY:
|
|
155
|
+
field: dct_isReplacedBy_sm
|
|
156
|
+
query_type: descendants
|
|
157
|
+
icon: nil
|
|
158
|
+
label: geoblacklight.relations.replaced_by
|
|
159
|
+
SOURCE_ANCESTORS:
|
|
160
|
+
field: dct_source_sm
|
|
161
|
+
query_type: ancestors
|
|
162
|
+
icon: parent-item
|
|
163
|
+
label: geoblacklight.relations.ancestor
|
|
164
|
+
SOURCE_DESCENDANTS:
|
|
165
|
+
field: dct_source_sm
|
|
166
|
+
query_type: descendants
|
|
167
|
+
icon: child-item
|
|
168
|
+
label: geoblacklight.relations.descendant
|
|
169
|
+
VERSION_OF:
|
|
170
|
+
field: dct_isVersionOf_sm
|
|
171
|
+
query_type: descendants
|
|
172
|
+
icon: nil
|
|
173
|
+
label: geoblacklight.relations.version_of
|
|
174
|
+
|
|
175
|
+
# WMS Parameters
|
|
176
|
+
WMS_PARAMS:
|
|
177
|
+
:SERVICE: 'WMS'
|
|
178
|
+
:VERSION: '1.1.1'
|
|
179
|
+
:REQUEST: 'GetFeatureInfo'
|
|
180
|
+
:STYLES: ''
|
|
181
|
+
:SRS: 'EPSG:4326'
|
|
182
|
+
:EXCEPTIONS: 'application/json'
|
|
183
|
+
:INFO_FORMAT: 'text/html'
|
|
184
|
+
|
|
185
|
+
# Settings for leaflet
|
|
186
|
+
LEAFLET:
|
|
187
|
+
MAP:
|
|
188
|
+
LAYERS:
|
|
189
|
+
DETECT_RETINA: true
|
|
190
|
+
INDEX:
|
|
191
|
+
DEFAULT: &default
|
|
192
|
+
color: "#7FCDBB"
|
|
193
|
+
weight: "1"
|
|
194
|
+
radius: "4"
|
|
195
|
+
UNAVAILABLE:
|
|
196
|
+
<<: *default
|
|
197
|
+
color: "#EDF8B1"
|
|
198
|
+
SELECTED:
|
|
199
|
+
<<: *default
|
|
200
|
+
color: "#2C7FB8"
|
|
201
|
+
VIEWERS:
|
|
202
|
+
DYNAMICMAPLAYER:
|
|
203
|
+
CONTROLS:
|
|
204
|
+
- 'Opacity'
|
|
205
|
+
- 'Fullscreen'
|
|
206
|
+
FEATURELAYER:
|
|
207
|
+
CONTROLS:
|
|
208
|
+
- 'Opacity'
|
|
209
|
+
- 'Fullscreen'
|
|
210
|
+
IIIF:
|
|
211
|
+
CONTROLS:
|
|
212
|
+
- 'Fullscreen'
|
|
213
|
+
IMAGEMAPLAYER:
|
|
214
|
+
CONTROLS:
|
|
215
|
+
- 'Opacity'
|
|
216
|
+
- 'Fullscreen'
|
|
217
|
+
INDEXMAP:
|
|
218
|
+
CONTROLS:
|
|
219
|
+
- 'Fullscreen'
|
|
220
|
+
TILEDMAPLAYER:
|
|
221
|
+
CONTROLS:
|
|
222
|
+
- 'Opacity'
|
|
223
|
+
- 'Fullscreen'
|
|
224
|
+
WMS:
|
|
225
|
+
CONTROLS:
|
|
226
|
+
- 'Opacity'
|
|
227
|
+
- 'Fullscreen'
|
|
228
|
+
|
|
229
|
+
# Toggle the help text feature that offers users context
|
|
230
|
+
HELP_TEXT:
|
|
231
|
+
viewer_protocol:
|
|
232
|
+
- 'dynamic_map_layer'
|
|
233
|
+
- 'feature_layer'
|
|
234
|
+
- 'iiif'
|
|
235
|
+
- 'iiif_manifest'
|
|
236
|
+
- 'image_map_layer'
|
|
237
|
+
- 'index_map'
|
|
238
|
+
- 'tiled_map_layer'
|
|
239
|
+
- 'wms'
|
|
240
|
+
- 'tms'
|
|
241
|
+
- 'oembed'
|
|
@@ -3,17 +3,16 @@
|
|
|
3
3
|
module GeoblacklightAdmin
|
|
4
4
|
class Engine < ::Rails::Engine
|
|
5
5
|
isolate_namespace GeoblacklightAdmin
|
|
6
|
-
|
|
7
6
|
|
|
8
7
|
# GeoblacklightAdminHelper is needed by all helpers, so we inject it
|
|
9
8
|
# into action view base here.
|
|
10
9
|
initializer "geoblacklight_admin.helpers" do
|
|
11
10
|
config.after_initialize do
|
|
12
|
-
ActionView::Base.
|
|
13
|
-
ActionView::Base.
|
|
14
|
-
ActionView::Base.
|
|
15
|
-
ActionView::Base.
|
|
16
|
-
ActionView::Base.
|
|
11
|
+
ActionView::Base.include GeoblacklightAdminHelper
|
|
12
|
+
ActionView::Base.include BulkActionsHelper
|
|
13
|
+
ActionView::Base.include DocumentHelper
|
|
14
|
+
ActionView::Base.include FormInputHelper
|
|
15
|
+
ActionView::Base.include MappingsHelper
|
|
17
16
|
end
|
|
18
17
|
end
|
|
19
18
|
end
|
data/lib/geoblacklight_admin.rb
CHANGED
|
@@ -9,7 +9,10 @@ namespace :gbl_admin do
|
|
|
9
9
|
task :server, [:rails_server_args] do |_t, args|
|
|
10
10
|
require "solr_wrapper"
|
|
11
11
|
SolrWrapper.wrap(port: "8983") do |solr|
|
|
12
|
-
solr.with_collection(name: "blacklight-core",
|
|
12
|
+
solr.with_collection(name: "blacklight-core",
|
|
13
|
+
dir: File.join(
|
|
14
|
+
File.expand_path(Rails.root, File.dirname(__FILE__)), "solr", "conf"
|
|
15
|
+
)) do
|
|
13
16
|
puts "\nSolr server running: http://localhost:#{solr.port}/solr/#/blacklight-core"
|
|
14
17
|
puts "\n^C to stop"
|
|
15
18
|
puts " "
|
|
@@ -24,8 +27,6 @@ namespace :gbl_admin do
|
|
|
24
27
|
end
|
|
25
28
|
end
|
|
26
29
|
|
|
27
|
-
|
|
28
|
-
|
|
29
30
|
desc "Run test suite"
|
|
30
31
|
task ci: :environment do
|
|
31
32
|
Rails.env = "test"
|
|
@@ -80,7 +81,9 @@ namespace :geomg do
|
|
|
80
81
|
puts " "
|
|
81
82
|
begin
|
|
82
83
|
# Rake::Task['geomg:solr:restore'].invoke
|
|
83
|
-
system "bundle exec rails s --binding=#{ENV.fetch("GEOMG_SERVER_BIND_INTERFACE",
|
|
84
|
+
system "bundle exec rails s --binding=#{ENV.fetch("GEOMG_SERVER_BIND_INTERFACE",
|
|
85
|
+
"0.0.0.0")} --port=#{ENV.fetch("GEOMG_SERVER_PORT",
|
|
86
|
+
"3000")}"
|
|
84
87
|
sleep
|
|
85
88
|
rescue Interrupt
|
|
86
89
|
puts "\nShutting down..."
|
|
@@ -100,7 +103,7 @@ namespace :geomg do
|
|
|
100
103
|
puts "Solr running at http://localhost:8983/solr/#/blacklight-core/, ^C to exit"
|
|
101
104
|
begin
|
|
102
105
|
Rake::Task["db:fixtures:load"].invoke
|
|
103
|
-
Rake::Task["geomg:solr:reindex"].invoke
|
|
106
|
+
# Rake::Task["geomg:solr:reindex"].invoke
|
|
104
107
|
sleep
|
|
105
108
|
rescue Interrupt
|
|
106
109
|
puts "\nShutting down..."
|
|
@@ -200,7 +203,8 @@ namespace :geomg do
|
|
|
200
203
|
|
|
201
204
|
snapshot = Dir.glob(Rails.root.join("solr/snapshots/snapshot.*").to_s).last
|
|
202
205
|
|
|
203
|
-
FileUtils.cp_r(snapshot,
|
|
206
|
+
FileUtils.cp_r(snapshot,
|
|
207
|
+
Rails.root.join("tmp/geoportal-core-development/server/solr/geoportal-core-development/data").to_s)
|
|
204
208
|
|
|
205
209
|
res = Faraday.get "#{solr}/#{replication}"
|
|
206
210
|
puts res.body
|