geoblacklight_admin 0.1.0 → 0.2.1

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.
Files changed (65) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +58 -59
  3. data/Rakefile +25 -10
  4. data/app/assets/javascripts/geoblacklight_admin.js +1 -1
  5. data/app/assets/stylesheets/geoblacklight_admin/modules/_forms.scss +108 -0
  6. data/app/controllers/admin/documents_controller.rb +22 -13
  7. data/app/controllers/admin/search_controller.rb +2 -1
  8. data/app/controllers/admin/users_controller.rb +1 -1
  9. data/app/indexers/document_indexer.rb +1 -1
  10. data/app/jobs/export_job.rb +7 -5
  11. data/app/jobs/export_json_bulk_job.rb +95 -0
  12. data/app/jobs/export_json_job.rb +14 -12
  13. data/app/models/blacklight_api.rb +6 -6
  14. data/app/models/blacklight_api_facets.rb +7 -2
  15. data/app/models/blacklight_api_ids.rb +3 -4
  16. data/app/models/bulk_action.rb +1 -1
  17. data/app/views/admin/document_accesses/destroy_all.html.erb +1 -1
  18. data/app/views/admin/document_downloads/destroy_all.html.erb +1 -1
  19. data/app/views/admin/documents/_form_nav.html.erb +3 -1
  20. data/app/views/admin/documents/_json_file.jbuilder +14 -0
  21. data/app/views/admin/documents/_result_selected_options.html.erb +3 -1
  22. data/app/views/admin/documents/fetch.json_file.jbuilder +9 -0
  23. data/app/views/admin/documents/index.json_file.jbuilder +9 -0
  24. data/app/views/admin/elements/index.html.erb +1 -1
  25. data/app/views/admin/form_elements/index.html.erb +1 -1
  26. data/app/views/admin/shared/_navbar.html.erb +3 -3
  27. data/app/views/admin/shared/_toast.html.erb +1 -1
  28. data/app/views/admin/users/index.html.erb +1 -1
  29. data/config/locales/documents.en.yml +3 -0
  30. data/db/migrate/20230316183001_add_geoblacklight_admin_gem.rb +1 -0
  31. data/db/seeds.rb +0 -1
  32. data/db/seeds_elements.csv +56 -55
  33. data/db/seeds_elements.numbers +0 -0
  34. data/db/seeds_form_elements.csv +65 -64
  35. data/db/seeds_form_elements.numbers +0 -0
  36. data/lib/generators/geoblacklight_admin/config_generator.rb +31 -76
  37. data/lib/generators/geoblacklight_admin/install_generator.rb +1 -9
  38. data/lib/generators/geoblacklight_admin/templates/config/geomg_aardvark_schema.json +12 -6
  39. data/lib/generators/geoblacklight_admin/templates/config/initializers/devise.rb +315 -0
  40. data/lib/generators/geoblacklight_admin/templates/config/initializers/kithe.rb +2 -0
  41. data/lib/generators/geoblacklight_admin/templates/config/initializers/mime_types.rb +15 -0
  42. data/lib/generators/geoblacklight_admin/templates/config/initializers/pagy.rb +2 -0
  43. data/lib/generators/geoblacklight_admin/templates/config/initializers/simple_form.rb +178 -0
  44. data/lib/generators/geoblacklight_admin/templates/config/initializers/simple_form_bootstrap.rb +365 -0
  45. data/lib/generators/geoblacklight_admin/templates/config/settings.yml +74 -22
  46. data/lib/generators/geoblacklight_admin/templates/javascript/controllers/results_controller.js +10 -0
  47. data/lib/generators/geoblacklight_admin/templates/package.json +2 -0
  48. data/lib/generators/geoblacklight_admin/templates/solr/conf/schema.xml +3 -3
  49. data/lib/generators/geoblacklight_admin/views_generator.rb +2 -2
  50. data/lib/geoblacklight_admin/version.rb +1 -1
  51. data/lib/tasks/geoblacklight_admin.rake +6 -6
  52. metadata +24 -17
  53. data/lib/generators/geoblacklight_admin/example_docs_generator.rb +0 -18
  54. /data/{app/views/admin → lib/generators/geoblacklight_admin/templates}/devise/confirmations/new.html.erb +0 -0
  55. /data/{app/views/admin → lib/generators/geoblacklight_admin/templates}/devise/invitations/edit.html.erb +0 -0
  56. /data/{app/views/admin → lib/generators/geoblacklight_admin/templates}/devise/invitations/new.html.erb +0 -0
  57. /data/{app/views/admin → lib/generators/geoblacklight_admin/templates}/devise/mailer/invitation_instructions.html.erb +0 -0
  58. /data/{app/views/admin → lib/generators/geoblacklight_admin/templates}/devise/mailer/invitation_instructions.text.erb +0 -0
  59. /data/{app/views/admin → lib/generators/geoblacklight_admin/templates}/devise/passwords/edit.html.erb +0 -0
  60. /data/{app/views/admin → lib/generators/geoblacklight_admin/templates}/devise/passwords/new.html.erb +0 -0
  61. /data/{app/views/admin → lib/generators/geoblacklight_admin/templates}/devise/registrations/edit.html.erb +0 -0
  62. /data/{app/views/admin → lib/generators/geoblacklight_admin/templates}/devise/registrations/new.html.erb +0 -0
  63. /data/{app/views/admin → lib/generators/geoblacklight_admin/templates}/devise/sessions/new.html.erb +0 -0
  64. /data/{app/views/admin → lib/generators/geoblacklight_admin/templates}/devise/shared/_links.html.erb +0 -0
  65. /data/{app/views/admin → lib/generators/geoblacklight_admin/templates}/devise/unlocks/new.html.erb +0 -0
@@ -0,0 +1,178 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "simple_form"
4
+
5
+ # Uncomment this and change the path if necessary to include your own
6
+ # components.
7
+ # See https://github.com/heartcombo/simple_form#custom-components to know
8
+ # more about custom components.
9
+ # Dir[Rails.root.join('lib/components/**/*.rb')].each { |f| require f }
10
+ #
11
+ # Use this setup block to configure all options available in SimpleForm.
12
+ SimpleForm.setup do |config|
13
+ # Wrappers are used by the form builder to generate a
14
+ # complete input. You can remove any component from the
15
+ # wrapper, change the order or even add your own to the
16
+ # stack. The options given below are used to wrap the
17
+ # whole input.
18
+ config.wrappers :default, class: :input,
19
+ hint_class: :field_with_hint, error_class: :field_with_errors, valid_class: :field_without_errors do |b|
20
+ ## Extensions enabled by default
21
+ # Any of these extensions can be disabled for a
22
+ # given input by passing: `f.input EXTENSION_NAME => false`.
23
+ # You can make any of these extensions optional by
24
+ # renaming `b.use` to `b.optional`.
25
+
26
+ # Determines whether to use HTML5 (:email, :url, ...)
27
+ # and required attributes
28
+ b.use :html5
29
+
30
+ # Calculates placeholders automatically from I18n
31
+ # You can also pass a string as f.input placeholder: "Placeholder"
32
+ b.use :placeholder
33
+
34
+ ## Optional extensions
35
+ # They are disabled unless you pass `f.input EXTENSION_NAME => true`
36
+ # to the input. If so, they will retrieve the values from the model
37
+ # if any exists. If you want to enable any of those
38
+ # extensions by default, you can change `b.optional` to `b.use`.
39
+
40
+ # Calculates maxlength from length validations for string inputs
41
+ # and/or database column lengths
42
+ b.optional :maxlength
43
+
44
+ # Calculate minlength from length validations for string inputs
45
+ b.optional :minlength
46
+
47
+ # Calculates pattern from format validations for string inputs
48
+ b.optional :pattern
49
+
50
+ # Calculates min and max from length validations for numeric inputs
51
+ b.optional :min_max
52
+
53
+ # Calculates readonly automatically from readonly attributes
54
+ b.optional :readonly
55
+
56
+ ## Inputs
57
+ # b.use :input, class: 'input', error_class: 'is-invalid', valid_class: 'is-valid'
58
+ b.use :label_input
59
+ b.use :hint, wrap_with: {tag: :span, class: :hint}
60
+ b.use :error, wrap_with: {tag: :span, class: :error}
61
+
62
+ ## full_messages_for
63
+ # If you want to display the full error message for the attribute, you can
64
+ # use the component :full_error, like:
65
+ #
66
+ # b.use :full_error, wrap_with: { tag: :span, class: :error }
67
+ end
68
+
69
+ # The default wrapper to be used by the FormBuilder.
70
+ config.default_wrapper = :default
71
+
72
+ # Define the way to render check boxes / radio buttons with labels.
73
+ # Defaults to :nested for bootstrap config.
74
+ # inline: input + label
75
+ # nested: label > input
76
+ config.boolean_style = :nested
77
+
78
+ # Default class for buttons
79
+ config.button_class = "btn"
80
+
81
+ # Method used to tidy up errors. Specify any Rails Array method.
82
+ # :first lists the first message for each field.
83
+ # Use :to_sentence to list all errors for each field.
84
+ # config.error_method = :first
85
+
86
+ # Default tag used for error notification helper.
87
+ config.error_notification_tag = :div
88
+
89
+ # CSS class to add for error notification helper.
90
+ config.error_notification_class = "error_notification"
91
+
92
+ # Series of attempts to detect a default label method for collection.
93
+ # config.collection_label_methods = [ :to_label, :name, :title, :to_s ]
94
+
95
+ # Series of attempts to detect a default value method for collection.
96
+ # config.collection_value_methods = [ :id, :to_s ]
97
+
98
+ # You can wrap a collection of radio/check boxes in a pre-defined tag, defaulting to none.
99
+ # config.collection_wrapper_tag = nil
100
+
101
+ # You can define the class to use on all collection wrappers. Defaulting to none.
102
+ # config.collection_wrapper_class = nil
103
+
104
+ # You can wrap each item in a collection of radio/check boxes with a tag,
105
+ # defaulting to :span.
106
+ # config.item_wrapper_tag = :span
107
+
108
+ # You can define a class to use in all item wrappers. Defaulting to none.
109
+ # config.item_wrapper_class = nil
110
+
111
+ # How the label text should be generated altogether with the required text.
112
+ # config.label_text = lambda { |label, required, explicit_label| "#{required} #{label}" }
113
+
114
+ # You can define the class to use on all labels. Default is nil.
115
+ # config.label_class = nil
116
+
117
+ # You can define the default class to be used on forms. Can be overridden
118
+ # with `html: { :class }`. Defaulting to none.
119
+ # config.default_form_class = nil
120
+
121
+ # You can define which elements should obtain additional classes
122
+ # config.generate_additional_classes_for = [:wrapper, :label, :input]
123
+
124
+ # Whether attributes are required by default (or not). Default is true.
125
+ # config.required_by_default = true
126
+
127
+ # Tell browsers whether to use the native HTML5 validations (novalidate form option).
128
+ # These validations are enabled in SimpleForm's internal config but disabled by default
129
+ # in this configuration, which is recommended due to some quirks from different browsers.
130
+ # To stop SimpleForm from generating the novalidate option, enabling the HTML5 validations,
131
+ # change this configuration to true.
132
+ config.browser_validations = false
133
+
134
+ # Custom mappings for input types. This should be a hash containing a regexp
135
+ # to match as key, and the input type that will be used when the field name
136
+ # matches the regexp as value.
137
+ # config.input_mappings = { /count/ => :integer }
138
+
139
+ # Custom wrappers for input types. This should be a hash containing an input
140
+ # type as key and the wrapper that will be used for all inputs with specified type.
141
+ # config.wrapper_mappings = { string: :prepend }
142
+
143
+ # Namespaces where SimpleForm should look for custom input classes that
144
+ # override default inputs.
145
+ # config.custom_inputs_namespaces << "CustomInputs"
146
+
147
+ # Default priority for time_zone inputs.
148
+ # config.time_zone_priority = nil
149
+
150
+ # Default priority for country inputs.
151
+ # config.country_priority = nil
152
+
153
+ # When false, do not use translations for labels.
154
+ # config.translate_labels = true
155
+
156
+ # Automatically discover new inputs in Rails' autoload path.
157
+ # config.inputs_discovery = true
158
+
159
+ # Cache SimpleForm inputs discovery
160
+ # config.cache_discovery = !Rails.env.development?
161
+
162
+ # Default class for inputs
163
+ # config.input_class = nil
164
+
165
+ # Define the default class of the input wrapper of the boolean input.
166
+ config.boolean_label_class = "checkbox"
167
+
168
+ # Defines if the default input wrapper class should be included in radio
169
+ # collection wrappers.
170
+ # config.include_default_input_wrapper_class = true
171
+
172
+ # Defines which i18n scope will be used in Simple Form.
173
+ # config.i18n_scope = 'simple_form'
174
+
175
+ # Defines validation classes to the input_field. By default it's nil.
176
+ # config.input_field_valid_class = 'is-valid'
177
+ # config.input_field_error_class = 'is-invalid'
178
+ end
@@ -0,0 +1,365 @@
1
+ # frozen_string_literal: true
2
+
3
+ # These defaults are defined and maintained by the community at
4
+ # https://github.com/heartcombo/simple_form-bootstrap
5
+ # Please submit feedback, changes and tests only there.
6
+
7
+ # Uncomment this and change the path if necessary to include your own
8
+ # components.
9
+ # See https://github.com/heartcombo/simple_form#custom-components
10
+ # to know more about custom components.
11
+ # Dir[Rails.root.join('lib/components/**/*.rb')].each { |f| require f }
12
+
13
+ # Use this setup block to configure all options available in SimpleForm.
14
+ SimpleForm.setup do |config|
15
+ # Default class for buttons
16
+ config.button_class = "btn"
17
+
18
+ # Define the default class of the input wrapper of the boolean input.
19
+ config.boolean_label_class = "form-check-label"
20
+
21
+ # How the label text should be generated altogether with the required text.
22
+ config.label_text = lambda { |label, required, explicit_label| "#{label} #{required}" }
23
+
24
+ # Define the way to render check boxes / radio buttons with labels.
25
+ config.boolean_style = :inline
26
+
27
+ # You can wrap each item in a collection of radio/check boxes with a tag
28
+ config.item_wrapper_tag = :div
29
+
30
+ # Defines if the default input wrapper class should be included in radio
31
+ # collection wrappers.
32
+ config.include_default_input_wrapper_class = false
33
+
34
+ # CSS class to add for error notification helper.
35
+ config.error_notification_class = "alert alert-danger"
36
+
37
+ # Method used to tidy up errors. Specify any Rails Array method.
38
+ # :first lists the first message for each field.
39
+ # :to_sentence to list all errors for each field.
40
+ config.error_method = :to_sentence
41
+
42
+ # add validation classes to `input_field`
43
+ config.input_field_error_class = "is-invalid"
44
+ config.input_field_valid_class = "is-valid"
45
+
46
+ # vertical forms
47
+ #
48
+ # vertical default_wrapper
49
+ config.wrappers :vertical_form, class: "mb-3" do |b|
50
+ b.use :html5
51
+ b.use :placeholder
52
+ b.optional :maxlength
53
+ b.optional :minlength
54
+ b.optional :pattern
55
+ b.optional :min_max
56
+ b.optional :readonly
57
+ b.use :label, class: "form-label"
58
+ b.use :input, class: "form-control", error_class: "is-invalid", valid_class: "is-valid"
59
+ b.use :full_error, wrap_with: {class: "invalid-feedback"}
60
+ b.use :hint, wrap_with: {class: "form-text"}
61
+ end
62
+
63
+ # vertical input for boolean
64
+ config.wrappers :vertical_boolean, tag: "fieldset", class: "mb-3" do |b|
65
+ b.use :html5
66
+ b.optional :readonly
67
+ b.wrapper :form_check_wrapper, class: "form-check" do |bb|
68
+ bb.use :input, class: "form-check-input", error_class: "is-invalid", valid_class: "is-valid"
69
+ bb.use :label, class: "form-check-label"
70
+ bb.use :full_error, wrap_with: {class: "invalid-feedback"}
71
+ bb.use :hint, wrap_with: {class: "form-text"}
72
+ end
73
+ end
74
+
75
+ # vertical input for radio buttons and check boxes
76
+ config.wrappers :vertical_collection, item_wrapper_class: "form-check", item_label_class: "form-check-label", tag: "fieldset", class: "mb-3" do |b|
77
+ b.use :html5
78
+ b.optional :readonly
79
+ b.wrapper :legend_tag, tag: "legend", class: "col-form-label pt-0" do |ba|
80
+ ba.use :label_text
81
+ end
82
+ b.use :input, class: "form-check-input", error_class: "is-invalid", valid_class: "is-valid"
83
+ b.use :full_error, wrap_with: {class: "invalid-feedback d-block"}
84
+ b.use :hint, wrap_with: {class: "form-text"}
85
+ end
86
+
87
+ # vertical input for inline radio buttons and check boxes
88
+ config.wrappers :vertical_collection_inline, item_wrapper_class: "form-check form-check-inline", item_label_class: "form-check-label", tag: "fieldset", class: "mb-3" do |b|
89
+ b.use :html5
90
+ b.optional :readonly
91
+ b.wrapper :legend_tag, tag: "legend", class: "col-form-label pt-0" do |ba|
92
+ ba.use :label_text
93
+ end
94
+ b.use :input, class: "form-check-input", error_class: "is-invalid", valid_class: "is-valid"
95
+ b.use :full_error, wrap_with: {class: "invalid-feedback d-block"}
96
+ b.use :hint, wrap_with: {class: "form-text"}
97
+ end
98
+
99
+ # vertical file input
100
+ config.wrappers :vertical_file, class: "mb-3" do |b|
101
+ b.use :html5
102
+ b.use :placeholder
103
+ b.optional :maxlength
104
+ b.optional :minlength
105
+ b.optional :readonly
106
+ b.use :label, class: "form-label"
107
+ b.use :input, class: "form-control", error_class: "is-invalid", valid_class: "is-valid"
108
+ b.use :full_error, wrap_with: {class: "invalid-feedback"}
109
+ b.use :hint, wrap_with: {class: "form-text"}
110
+ end
111
+
112
+ # vertical select input
113
+ config.wrappers :vertical_select, class: "mb-3" do |b|
114
+ b.use :html5
115
+ b.optional :readonly
116
+ b.use :label, class: "form-label"
117
+ b.use :input, class: "form-select", error_class: "is-invalid", valid_class: "is-valid"
118
+ b.use :full_error, wrap_with: {class: "invalid-feedback"}
119
+ b.use :hint, wrap_with: {class: "form-text"}
120
+ end
121
+
122
+ # vertical multi select
123
+ config.wrappers :vertical_multi_select, class: "mb-3" do |b|
124
+ b.use :html5
125
+ b.optional :readonly
126
+ b.use :label, class: "form-label"
127
+ b.wrapper class: "d-flex flex-row justify-content-between align-items-center" do |ba|
128
+ ba.use :input, class: "form-select mx-1", error_class: "is-invalid", valid_class: "is-valid"
129
+ end
130
+ b.use :full_error, wrap_with: {class: "invalid-feedback d-block"}
131
+ b.use :hint, wrap_with: {class: "form-text"}
132
+ end
133
+
134
+ # vertical range input
135
+ config.wrappers :vertical_range, class: "mb-3" do |b|
136
+ b.use :html5
137
+ b.use :placeholder
138
+ b.optional :readonly
139
+ b.optional :step
140
+ b.use :label, class: "form-label"
141
+ b.use :input, class: "form-range", error_class: "is-invalid", valid_class: "is-valid"
142
+ b.use :full_error, wrap_with: {class: "invalid-feedback"}
143
+ b.use :hint, wrap_with: {class: "form-text"}
144
+ end
145
+
146
+ # horizontal forms
147
+ #
148
+ # horizontal default_wrapper
149
+ config.wrappers :horizontal_form, class: "row mb-3" do |b|
150
+ b.use :html5
151
+ b.use :placeholder
152
+ b.optional :maxlength
153
+ b.optional :minlength
154
+ b.optional :pattern
155
+ b.optional :min_max
156
+ b.optional :readonly
157
+ b.use :label, class: "col-sm-3 col-form-label"
158
+ b.wrapper :grid_wrapper, class: "col-sm-9" do |ba|
159
+ ba.use :input, class: "form-control", error_class: "is-invalid", valid_class: "is-valid"
160
+ ba.use :full_error, wrap_with: {class: "invalid-feedback"}
161
+ ba.use :hint, wrap_with: {class: "form-text"}
162
+ end
163
+ end
164
+
165
+ # horizontal input for boolean
166
+ config.wrappers :horizontal_boolean, class: "row mb-3" do |b|
167
+ b.use :html5
168
+ b.optional :readonly
169
+ b.wrapper :grid_wrapper, class: "col-sm-9 offset-sm-3" do |wr|
170
+ wr.wrapper :form_check_wrapper, class: "form-check" do |bb|
171
+ bb.use :input, class: "form-check-input", error_class: "is-invalid", valid_class: "is-valid"
172
+ bb.use :label, class: "form-check-label"
173
+ bb.use :full_error, wrap_with: {class: "invalid-feedback"}
174
+ bb.use :hint, wrap_with: {class: "form-text"}
175
+ end
176
+ end
177
+ end
178
+
179
+ # horizontal input for radio buttons and check boxes
180
+ config.wrappers :horizontal_collection, item_wrapper_class: "form-check", item_label_class: "form-check-label", class: "row mb-3" do |b|
181
+ b.use :html5
182
+ b.optional :readonly
183
+ b.use :label, class: "col-sm-3 col-form-label pt-0"
184
+ b.wrapper :grid_wrapper, class: "col-sm-9" do |ba|
185
+ ba.use :input, class: "form-check-input", error_class: "is-invalid", valid_class: "is-valid"
186
+ ba.use :full_error, wrap_with: {class: "invalid-feedback d-block"}
187
+ ba.use :hint, wrap_with: {class: "form-text"}
188
+ end
189
+ end
190
+
191
+ # horizontal input for inline radio buttons and check boxes
192
+ config.wrappers :horizontal_collection_inline, item_wrapper_class: "form-check form-check-inline", item_label_class: "form-check-label", class: "row mb-3" do |b|
193
+ b.use :html5
194
+ b.optional :readonly
195
+ b.use :label, class: "col-sm-3 col-form-label pt-0"
196
+ b.wrapper :grid_wrapper, class: "col-sm-9" do |ba|
197
+ ba.use :input, class: "form-check-input", error_class: "is-invalid", valid_class: "is-valid"
198
+ ba.use :full_error, wrap_with: {class: "invalid-feedback d-block"}
199
+ ba.use :hint, wrap_with: {class: "form-text"}
200
+ end
201
+ end
202
+
203
+ # horizontal file input
204
+ config.wrappers :horizontal_file, class: "row mb-3" do |b|
205
+ b.use :html5
206
+ b.use :placeholder
207
+ b.optional :maxlength
208
+ b.optional :minlength
209
+ b.optional :readonly
210
+ b.use :label, class: "col-sm-3 col-form-label"
211
+ b.wrapper :grid_wrapper, class: "col-sm-9" do |ba|
212
+ ba.use :input, class: "form-control", error_class: "is-invalid", valid_class: "is-valid"
213
+ ba.use :full_error, wrap_with: {class: "invalid-feedback"}
214
+ ba.use :hint, wrap_with: {class: "form-text"}
215
+ end
216
+ end
217
+
218
+ # horizontal select input
219
+ config.wrappers :horizontal_select, class: "row mb-3" do |b|
220
+ b.use :html5
221
+ b.optional :readonly
222
+ b.use :label, class: "col-sm-3 col-form-label"
223
+ b.wrapper :grid_wrapper, class: "col-sm-9" do |ba|
224
+ ba.use :input, class: "form-select", error_class: "is-invalid", valid_class: "is-valid"
225
+ ba.use :full_error, wrap_with: {class: "invalid-feedback"}
226
+ ba.use :hint, wrap_with: {class: "form-text"}
227
+ end
228
+ end
229
+
230
+ # horizontal multi select
231
+ config.wrappers :horizontal_multi_select, class: "row mb-3" do |b|
232
+ b.use :html5
233
+ b.optional :readonly
234
+ b.use :label, class: "col-sm-3 col-form-label"
235
+ b.wrapper :grid_wrapper, class: "col-sm-9" do |ba|
236
+ ba.wrapper class: "d-flex flex-row justify-content-between align-items-center" do |bb|
237
+ bb.use :input, class: "form-select mx-1", error_class: "is-invalid", valid_class: "is-valid"
238
+ end
239
+ ba.use :full_error, wrap_with: {class: "invalid-feedback d-block"}
240
+ ba.use :hint, wrap_with: {class: "form-text"}
241
+ end
242
+ end
243
+
244
+ # horizontal range input
245
+ config.wrappers :horizontal_range, class: "row mb-3" do |b|
246
+ b.use :html5
247
+ b.use :placeholder
248
+ b.optional :readonly
249
+ b.optional :step
250
+ b.use :label, class: "col-sm-3 col-form-label pt-0"
251
+ b.wrapper :grid_wrapper, class: "col-sm-9" do |ba|
252
+ ba.use :input, class: "form-range", error_class: "is-invalid", valid_class: "is-valid"
253
+ ba.use :full_error, wrap_with: {class: "invalid-feedback"}
254
+ ba.use :hint, wrap_with: {class: "form-text"}
255
+ end
256
+ end
257
+
258
+ # inline forms
259
+ #
260
+ # inline default_wrapper
261
+ config.wrappers :inline_form, class: "col-12" do |b|
262
+ b.use :html5
263
+ b.use :placeholder
264
+ b.optional :maxlength
265
+ b.optional :minlength
266
+ b.optional :pattern
267
+ b.optional :min_max
268
+ b.optional :readonly
269
+ b.use :label, class: "visually-hidden"
270
+
271
+ b.use :input, class: "form-control", error_class: "is-invalid", valid_class: "is-valid"
272
+ b.use :error, wrap_with: {class: "invalid-feedback"}
273
+ b.optional :hint, wrap_with: {class: "form-text"}
274
+ end
275
+
276
+ # inline input for boolean
277
+ config.wrappers :inline_boolean, class: "col-12" do |b|
278
+ b.use :html5
279
+ b.optional :readonly
280
+ b.wrapper :form_check_wrapper, class: "form-check" do |bb|
281
+ bb.use :input, class: "form-check-input", error_class: "is-invalid", valid_class: "is-valid"
282
+ bb.use :label, class: "form-check-label"
283
+ bb.use :error, wrap_with: {class: "invalid-feedback"}
284
+ bb.optional :hint, wrap_with: {class: "form-text"}
285
+ end
286
+ end
287
+
288
+ # bootstrap custom forms
289
+ #
290
+ # custom input switch for boolean
291
+ config.wrappers :custom_boolean_switch, class: "mb-3" do |b|
292
+ b.use :html5
293
+ b.optional :readonly
294
+ b.wrapper :form_check_wrapper, tag: "div", class: "form-check form-switch" do |bb|
295
+ bb.use :input, class: "form-check-input", error_class: "is-invalid", valid_class: "is-valid"
296
+ bb.use :label, class: "form-check-label"
297
+ bb.use :full_error, wrap_with: {tag: "div", class: "invalid-feedback"}
298
+ bb.use :hint, wrap_with: {class: "form-text"}
299
+ end
300
+ end
301
+
302
+ # Input Group - custom component
303
+ # see example app and config at https://github.com/heartcombo/simple_form-bootstrap
304
+ config.wrappers :input_group, class: "mb-3" do |b|
305
+ b.use :html5
306
+ b.use :placeholder
307
+ b.optional :maxlength
308
+ b.optional :minlength
309
+ b.optional :pattern
310
+ b.optional :min_max
311
+ b.optional :readonly
312
+ b.use :label, class: "form-label"
313
+ b.wrapper :input_group_tag, class: "input-group" do |ba|
314
+ ba.optional :prepend
315
+ ba.use :input, class: "form-control", error_class: "is-invalid", valid_class: "is-valid"
316
+ ba.optional :append
317
+ ba.use :full_error, wrap_with: {class: "invalid-feedback"}
318
+ end
319
+ b.use :hint, wrap_with: {class: "form-text"}
320
+ end
321
+
322
+ # Floating Labels form
323
+ #
324
+ # floating labels default_wrapper
325
+ config.wrappers :floating_labels_form, class: "form-floating mb-3" do |b|
326
+ b.use :html5
327
+ b.use :placeholder
328
+ b.optional :maxlength
329
+ b.optional :minlength
330
+ b.optional :pattern
331
+ b.optional :min_max
332
+ b.optional :readonly
333
+ b.use :input, class: "form-control", error_class: "is-invalid", valid_class: "is-valid"
334
+ b.use :label
335
+ b.use :full_error, wrap_with: {class: "invalid-feedback"}
336
+ b.use :hint, wrap_with: {class: "form-text"}
337
+ end
338
+
339
+ # custom multi select
340
+ config.wrappers :floating_labels_select, class: "form-floating mb-3" do |b|
341
+ b.use :html5
342
+ b.optional :readonly
343
+ b.use :input, class: "form-select", error_class: "is-invalid", valid_class: "is-valid"
344
+ b.use :label
345
+ b.use :full_error, wrap_with: {class: "invalid-feedback"}
346
+ b.use :hint, wrap_with: {class: "form-text"}
347
+ end
348
+
349
+ # The default wrapper to be used by the FormBuilder.
350
+ config.default_wrapper = :vertical_form
351
+
352
+ # Custom wrappers for input types. This should be a hash containing an input
353
+ # type as key and the wrapper that will be used for all inputs with specified type.
354
+ config.wrapper_mappings = {
355
+ boolean: :vertical_boolean,
356
+ check_boxes: :vertical_collection,
357
+ date: :vertical_multi_select,
358
+ datetime: :vertical_multi_select,
359
+ file: :vertical_file,
360
+ radio_buttons: :vertical_collection,
361
+ range: :vertical_range,
362
+ time: :vertical_multi_select,
363
+ select: :vertical_select
364
+ }
365
+ end
@@ -50,6 +50,7 @@ FIELDS:
50
50
  :DATE_ISSUED: 'dct_issued_s'
51
51
  :DATE_RANGE: 'gbl_dateRange_drsim'
52
52
  :DESCRIPTION: 'dct_description_sm'
53
+ :DISPLAY_NOTE: 'gbl_displayNote_sm'
53
54
  :FORMAT: 'dct_format_s'
54
55
  :FILE_SIZE: 'gbl_fileSize_s'
55
56
  :GEOREFERENCED: 'gbl_georeferenced_b'
@@ -124,54 +125,100 @@ WEBSERVICES_SHOWN:
124
125
  - 'dynamic_map_layer'
125
126
  - 'image_map_layer'
126
127
 
128
+ # Display Notes to display / Non-prefixed default bootstrap class is alert-secondary
129
+ DISPLAY_NOTES_SHOWN:
130
+ danger:
131
+ bootstrap_alert_class: alert-danger
132
+ icon: fire-solid
133
+ note_prefix: "Danger: "
134
+ info:
135
+ bootstrap_alert_class: alert-info
136
+ icon: circle-info-solid
137
+ note_prefix: "Info: "
138
+ tip:
139
+ bootstrap_alert_class: alert-success
140
+ icon: lightbulb-solid
141
+ note_prefix: "Tip: "
142
+ warning:
143
+ bootstrap_alert_class: alert-warning
144
+ icon: triangle-exclamation-solid
145
+ note_prefix: "Warning: "
146
+
127
147
  # Relationships to display
128
148
  RELATIONSHIPS_SHOWN:
129
- MEMBER_OF:
149
+ MEMBER_OF_ANCESTORS:
130
150
  field: pcdm_memberOf_sm
151
+ icon: parent-item
152
+ inverse: :MEMBER_OF_DESCENDANTS
153
+ label: geoblacklight.relations.member_of_ancestors
131
154
  query_type: ancestors
132
- icon: nil
133
- label: geoblacklight.relations.member_of
155
+ MEMBER_OF_DESCENDANTS:
156
+ field: pcdm_memberOf_sm
157
+ icon: child-item
158
+ inverse: :MEMBER_OF_ANCESTORS
159
+ label: geoblacklight.relations.member_of_descendants
160
+ query_type: descendants
134
161
  PART_OF_ANCESTORS:
135
162
  field: dct_isPartOf_sm
136
- query_type: ancestors
137
- icon: nil
163
+ icon: parent-item
164
+ inverse: :PART_OF_DESCENDANTS
138
165
  label: geoblacklight.relations.part_of_ancestors
166
+ query_type: ancestors
139
167
  PART_OF_DESCENDANTS:
140
168
  field: dct_isPartOf_sm
141
- query_type: descendants
142
169
  icon: child-item
170
+ inverse: :PART_OF_ANCESTORS
143
171
  label: geoblacklight.relations.part_of_descendants
144
- RELATION:
172
+ query_type: descendants
173
+ RELATION_ANCESTORS:
145
174
  field: dct_relation_sm
175
+ icon: nil
176
+ inverse: :RELATION_DESCENDANTS
177
+ label: geoblacklight.relations.relation_ancestors
146
178
  query_type: ancestors
179
+ RELATION_DESCENDANTS:
180
+ field: dct_relation_sm
147
181
  icon: nil
148
- label: geoblacklight.relations.relation
149
- REPLACES:
182
+ inverse: :RELATION_ANCESTORS
183
+ label: geoblacklight.relations.relation_descendants
184
+ query_type: descendants
185
+ REPLACES_ANCESTORS:
150
186
  field: dct_replaces_sm
187
+ icon: nil
188
+ inverse: :REPLACES_DESCENDANTS
189
+ label: geoblacklight.relations.replaces_ancestors
151
190
  query_type: ancestors
191
+ REPLACES_DESCENDANTS:
192
+ field: dct_replaces_sm
152
193
  icon: nil
153
- label: geoblacklight.relations.replaces
154
- REPLACED_BY:
155
- field: dct_isReplacedBy_sm
194
+ inverse: :REPLACES_ANCESTORS
195
+ label: geoblacklight.relations.replaces_descendants
156
196
  query_type: descendants
157
- icon: nil
158
- label: geoblacklight.relations.replaced_by
159
197
  SOURCE_ANCESTORS:
160
198
  field: dct_source_sm
161
- query_type: ancestors
162
199
  icon: parent-item
163
- label: geoblacklight.relations.ancestor
200
+ inverse: :SOURCE_DESCENDANTS
201
+ label: geoblacklight.relations.source_ancestors
202
+ query_type: ancestors
164
203
  SOURCE_DESCENDANTS:
165
204
  field: dct_source_sm
166
- query_type: descendants
167
205
  icon: child-item
168
- label: geoblacklight.relations.descendant
169
- VERSION_OF:
206
+ inverse: :SOURCE_ANCESTORS
207
+ label: geoblacklight.relations.source_descendants
208
+ query_type: descendants
209
+ VERSION_OF_ANCESTORS:
170
210
  field: dct_isVersionOf_sm
211
+ icon: parent-item
212
+ inverse: :VERSION_OF_DESCENDANTS
213
+ label: geoblacklight.relations.version_of_ancestors
214
+ query_type: ancestors
215
+ VERSION_OF_DESCENDANTS:
216
+ field: dct_isVersionOf_sm
217
+ icon: child-item
218
+ inverse: :VERSION_OF_ANCESTORS
219
+ label: geoblacklight.relations.version_of_descendants
171
220
  query_type: descendants
172
- icon: nil
173
- label: geoblacklight.relations.version_of
174
-
221
+
175
222
  # WMS Parameters
176
223
  WMS_PARAMS:
177
224
  :SERVICE: 'WMS'
@@ -239,3 +286,8 @@ HELP_TEXT:
239
286
  - 'wms'
240
287
  - 'tms'
241
288
  - 'oembed'
289
+
290
+ # Enable catalog#show sidebar static map for items with the following viewer protocols
291
+ SIDEBAR_STATIC_MAP:
292
+ - 'iiif'
293
+ - 'iiif_manifest'