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.
- checksums.yaml +4 -4
- data/README.md +59 -36
- data/Rakefile +47 -14
- data/app/assets/javascripts/geoblacklight_admin.js +2 -1
- data/app/assets/stylesheets/geoblacklight_admin/_core.scss +5 -0
- data/app/assets/stylesheets/geoblacklight_admin/modules/_chosen.scss +425 -0
- data/app/assets/stylesheets/geoblacklight_admin/modules/_forms.scss +108 -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 +32 -15
- 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 +3 -2
- data/app/controllers/admin/users_controller.rb +2 -2
- data/app/helpers/form_input_helper.rb +4 -4
- data/app/helpers/geoblacklight_admin_helper.rb +1 -1
- data/app/indexers/document_indexer.rb +1 -1
- data/app/jobs/export_job.rb +9 -6
- data/app/jobs/export_json_bulk_job.rb +95 -0
- data/app/jobs/export_json_job.rb +14 -12
- data/app/models/admin/bookmark.rb +18 -0
- data/app/models/api_search_builder.rb +3 -1
- data/app/models/blacklight_api.rb +6 -6
- data/app/models/blacklight_api_facets.rb +7 -2
- data/app/models/blacklight_api_ids.rb +3 -4
- data/app/models/bulk_action.rb +1 -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 +3 -3
- 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 +2 -2
- 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 +3 -1
- data/app/views/admin/documents/_json_btaa_aardvark.jbuilder +1 -3
- data/app/views/admin/documents/_json_file.jbuilder +14 -0
- data/app/views/admin/documents/_result_selected_options.html.erb +3 -1
- 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/fetch.json_file.jbuilder +9 -0
- data/app/views/admin/documents/index.html.erb +2 -4
- data/app/views/admin/documents/index.json_file.jbuilder +9 -0
- 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 +4 -4
- 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 +2 -2
- 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 +11 -6
- data/app/views/admin/shared/_toast.html.erb +1 -1
- data/app/views/admin/users/index.html.erb +1 -1
- data/app/views/catalog/_show_gbl_admin.html.erb +3 -0
- data/config/locales/documents.en.yml +3 -0
- data/config/routes.rb +37 -33
- data/db/migrate/20230316183001_add_geoblacklight_admin_gem.rb +409 -0
- data/db/seeds.rb +7 -6
- data/db/seeds_elements.csv +56 -55
- data/db/seeds_elements.numbers +0 -0
- data/db/seeds_form_elements.csv +65 -64
- data/db/seeds_form_elements.numbers +0 -0
- data/lib/generators/geoblacklight_admin/config_generator.rb +61 -94
- data/lib/generators/geoblacklight_admin/install_generator.rb +3 -12
- 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/geomg_aardvark_schema.json +12 -6
- data/lib/generators/geoblacklight_admin/templates/config/initializers/devise.rb +315 -0
- data/lib/generators/geoblacklight_admin/templates/config/initializers/geoblacklight_admin.rb +1 -2
- data/lib/generators/geoblacklight_admin/templates/config/initializers/kithe.rb +2 -0
- data/lib/generators/geoblacklight_admin/templates/config/initializers/mime_types.rb +15 -0
- data/lib/generators/geoblacklight_admin/templates/config/initializers/pagy.rb +152 -68
- data/lib/generators/geoblacklight_admin/templates/config/initializers/simple_form.rb +178 -0
- data/lib/generators/geoblacklight_admin/templates/config/initializers/simple_form_bootstrap.rb +365 -0
- data/lib/generators/geoblacklight_admin/templates/config/settings.yml +293 -0
- data/lib/generators/geoblacklight_admin/templates/javascript/controllers/results_controller.js +10 -0
- data/lib/generators/geoblacklight_admin/templates/package.json +3 -0
- data/lib/generators/geoblacklight_admin/templates/solr/conf/schema.xml +3 -3
- data/lib/generators/geoblacklight_admin/views_generator.rb +2 -3
- 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 +15 -11
- metadata +101 -63
- 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/example_docs_generator.rb +0 -18
- 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
- /data/{app/views/admin → lib/generators/geoblacklight_admin/templates}/devise/confirmations/new.html.erb +0 -0
- /data/{app/views/admin → lib/generators/geoblacklight_admin/templates}/devise/invitations/edit.html.erb +0 -0
- /data/{app/views/admin → lib/generators/geoblacklight_admin/templates}/devise/invitations/new.html.erb +0 -0
- /data/{app/views/admin → lib/generators/geoblacklight_admin/templates}/devise/mailer/invitation_instructions.html.erb +0 -0
- /data/{app/views/admin → lib/generators/geoblacklight_admin/templates}/devise/mailer/invitation_instructions.text.erb +0 -0
- /data/{app/views/admin → lib/generators/geoblacklight_admin/templates}/devise/passwords/edit.html.erb +0 -0
- /data/{app/views/admin → lib/generators/geoblacklight_admin/templates}/devise/passwords/new.html.erb +0 -0
- /data/{app/views/admin → lib/generators/geoblacklight_admin/templates}/devise/registrations/edit.html.erb +0 -0
- /data/{app/views/admin → lib/generators/geoblacklight_admin/templates}/devise/registrations/new.html.erb +0 -0
- /data/{app/views/admin → lib/generators/geoblacklight_admin/templates}/devise/sessions/new.html.erb +0 -0
- /data/{app/views/admin → lib/generators/geoblacklight_admin/templates}/devise/shared/_links.html.erb +0 -0
- /data/{app/views/admin → lib/generators/geoblacklight_admin/templates}/devise/unlocks/new.html.erb +0 -0
@@ -1,5 +1,6 @@
|
|
1
|
-
#
|
2
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "blacklight/catalog"
|
3
4
|
|
4
5
|
# Admin::ApiController
|
5
6
|
module Admin
|
@@ -18,41 +19,43 @@ module Admin
|
|
18
19
|
config.advanced_search ||= Blacklight::OpenStructWithHashAccess.new
|
19
20
|
|
20
21
|
# Blacklight update to 7.0.0
|
21
|
-
config.add_results_document_tool(:bookmark, partial:
|
22
|
+
config.add_results_document_tool(:bookmark, partial: "bookmark_control", if: :render_bookmarks_control?)
|
22
23
|
|
23
24
|
config.add_results_collection_tool(:sort_widget)
|
24
25
|
config.add_results_collection_tool(:per_page_widget)
|
25
26
|
config.add_results_collection_tool(:view_type_group)
|
26
27
|
|
27
|
-
config.add_show_tools_partial(:bookmark, partial:
|
28
|
+
config.add_show_tools_partial(:bookmark, partial: "bookmark_control", if: :render_bookmarks_control?)
|
28
29
|
config.add_show_tools_partial(:email, callback: :email_action, validator: :validate_email_params)
|
29
|
-
config.add_show_tools_partial(:sms, if: :render_sms_action?, callback: :sms_action,
|
30
|
+
config.add_show_tools_partial(:sms, if: :render_sms_action?, callback: :sms_action,
|
31
|
+
validator: :validate_sms_params)
|
30
32
|
|
31
|
-
config.add_nav_action(:bookmark, partial:
|
33
|
+
config.add_nav_action(:bookmark, partial: "blacklight/nav/bookmark", if: :render_bookmarks_control?)
|
32
34
|
# Blacklight update to 7.0.0
|
33
35
|
|
34
36
|
# Advanced config values
|
35
37
|
config.advanced_search ||= Blacklight::OpenStructWithHashAccess.new
|
36
|
-
config.advanced_search[:url_key] ||=
|
37
|
-
config.advanced_search[:query_parser] ||=
|
38
|
+
config.advanced_search[:url_key] ||= "advanced"
|
39
|
+
config.advanced_search[:query_parser] ||= "edismax"
|
38
40
|
config.advanced_search[:form_solr_parameters] ||= {}
|
39
|
-
config.advanced_search[:form_solr_parameters][
|
40
|
-
|
41
|
-
config.advanced_search[:form_solr_parameters][
|
42
|
-
config.advanced_search[:form_solr_parameters][
|
41
|
+
config.advanced_search[:form_solr_parameters]["facet.field"] ||= [Settings.FIELDS.PROVIDER,
|
42
|
+
Settings.FIELDS.B1G_CODE, Settings.FIELDS.MEMBER_OF, Settings.FIELDS.IS_PART_OF, Settings.FIELDS.RESOURCE_CLASS, Settings.FIELDS.RESOURCE_TYPE, Settings.FIELDS.SUBJECT, Settings.FIELDS.THEME, Settings.FIELDS.FORMAT, Settings.FIELDS.SUPPRESSED, Settings.FIELDS.B1G_CHILD_RECORD, Settings.FIELDS.GEOREFERENCED]
|
43
|
+
config.advanced_search[:form_solr_parameters]["facet.query"] ||= ""
|
44
|
+
config.advanced_search[:form_solr_parameters]["facet.limit"] ||= -1
|
45
|
+
config.advanced_search[:form_solr_parameters]["facet.sort"] ||= "index"
|
43
46
|
|
44
47
|
# Map views
|
45
48
|
config.view.mapview.partials = [:index]
|
46
|
-
config.view[
|
47
|
-
config.view[
|
49
|
+
config.view["split"].title = "List view"
|
50
|
+
config.view["mapview"].title = "Map view"
|
48
51
|
|
49
52
|
config.raw_endpoint.enabled = true
|
50
53
|
|
51
54
|
## Default parameters to send to solr for all search-like requests. See also SolrHelper#solr_search_params
|
52
55
|
config.default_solr_params = {
|
53
56
|
:start => 0,
|
54
|
-
|
55
|
-
|
57
|
+
"q.alt" => "*:*",
|
58
|
+
"admin.api" => true
|
56
59
|
}
|
57
60
|
|
58
61
|
# @TODO
|
@@ -65,8 +68,8 @@ module Admin
|
|
65
68
|
## parameters included in the Blacklight-jetty document requestHandler.
|
66
69
|
#
|
67
70
|
config.default_document_solr_params = {
|
68
|
-
|
69
|
-
|
71
|
+
qt: "document",
|
72
|
+
q: "{!raw f=#{Settings.FIELDS.B1G_GEOMG_ID} v=$id}"
|
70
73
|
}
|
71
74
|
|
72
75
|
# config.search_builder_class = Geoblacklight::SearchBuilder
|
@@ -80,7 +83,7 @@ module Admin
|
|
80
83
|
|
81
84
|
# solr field configuration for document/show views
|
82
85
|
|
83
|
-
config.show.display_type_field =
|
86
|
+
config.show.display_type_field = "format"
|
84
87
|
|
85
88
|
# Custom GeoBlacklight fields which currently map to GeoBlacklight-Schema
|
86
89
|
# v0.3.2
|
@@ -121,29 +124,29 @@ module Admin
|
|
121
124
|
# config.add_facet_field 'date_created_drsim', :label => 'Date Created', :show => false
|
122
125
|
|
123
126
|
# Date Created
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
127
|
+
config.add_facet_field "time_period", label: "Date Created", query: {
|
128
|
+
"today" => {label: "Today", fq: "date_created_drsim:[#{Date.today.beginning_of_day.to_time.strftime("%Y-%m-%dT%H:%M:%S")} TO #{Date.today.end_of_day.to_time.strftime("%Y-%m-%dT%H:%M:%S")}]"},
|
129
|
+
"this_week" => {label: "This week", fq: "date_created_drsim:[#{(Date.today.end_of_day - 1.week).to_time.strftime("%Y-%m-%dT%H:%M:%S")} TO #{Date.today.end_of_day.to_time.strftime("%Y-%m-%dT%H:%M:%S")}]"},
|
130
|
+
"this_month" => {label: "This month", fq: "date_created_drsim:[#{(Date.today.end_of_day - 1.month).to_time.strftime("%Y-%m-%dT%H:%M:%S")} TO #{Date.today.end_of_day.to_time.strftime("%Y-%m-%dT%H:%M:%S")}]"},
|
131
|
+
"last_month" => {label: "Last month", fq: "date_created_drsim:[#{(Date.today.end_of_day - 2.months).to_time.strftime("%Y-%m-%dT%H:%M:%S")} TO #{(Date.today.end_of_day - 1.month).to_time.strftime("%Y-%m-%dT%H:%M:%S")}]"},
|
132
|
+
"this_quarter" => {label: "This quarter", fq: "date_created_drsim:[#{(Date.today.end_of_day - 3.months).to_time.strftime("%Y-%m-%dT%H:%M:%S")} TO #{Date.today.end_of_day.to_time.strftime("%Y-%m-%dT%H:%M:%S")}]"},
|
133
|
+
"this_year" => {label: "This year", fq: "date_created_drsim:[#{(Date.today.end_of_day - 1.year).to_time.strftime("%Y-%m-%dT%H:%M:%S")} TO #{Date.today.end_of_day.to_time.strftime("%Y-%m-%dT%H:%M:%S")}]"}
|
134
|
+
}
|
132
135
|
|
133
136
|
# Publication State
|
134
|
-
|
137
|
+
config.add_facet_field Settings.FIELDS.B1G_PUBLICATION_STATE, label: "Publication State", limit: 8, collapse: false
|
135
138
|
|
136
139
|
# Resouce Class
|
137
|
-
config.add_facet_field Settings.FIELDS.RESOURCE_CLASS, label:
|
140
|
+
config.add_facet_field Settings.FIELDS.RESOURCE_CLASS, label: "Resource Class", limit: 8
|
138
141
|
|
139
142
|
# Contributor
|
140
|
-
config.add_facet_field Settings.FIELDS.PROVIDER, label:
|
143
|
+
config.add_facet_field Settings.FIELDS.PROVIDER, label: "Provider", limit: 15
|
141
144
|
|
142
145
|
# Accrual Method
|
143
146
|
# config.add_facet_field Settings.FIELDS.B1G_ACCRUAL_METHOD, :label => 'Accrual Method'
|
144
147
|
|
145
148
|
# Public/Restricted
|
146
|
-
config.add_facet_field Settings.FIELDS.ACCESS_RIGHTS, :
|
149
|
+
config.add_facet_field Settings.FIELDS.ACCESS_RIGHTS, label: "Public/Restricted"
|
147
150
|
|
148
151
|
# ADVANCED SEARCH
|
149
152
|
#
|
@@ -151,31 +154,31 @@ module Admin
|
|
151
154
|
# config.add_facet_field Settings.FIELDS.B1G_CODE, label: 'Code', show: false
|
152
155
|
|
153
156
|
# Is Part Of
|
154
|
-
config.add_facet_field Settings.FIELDS.IS_PART_OF, label:
|
157
|
+
config.add_facet_field Settings.FIELDS.IS_PART_OF, label: "Is Part Of", show: false
|
155
158
|
|
156
159
|
# Member Of
|
157
|
-
config.add_facet_field Settings.FIELDS.MEMBER_OF, label:
|
160
|
+
config.add_facet_field Settings.FIELDS.MEMBER_OF, label: "Member Of", show: false
|
158
161
|
|
159
162
|
# Resource Type
|
160
|
-
config.add_facet_field Settings.FIELDS.RESOURCE_TYPE, label:
|
163
|
+
config.add_facet_field Settings.FIELDS.RESOURCE_TYPE, label: "Resource Type", show: false
|
161
164
|
|
162
165
|
# Subject
|
163
|
-
config.add_facet_field Settings.FIELDS.SUBJECT, label:
|
166
|
+
config.add_facet_field Settings.FIELDS.SUBJECT, label: "Subject", show: false
|
164
167
|
|
165
168
|
# Theme
|
166
|
-
config.add_facet_field Settings.FIELDS.THEME, label:
|
169
|
+
config.add_facet_field Settings.FIELDS.THEME, label: "Theme", show: false
|
167
170
|
|
168
171
|
# Format
|
169
|
-
config.add_facet_field Settings.FIELDS.FORMAT, label:
|
172
|
+
config.add_facet_field Settings.FIELDS.FORMAT, label: "Format", show: false
|
170
173
|
|
171
174
|
# Suppressed
|
172
|
-
config.add_facet_field Settings.FIELDS.SUPPRESSED, label:
|
175
|
+
config.add_facet_field Settings.FIELDS.SUPPRESSED, label: "Suppressed", show: false
|
173
176
|
|
174
177
|
# Child Record
|
175
178
|
# config.add_facet_field Settings.FIELDS.B1G_CHILD_RECORD, label: 'Child Record', show: false
|
176
179
|
|
177
180
|
# Georeferenced
|
178
|
-
config.add_facet_field Settings.FIELDS.GEOREFERENCED, label:
|
181
|
+
config.add_facet_field Settings.FIELDS.GEOREFERENCED, label: "Georeferenced", show: false
|
179
182
|
|
180
183
|
# Have BL send all facet field names to Solr, which has been the default
|
181
184
|
# previously. Simply remove these lines if you'd rather use Solr request
|
@@ -194,17 +197,17 @@ module Admin
|
|
194
197
|
# config.add_index_field 'published_vern_display', :label => 'Published:'
|
195
198
|
# config.add_index_field 'lc_callnum_display', :label => 'Call number:'
|
196
199
|
|
197
|
-
config.add_index_field Settings.FIELDS.TITLE, :
|
200
|
+
config.add_index_field Settings.FIELDS.TITLE, label: "Title:"
|
198
201
|
# config.add_index_field Settings.FIELDS.B1G_GEOMG_ID, :label => 'Identifier:'
|
199
|
-
config.add_index_field Settings.FIELDS.PROVIDER, :
|
200
|
-
config.add_index_field Settings.FIELDS.ACCESS_RIGHTS, :
|
201
|
-
config.add_index_field Settings.FIELDS.SUBJECT, :
|
202
|
-
config.add_index_field Settings.FIELDS.CENTROID, :
|
202
|
+
config.add_index_field Settings.FIELDS.PROVIDER, label: "Institution:"
|
203
|
+
config.add_index_field Settings.FIELDS.ACCESS_RIGHTS, label: "Access:"
|
204
|
+
config.add_index_field Settings.FIELDS.SUBJECT, label: "Keywords:"
|
205
|
+
config.add_index_field Settings.FIELDS.CENTROID, label: "Centroid:"
|
203
206
|
config.add_index_field Settings.FIELDS.INDEX_YEAR
|
204
207
|
config.add_index_field Settings.FIELDS.CREATOR
|
205
208
|
config.add_index_field Settings.FIELDS.DESCRIPTION, helper_method: :snippit
|
206
209
|
config.add_index_field Settings.FIELDS.PUBLISHER
|
207
|
-
config.add_index_field Settings.FIELDS.SUPPRESSED, :
|
210
|
+
config.add_index_field Settings.FIELDS.SUPPRESSED, label: "Suppressed:"
|
208
211
|
|
209
212
|
# solr fields to be displayed in the show (single result) view
|
210
213
|
# The ordering of the field names is the order of the display
|
@@ -212,16 +215,19 @@ module Admin
|
|
212
215
|
# item_prop: [String] property given to span with Schema.org item property
|
213
216
|
# link_to_facet: [Boolean] that can be passed to link to a facet search
|
214
217
|
# helper_method: [Symbol] method that can be used to render the value
|
215
|
-
config.add_show_field Settings.FIELDS.CREATOR, label:
|
216
|
-
config.add_show_field Settings.FIELDS.DESCRIPTION, label:
|
217
|
-
|
218
|
-
config.add_show_field Settings.FIELDS.
|
219
|
-
config.add_show_field Settings.FIELDS.
|
220
|
-
|
221
|
-
config.add_show_field Settings.FIELDS.
|
222
|
-
config.add_show_field Settings.FIELDS.
|
223
|
-
config.add_show_field Settings.FIELDS.
|
224
|
-
|
218
|
+
config.add_show_field Settings.FIELDS.CREATOR, label: "Creator", itemprop: "creator"
|
219
|
+
config.add_show_field Settings.FIELDS.DESCRIPTION, label: "Description", itemprop: "description",
|
220
|
+
helper_method: :render_value_as_truncate_abstract
|
221
|
+
config.add_show_field Settings.FIELDS.PUBLISHER, label: "Publisher", itemprop: "publisher", link_to_facet: true
|
222
|
+
config.add_show_field Settings.FIELDS.SPATIAL_COVERAGE, label: "Place", itemprop: "spatial", link_to_facet: true,
|
223
|
+
helper_method: :render_placenames_as_truncate_abstract
|
224
|
+
config.add_show_field Settings.FIELDS.SUBJECT, label: "Subject", itemprop: "keywords", link_to_facet: true
|
225
|
+
config.add_show_field Settings.FIELDS.RESOURCE_TYPE, label: "Type", itemprop: "keywords", link_to_facet: true
|
226
|
+
config.add_show_field Settings.FIELDS.DATE_ISSUED, label: "Date Published", itemprop: "keywords",
|
227
|
+
link_to_facet: true
|
228
|
+
config.add_show_field Settings.FIELDS.TEMPORAL_COVERAGE, label: "Temporal Coverage", itemprop: "temporal"
|
229
|
+
config.add_show_field Settings.FIELDS.PROVIDER, label: "Contributed by", link_to_facet: true
|
230
|
+
config.add_show_field Settings.FIELDS.RIGHTS, label: "Access Rights"
|
225
231
|
|
226
232
|
# "fielded" search configuration. Used by pulldown among other places.
|
227
233
|
# For supported keys in hash, see rdoc for Blacklight::SearchFields
|
@@ -241,48 +247,48 @@ module Admin
|
|
241
247
|
# solr request handler? The one set in config[:default_solr_parameters][:qt],
|
242
248
|
# since we aren't specifying it otherwise.
|
243
249
|
|
244
|
-
config.add_search_field(
|
250
|
+
config.add_search_field("all_fields") do |field|
|
245
251
|
field.include_in_advanced_search = false
|
246
|
-
field.label =
|
252
|
+
field.label = "All Fields"
|
247
253
|
end
|
248
254
|
|
249
|
-
config.add_search_field(
|
255
|
+
config.add_search_field("keyword") do |field|
|
250
256
|
field.include_in_simple_select = false
|
251
|
-
field.qt =
|
252
|
-
field.label =
|
257
|
+
field.qt = "search"
|
258
|
+
field.label = "Keyword"
|
253
259
|
field.solr_local_parameters = {
|
254
|
-
qf:
|
255
|
-
pf:
|
260
|
+
qf: "$qf",
|
261
|
+
pf: "$pf"
|
256
262
|
}
|
257
263
|
end
|
258
264
|
|
259
|
-
config.add_search_field(
|
265
|
+
config.add_search_field("title") do |field|
|
260
266
|
field.include_in_simple_select = false
|
261
|
-
field.qt =
|
262
|
-
field.label =
|
267
|
+
field.qt = "search"
|
268
|
+
field.label = "Title"
|
263
269
|
field.solr_local_parameters = {
|
264
|
-
qf:
|
265
|
-
pf:
|
270
|
+
qf: "$title_qf",
|
271
|
+
pf: "$title_pf"
|
266
272
|
}
|
267
273
|
end
|
268
274
|
|
269
|
-
config.add_search_field(
|
275
|
+
config.add_search_field("placename") do |field|
|
270
276
|
field.include_in_simple_select = false
|
271
|
-
field.qt =
|
272
|
-
field.label =
|
277
|
+
field.qt = "search"
|
278
|
+
field.label = "Place"
|
273
279
|
field.solr_local_parameters = {
|
274
|
-
qf:
|
275
|
-
pf:
|
280
|
+
qf: "$placename_qf",
|
281
|
+
pf: "$placename_pf"
|
276
282
|
}
|
277
283
|
end
|
278
284
|
|
279
|
-
config.add_search_field(
|
285
|
+
config.add_search_field("publisher") do |field|
|
280
286
|
field.include_in_simple_select = false
|
281
|
-
field.qt =
|
282
|
-
field.label =
|
287
|
+
field.qt = "search"
|
288
|
+
field.label = "Publisher/Creator"
|
283
289
|
field.solr_local_parameters = {
|
284
|
-
qf:
|
285
|
-
pf:
|
290
|
+
qf: "$publisher_qf",
|
291
|
+
pf: "$publisher_pf"
|
286
292
|
}
|
287
293
|
end
|
288
294
|
|
@@ -290,41 +296,52 @@ module Admin
|
|
290
296
|
# label in pulldown is followed by the name of the SOLR field to sort by and
|
291
297
|
# whether the sort is ascending or descending (it must be asc or desc
|
292
298
|
# except in the relevancy case).
|
293
|
-
config.add_sort_field
|
294
|
-
config.add_sort_field "#{Settings.FIELDS.INDEX_YEAR} desc, dct_title_sort asc", :
|
295
|
-
config.add_sort_field "#{Settings.FIELDS.INDEX_YEAR} asc, dct_title_sort asc", :
|
296
|
-
config.add_sort_field
|
297
|
-
config.add_sort_field
|
298
|
-
config.add_sort_field
|
299
|
-
config.add_sort_field
|
299
|
+
config.add_sort_field "score desc, dct_title_sort asc", label: "Relevance"
|
300
|
+
config.add_sort_field "#{Settings.FIELDS.INDEX_YEAR} desc, dct_title_sort asc", label: "Year (Newest first)"
|
301
|
+
config.add_sort_field "#{Settings.FIELDS.INDEX_YEAR} asc, dct_title_sort asc", label: "Year (Oldest first)"
|
302
|
+
config.add_sort_field "dct_title_sort asc", label: "Title (A-Z)"
|
303
|
+
config.add_sort_field "dct_title_sort desc", label: "Title (Z-A)"
|
304
|
+
config.add_sort_field "date_modified_dtsi desc", label: "Updated At (Newest first)"
|
305
|
+
config.add_sort_field "date_modified_dtsi asc", label: "Updated At (Oldest first)"
|
300
306
|
|
301
307
|
# If there are more than this many search results, no spelling ("did you
|
302
308
|
# mean") suggestion is offered.
|
303
309
|
config.spell_max = 5
|
304
310
|
|
305
311
|
# Custom tools for GeoBlacklight
|
306
|
-
config.add_show_tools_partial :more_details, partial:
|
307
|
-
|
308
|
-
|
309
|
-
config.add_show_tools_partial :
|
310
|
-
|
312
|
+
config.add_show_tools_partial :more_details, partial: "more_details", if: proc { |_context, _config, options|
|
313
|
+
options[:document] && (!options[:document].references.nil? & !options[:document].references.url.nil?)
|
314
|
+
}
|
315
|
+
config.add_show_tools_partial :metadata, if: proc { |_context, _config, options|
|
316
|
+
options[:document] && (Settings.METADATA_SHOWN & options[:document].references.refs.map(&:type).map(&:to_s)).any?
|
317
|
+
}
|
318
|
+
config.add_show_tools_partial :web_services, if: proc { |_context, _config, options|
|
319
|
+
options[:document] && (Settings.WEBSERVICES_SHOWN & options[:document].references.refs.map(&:type).map(&:to_s)).any?
|
320
|
+
}
|
321
|
+
config.add_show_tools_partial :exports, partial: "exports", if: proc { |_context, _config, options|
|
322
|
+
options[:document]
|
323
|
+
}
|
324
|
+
config.add_show_tools_partial :data_dictionary, partial: "data_dictionary", if: proc { |_context, _config, options|
|
325
|
+
options[:document] && options[:document].data_dictionary_download.present?
|
326
|
+
}
|
311
327
|
config.add_show_tools_partial(:citation)
|
312
|
-
config.add_show_tools_partial(:access_links, partial:
|
328
|
+
config.add_show_tools_partial(:access_links, partial: "access_links", if: proc { |_context, _config, options|
|
329
|
+
options[:document] && options[:document].access_links.present?
|
330
|
+
})
|
313
331
|
|
314
332
|
# Remove nav actions
|
315
|
-
config.add_nav_action(:bookmark, partial:
|
333
|
+
config.add_nav_action(:bookmark, partial: "blacklight/nav/bookmark", if: false)
|
316
334
|
|
317
335
|
# Remove show tools
|
318
336
|
config.show.partials.delete(:show_header)
|
319
337
|
config.show.partials.delete(:show)
|
320
338
|
|
321
|
-
config.show.display_type_field =
|
322
|
-
config.show.partials <<
|
323
|
-
config.show.partials <<
|
324
|
-
config.show.partials <<
|
325
|
-
config.show.partials <<
|
326
|
-
config.show.partials <<
|
327
|
-
|
339
|
+
config.show.display_type_field = "format"
|
340
|
+
config.show.partials << "show_header"
|
341
|
+
config.show.partials << "show_default_viewer_container"
|
342
|
+
config.show.partials << "show_default_viewer_information"
|
343
|
+
config.show.partials << "show_default_attribute_table"
|
344
|
+
config.show.partials << "show"
|
328
345
|
|
329
346
|
config.show.document_actions.delete(:email)
|
330
347
|
config.show.document_actions.delete(:bookmark)
|
@@ -336,30 +353,30 @@ module Admin
|
|
336
353
|
# 'mapquest' http://developer.mapquest.com/web/products/open/map
|
337
354
|
# 'positron' http://cartodb.com/basemaps/
|
338
355
|
# 'darkMatter' http://cartodb.com/basemaps/
|
339
|
-
config.basemap_provider =
|
340
|
-
config.max_per_page =
|
356
|
+
config.basemap_provider = "esri"
|
357
|
+
config.max_per_page = 100_000
|
341
358
|
|
342
359
|
# Configuration for autocomplete suggestor
|
343
360
|
config.autocomplete_enabled = true
|
344
|
-
config.autocomplete_path =
|
361
|
+
config.autocomplete_path = "suggest"
|
345
362
|
end
|
346
363
|
|
347
364
|
# Administrative view of document
|
348
365
|
# - Sidecar Image
|
349
366
|
# - URIs
|
350
367
|
def admin
|
351
|
-
|
368
|
+
_, @document = search_service.fetch(params[:id])
|
352
369
|
end
|
353
370
|
|
354
371
|
# Administrative view for array of document ids
|
355
372
|
# - bookmarks
|
356
373
|
def fetch
|
357
|
-
@response,
|
374
|
+
@response, = search_service.fetch(params[:id])
|
358
375
|
|
359
376
|
respond_to do |format|
|
360
377
|
format.json do
|
361
378
|
@presenter = Blacklight::JsonPresenter.new(@response,
|
362
|
-
|
379
|
+
blacklight_config)
|
363
380
|
end
|
364
381
|
end
|
365
382
|
end
|
@@ -369,16 +386,14 @@ module Admin
|
|
369
386
|
# We want to find the facets available for the current search, but:
|
370
387
|
# * IGNORING current query (add in facets_for_advanced_search_form filter)
|
371
388
|
# * IGNORING current advanced search facets (remove add_advanced_search_to_solr filter)
|
372
|
-
@response,
|
389
|
+
@response, = search_service.search_results do |search_builder|
|
373
390
|
search_builder.except(:add_advanced_search_to_solr).append(:facets_for_advanced_search_form)
|
374
391
|
end
|
375
392
|
|
376
|
-
@response
|
377
|
-
|
378
393
|
respond_to do |format|
|
379
394
|
format.json do
|
380
395
|
@presenter = Blacklight::JsonPresenter.new(@response,
|
381
|
-
|
396
|
+
blacklight_config)
|
382
397
|
end
|
383
398
|
end
|
384
399
|
end
|
@@ -9,7 +9,7 @@ module Admin
|
|
9
9
|
# GET /bookmarks
|
10
10
|
# GET /bookmarks.json
|
11
11
|
def index
|
12
|
-
@pagy, @bookmarks = pagy(current_user.bookmarks)
|
12
|
+
@pagy, @bookmarks = pagy(current_user.bookmarks.where(document_type: "Kithe::Model"))
|
13
13
|
|
14
14
|
respond_to do |format|
|
15
15
|
format.html { render :index }
|
@@ -21,7 +21,7 @@ module Admin
|
|
21
21
|
# POST /bookmarks
|
22
22
|
# POST /bookmarks.json
|
23
23
|
def create
|
24
|
-
@bookmark = Bookmark.find_or_create_by(user: current_user, document: @document)
|
24
|
+
@bookmark = Admin::Bookmark.find_or_create_by(user: current_user, document: @document)
|
25
25
|
|
26
26
|
respond_to do |format|
|
27
27
|
if @bookmark.save
|
@@ -37,7 +37,7 @@ module Admin
|
|
37
37
|
# DELETE /bookmarks/1
|
38
38
|
# DELETE /bookmarks/1.json
|
39
39
|
def destroy
|
40
|
-
Bookmark.destroy_by(user: current_user, document: @document)
|
40
|
+
Admin::Bookmark.destroy_by(user: current_user, document: @document)
|
41
41
|
|
42
42
|
respond_to do |format|
|
43
43
|
format.html { redirect_to bookmarks_url, notice: "Bookmark was successfully destroyed." }
|
@@ -65,4 +65,4 @@ module Admin
|
|
65
65
|
end
|
66
66
|
end
|
67
67
|
end
|
68
|
-
end
|
68
|
+
end
|
@@ -34,7 +34,9 @@ module Admin
|
|
34
34
|
|
35
35
|
respond_to do |format|
|
36
36
|
if @bulk_action.save
|
37
|
-
format.html
|
37
|
+
format.html do
|
38
|
+
redirect_to admin_bulk_action_path(@bulk_action), notice: "Bulk action was successfully created."
|
39
|
+
end
|
38
40
|
format.json { render :show, status: :created, location: @bulk_action }
|
39
41
|
else
|
40
42
|
format.html { render :new }
|
@@ -48,7 +50,9 @@ module Admin
|
|
48
50
|
def update
|
49
51
|
respond_to do |format|
|
50
52
|
if @bulk_action.update(bulk_action_params)
|
51
|
-
format.html
|
53
|
+
format.html do
|
54
|
+
redirect_to admin_bulk_action_path(@bulk_action), notice: "Bulk action was successfully updated."
|
55
|
+
end
|
52
56
|
format.json { render :show, status: :ok, location: @bulk_action }
|
53
57
|
else
|
54
58
|
format.html { render :edit }
|
@@ -76,7 +80,8 @@ module Admin
|
|
76
80
|
def revert
|
77
81
|
@bulk_action.revert!
|
78
82
|
@bulk_action.state_machine.transition_to!(:queued)
|
79
|
-
redirect_to admin_bulk_action_url(@bulk_action),
|
83
|
+
redirect_to admin_bulk_action_url(@bulk_action),
|
84
|
+
notice: "Revert bulk action is running. Check back soon for results."
|
80
85
|
end
|
81
86
|
|
82
87
|
private
|
@@ -91,4 +96,4 @@ module Admin
|
|
91
96
|
params.fetch(:bulk_action, {})
|
92
97
|
end
|
93
98
|
end
|
94
|
-
end
|
99
|
+
end
|
@@ -39,7 +39,9 @@ module Admin
|
|
39
39
|
|
40
40
|
respond_to do |format|
|
41
41
|
if @document_access.save
|
42
|
-
format.html
|
42
|
+
format.html do
|
43
|
+
redirect_to admin_document_document_accesses_path(@document), notice: "Document access was successfully created."
|
44
|
+
end
|
43
45
|
format.json { render :show, status: :created, location: @document_access }
|
44
46
|
else
|
45
47
|
format.html { render :new }
|
@@ -53,7 +55,9 @@ module Admin
|
|
53
55
|
def update
|
54
56
|
respond_to do |format|
|
55
57
|
if @document_access.update(document_access_params)
|
56
|
-
format.html
|
58
|
+
format.html do
|
59
|
+
redirect_to admin_document_document_accesses_path(@document), notice: "Document access was successfully updated."
|
60
|
+
end
|
57
61
|
format.json { render :show, status: :ok, location: @document_access }
|
58
62
|
else
|
59
63
|
format.html { render :edit }
|
@@ -67,7 +71,9 @@ module Admin
|
|
67
71
|
def destroy
|
68
72
|
@document_access.destroy
|
69
73
|
respond_to do |format|
|
70
|
-
format.html
|
74
|
+
format.html do
|
75
|
+
redirect_to admin_document_document_accesses_path(@document), notice: "Document access was successfully destroyed."
|
76
|
+
end
|
71
77
|
format.json { head :no_content }
|
72
78
|
end
|
73
79
|
end
|
@@ -122,4 +128,4 @@ module Admin
|
|
122
128
|
params.require(:document_access).permit(:friendlier_id, :institution_code, :access_url)
|
123
129
|
end
|
124
130
|
end
|
125
|
-
end
|
131
|
+
end
|
@@ -24,11 +24,11 @@ module Admin
|
|
24
24
|
@asset = Kithe::Asset.find_by_friendlier_id!(params[:id])
|
25
25
|
authorize! :read, @asset
|
26
26
|
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
27
|
+
return unless @asset.stored?
|
28
|
+
|
29
|
+
@checks = @asset.fixity_checks.order("created_at asc")
|
30
|
+
@latest_check = @checks.last
|
31
|
+
@earliest_check = @checks.first
|
32
32
|
end
|
33
33
|
|
34
34
|
def edit
|
@@ -58,7 +58,10 @@ module Admin
|
|
58
58
|
@asset.destroy
|
59
59
|
|
60
60
|
respond_to do |format|
|
61
|
-
format.html
|
61
|
+
format.html do
|
62
|
+
redirect_to document_document_assets_path(@document),
|
63
|
+
notice: "Asset '#{@asset.title}' was successfully destroyed."
|
64
|
+
end
|
62
65
|
format.json { head :no_content }
|
63
66
|
end
|
64
67
|
end
|
@@ -105,9 +108,7 @@ module Admin
|
|
105
108
|
asset.save!
|
106
109
|
end
|
107
110
|
|
108
|
-
if @parent.representative_id.nil?
|
109
|
-
@parent.update(representative: @parent.members.order(:position).first)
|
110
|
-
end
|
111
|
+
@parent.update(representative: @parent.members.order(:position).first) if @parent.representative_id.nil?
|
111
112
|
|
112
113
|
redirect_to document_path(@parent.friendlier_id, anchor: "nav-members")
|
113
114
|
end
|
@@ -155,7 +156,8 @@ module Admin
|
|
155
156
|
|
156
157
|
RefreshActiveEncodeStatusJob.perform_later(status)
|
157
158
|
|
158
|
-
redirect_to admin_asset_url(status.asset),
|
159
|
+
redirect_to admin_asset_url(status.asset),
|
160
|
+
notice: "Started refresh for ActiveEncode job #{status.active_encode_id}"
|
159
161
|
end
|
160
162
|
|
161
163
|
def work_is_oral_history?
|
@@ -175,6 +177,7 @@ module Admin
|
|
175
177
|
|
176
178
|
def parent_path(asset)
|
177
179
|
return nil if asset.parent.nil?
|
180
|
+
|
178
181
|
asset.parent.is_a? Collection ? collection_path(asset.parent) : admin_work_path(asset.parent)
|
179
182
|
end
|
180
183
|
helper_method :parent_path
|
@@ -195,4 +198,4 @@ module Admin
|
|
195
198
|
params.require(:asset).permit(*allowed_params)
|
196
199
|
end
|
197
200
|
end
|
198
|
-
end
|
201
|
+
end
|