geoblacklight_admin 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.editorconfig +18 -0
- data/.gitignore +75 -0
- data/.standard.yml +4 -0
- data/Gemfile +59 -0
- data/LICENSE +21 -0
- data/README.md +84 -0
- data/Rakefile +72 -0
- data/app/assets/images/.keep +0 -0
- data/app/assets/images/aerial_photo.jpg +0 -0
- data/app/assets/images/archive-solid.svg +1 -0
- data/app/assets/images/bookmark-regular.svg +1 -0
- data/app/assets/images/bookmark-solid.svg +1 -0
- data/app/assets/images/btaa-logo.jpg +0 -0
- data/app/assets/images/cloud-download-alt-solid.svg +1 -0
- data/app/assets/images/file-import-solid.svg +1 -0
- data/app/assets/images/trash-alt-solid.svg +1 -0
- data/app/assets/javascripts/geoblacklight_admin/chosen.js +4 -0
- data/app/assets/javascripts/geoblacklight_admin/date_range_picker.js +173 -0
- data/app/assets/javascripts/geoblacklight_admin/datepicker.js +22 -0
- data/app/assets/javascripts/geoblacklight_admin/elements.js +38 -0
- data/app/assets/javascripts/geoblacklight_admin/exports.js +3 -0
- data/app/assets/javascripts/geoblacklight_admin/fields.js +11 -0
- data/app/assets/javascripts/geoblacklight_admin/geoblacklight_admin.js +2 -0
- data/app/assets/javascripts/geoblacklight_admin/inputmask.js +4 -0
- data/app/assets/javascripts/geoblacklight_admin/locale.js +5 -0
- data/app/assets/javascripts/geoblacklight_admin/sortable.js +2544 -0
- data/app/assets/javascripts/geoblacklight_admin/tooltips.js +3 -0
- data/app/assets/javascripts/geoblacklight_admin/truncate.js +4 -0
- data/app/assets/javascripts/geoblacklight_admin.js +40 -0
- data/app/assets/stylesheets/geoblacklight_admin/_core.scss +47 -0
- data/app/assets/stylesheets/geoblacklight_admin/modules/_autocomplete.scss +32 -0
- data/app/assets/stylesheets/geoblacklight_admin/modules/_blazer.scss +3 -0
- data/app/assets/stylesheets/geoblacklight_admin/modules/_code.scss +3 -0
- data/app/assets/stylesheets/geoblacklight_admin/modules/_datepicker.scss +477 -0
- data/app/assets/stylesheets/geoblacklight_admin/modules/_elements.scss +3 -0
- data/app/assets/stylesheets/geoblacklight_admin/modules/_forms.scss +28 -0
- data/app/assets/stylesheets/geoblacklight_admin/modules/_icons.scss +15 -0
- data/app/assets/stylesheets/geoblacklight_admin/modules/_nav.scss +9 -0
- data/app/assets/stylesheets/geoblacklight_admin/modules/_tables.scss +4 -0
- data/app/assets/stylesheets/geoblacklight_admin/modules/_toasts.scss +7 -0
- data/app/assets/stylesheets/geoblacklight_admin/modules/_visibility.scss +3 -0
- data/app/assets/stylesheets/geoblacklight_admin/settings/_variables.scss +1 -0
- data/app/channels/export_channel.rb +12 -0
- data/app/controllers/admin/admin_controller.rb +16 -0
- data/app/controllers/admin/advanced_search_controller.rb +365 -0
- data/app/controllers/admin/api_controller.rb +386 -0
- data/app/controllers/admin/bookmarks_controller.rb +68 -0
- data/app/controllers/admin/bulk_actions_controller.rb +94 -0
- data/app/controllers/admin/concerns/.keep +0 -0
- data/app/controllers/admin/concerns/upload_util.rb +8 -0
- data/app/controllers/admin/document_accesses_controller.rb +125 -0
- data/app/controllers/admin/document_assets_controller.rb +198 -0
- data/app/controllers/admin/document_downloads_controller.rb +127 -0
- data/app/controllers/admin/documents_controller.rb +219 -0
- data/app/controllers/admin/elements_controller.rb +81 -0
- data/app/controllers/admin/form_elements_controller.rb +81 -0
- data/app/controllers/admin/ids_controller.rb +379 -0
- data/app/controllers/admin/import_documents_controller.rb +18 -0
- data/app/controllers/admin/imports_controller.rb +105 -0
- data/app/controllers/admin/mappings_controller.rb +95 -0
- data/app/controllers/admin/notifications_controller.rb +51 -0
- data/app/controllers/admin/search_controller.rb +10 -0
- data/app/controllers/admin/users_controller.rb +10 -0
- data/app/helpers/bulk_actions_helper.rb +9 -0
- data/app/helpers/document_helper.rb +60 -0
- data/app/helpers/form_input_helper.rb +73 -0
- data/app/helpers/geoblacklight_admin_helper.rb +118 -0
- data/app/helpers/import_documents_helper.rb +5 -0
- data/app/helpers/mappings_helper.rb +27 -0
- data/app/indexers/document_indexer.rb +34 -0
- data/app/jobs/bulk_action_revert_document_job.rb +49 -0
- data/app/jobs/bulk_action_revert_job.rb +25 -0
- data/app/jobs/bulk_action_run_document_job.rb +42 -0
- data/app/jobs/bulk_action_run_job.rb +27 -0
- data/app/jobs/export_job.rb +72 -0
- data/app/jobs/export_json_job.rb +120 -0
- data/app/jobs/import_document_job.rb +25 -0
- data/app/jobs/import_run_job.rb +33 -0
- data/app/models/active_storage_attachment.rb +5 -0
- data/app/models/active_storage_blob.rb +5 -0
- data/app/models/api_search_builder.rb +12 -0
- data/app/models/application_record.rb +6 -0
- data/app/models/blacklight_api.rb +93 -0
- data/app/models/blacklight_api_facets.rb +15 -0
- data/app/models/blacklight_api_ids.rb +103 -0
- data/app/models/bookmark.rb +17 -0
- data/app/models/bulk_action.rb +88 -0
- data/app/models/bulk_action_document.rb +22 -0
- data/app/models/bulk_action_document_state_machine.rb +16 -0
- data/app/models/bulk_action_document_transition.rb +19 -0
- data/app/models/bulk_action_state_machine.rb +16 -0
- data/app/models/bulk_action_transition.rb +26 -0
- data/app/models/concerns/.keep +0 -0
- data/app/models/document/bbox_validator.rb +70 -0
- data/app/models/document/controlled_lists.rb +104 -0
- data/app/models/document/date_range_validator.rb +63 -0
- data/app/models/document/geom_validator.rb +117 -0
- data/app/models/document/reference.rb +107 -0
- data/app/models/document.rb +264 -0
- data/app/models/document_access.rb +35 -0
- data/app/models/document_download.rb +35 -0
- data/app/models/document_state_machine.rb +14 -0
- data/app/models/document_transition.rb +26 -0
- data/app/models/element.rb +90 -0
- data/app/models/form_control.rb +2 -0
- data/app/models/form_element.rb +19 -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/field_mappings_btaa_aardvark.rb +379 -0
- data/app/models/geoblacklight_admin/field_mappings_gblv1.rb +344 -0
- data/app/models/geoblacklight_admin/iso_language_codes.rb +515 -0
- data/app/models/geoblacklight_admin/schema.rb +194 -0
- data/app/models/geoblacklight_admin.rb +3 -0
- data/app/models/import/csv_duplicates_validator.rb +36 -0
- data/app/models/import/csv_header_validator.rb +24 -0
- data/app/models/import.rb +186 -0
- data/app/models/import_btaa.rb +91 -0
- data/app/models/import_btaa_aardvark.rb +109 -0
- data/app/models/import_document.rb +34 -0
- data/app/models/import_document_state_machine.rb +12 -0
- data/app/models/import_document_transition.rb +19 -0
- data/app/models/import_gblv1.rb +92 -0
- data/app/models/import_state_machine.rb +16 -0
- data/app/models/import_transition.rb +26 -0
- data/app/models/mapping.rb +10 -0
- data/app/models/notification.rb +9 -0
- data/app/models/user.rb +26 -0
- data/app/notifications/export_notification.rb +30 -0
- data/app/services/export_csv_document_access_links_service.rb +47 -0
- data/app/services/export_csv_document_downloads_service.rb +47 -0
- data/app/services/export_csv_service.rb +44 -0
- data/app/services/export_json_service.rb +35 -0
- data/app/services/zip_file_generator.rb +56 -0
- data/app/views/admin/advanced_search/facets.json.jbuilder +80 -0
- data/app/views/admin/advanced_search/index.json.jbuilder +90 -0
- data/app/views/admin/api/_field.json.jbuilder +10 -0
- data/app/views/admin/api/fetch.json.jbuilder +86 -0
- data/app/views/admin/api/index.json.jbuilder +90 -0
- data/app/views/admin/bookmarks/_bookmark.json.jbuilder +4 -0
- data/app/views/admin/bookmarks/create.js.erb +7 -0
- data/app/views/admin/bookmarks/destroy.js.erb +7 -0
- data/app/views/admin/bookmarks/index.html.erb +21 -0
- data/app/views/admin/bookmarks/index.json.jbuilder +3 -0
- data/app/views/admin/bulk_actions/_bulk_action.json.jbuilder +4 -0
- data/app/views/admin/bulk_actions/_form.html.erb +17 -0
- data/app/views/admin/bulk_actions/edit.html.erb +6 -0
- data/app/views/admin/bulk_actions/index.html.erb +54 -0
- data/app/views/admin/bulk_actions/index.json.jbuilder +3 -0
- data/app/views/admin/bulk_actions/new.html.erb +5 -0
- data/app/views/admin/bulk_actions/show.html.erb +100 -0
- data/app/views/admin/bulk_actions/show.json.jbuilder +3 -0
- data/app/views/admin/devise/confirmations/new.html.erb +16 -0
- data/app/views/admin/devise/invitations/edit.html.erb +15 -0
- data/app/views/admin/devise/invitations/new.html.erb +15 -0
- data/app/views/admin/devise/mailer/invitation_instructions.html.erb +11 -0
- data/app/views/admin/devise/mailer/invitation_instructions.text.erb +11 -0
- data/app/views/admin/devise/passwords/edit.html.erb +26 -0
- data/app/views/admin/devise/passwords/new.html.erb +16 -0
- data/app/views/admin/devise/registrations/edit.html.erb +35 -0
- data/app/views/admin/devise/registrations/new.html.erb +30 -0
- data/app/views/admin/devise/sessions/new.html.erb +28 -0
- data/app/views/admin/devise/shared/_links.html.erb +27 -0
- data/app/views/admin/devise/unlocks/new.html.erb +16 -0
- data/app/views/admin/document_accesses/_document_access.json.jbuilder +4 -0
- data/app/views/admin/document_accesses/_form.html.erb +17 -0
- data/app/views/admin/document_accesses/destroy_all.html.erb +70 -0
- data/app/views/admin/document_accesses/edit.html.erb +5 -0
- data/app/views/admin/document_accesses/import.html.erb +70 -0
- data/app/views/admin/document_accesses/index.html.erb +74 -0
- data/app/views/admin/document_accesses/index.json.jbuilder +3 -0
- data/app/views/admin/document_accesses/new.html.erb +6 -0
- data/app/views/admin/document_accesses/show.html.erb +19 -0
- data/app/views/admin/document_accesses/show.json.jbuilder +3 -0
- data/app/views/admin/document_assets/display_attach_form.html.erb +44 -0
- data/app/views/admin/document_assets/index.html.erb +65 -0
- data/app/views/admin/document_downloads/_document_download.json.jbuilder +4 -0
- data/app/views/admin/document_downloads/_form.html.erb +15 -0
- data/app/views/admin/document_downloads/destroy_all.html.erb +70 -0
- data/app/views/admin/document_downloads/edit.html.erb +6 -0
- data/app/views/admin/document_downloads/import.html.erb +74 -0
- data/app/views/admin/document_downloads/index.html.erb +70 -0
- data/app/views/admin/document_downloads/index.json.jbuilder +3 -0
- data/app/views/admin/document_downloads/new.html.erb +5 -0
- data/app/views/admin/document_downloads/show.html.erb +24 -0
- data/app/views/admin/document_downloads/show.json.jbuilder +3 -0
- data/app/views/admin/documents/_document.html.erb +29 -0
- data/app/views/admin/documents/_document_bookmark.html.erb +17 -0
- data/app/views/admin/documents/_document_fields.html.erb +24 -0
- data/app/views/admin/documents/_form.html.erb +49 -0
- data/app/views/admin/documents/_form_control.html.erb +86 -0
- data/app/views/admin/documents/_form_group.html.erb +1 -0
- data/app/views/admin/documents/_form_header.html.erb +1 -0
- data/app/views/admin/documents/_form_nav.html.erb +21 -0
- data/app/views/admin/documents/_json_aardvark.jbuilder +47 -0
- data/app/views/admin/documents/_json_btaa_aardvark.jbuilder +16 -0
- data/app/views/admin/documents/_json_gbl_v1.jbuilder +32 -0
- data/app/views/admin/documents/_result_facets.html.erb +35 -0
- data/app/views/admin/documents/_result_pagination.html.erb +21 -0
- data/app/views/admin/documents/_result_selected_options.html.erb +54 -0
- data/app/views/admin/documents/_result_selection_options.html.erb +10 -0
- data/app/views/admin/documents/_result_toggle.html.erb +13 -0
- data/app/views/admin/documents/edit.html.erb +7 -0
- data/app/views/admin/documents/features/_assets.html.erb +3 -0
- data/app/views/admin/documents/features/_institutional_access_links.html.erb +3 -0
- data/app/views/admin/documents/features/_multiple_download_links.html.erb +27 -0
- data/app/views/admin/documents/fetch.json_aardvark.jbuilder +9 -0
- data/app/views/admin/documents/fetch.json_btaa_aardvark.jbuilder +9 -0
- data/app/views/admin/documents/fetch.json_gbl_v1.jbuilder +9 -0
- data/app/views/admin/documents/index.html.erb +49 -0
- data/app/views/admin/documents/index.json_aardvark.jbuilder +9 -0
- data/app/views/admin/documents/index.json_btaa_aardvark.jbuilder +9 -0
- data/app/views/admin/documents/index.json_gbl_v1.jbuilder +9 -0
- data/app/views/admin/documents/show.json_aardvark.jbuilder +3 -0
- data/app/views/admin/documents/show.json_btaa_aardvark.jbuilder +3 -0
- data/app/views/admin/documents/show.json_gbl_v1.jbuilder +3 -0
- data/app/views/admin/documents/versions.html.erb +110 -0
- data/app/views/admin/elements/_element.json.jbuilder +2 -0
- data/app/views/admin/elements/_form.html.erb +45 -0
- data/app/views/admin/elements/edit.html.erb +6 -0
- data/app/views/admin/elements/index.html.erb +68 -0
- data/app/views/admin/elements/index.json.jbuilder +1 -0
- data/app/views/admin/elements/new.html.erb +5 -0
- data/app/views/admin/elements/show.html.erb +121 -0
- data/app/views/admin/elements/show.json.jbuilder +1 -0
- data/app/views/admin/form_elements/_form.html.erb +46 -0
- data/app/views/admin/form_elements/_form_element.json.jbuilder +2 -0
- data/app/views/admin/form_elements/edit.html.erb +6 -0
- data/app/views/admin/form_elements/index.html.erb +49 -0
- data/app/views/admin/form_elements/index.json.jbuilder +1 -0
- data/app/views/admin/form_elements/new.html.erb +5 -0
- data/app/views/admin/form_elements/show.html.erb +19 -0
- data/app/views/admin/form_elements/show.json.jbuilder +1 -0
- data/app/views/admin/ids/fetch.json.jbuilder +86 -0
- data/app/views/admin/ids/index.json.jbuilder +41 -0
- data/app/views/admin/import_documents/show.html.haml +20 -0
- data/app/views/admin/imports/_form.html.erb +27 -0
- data/app/views/admin/imports/_import.json.jbuilder +4 -0
- data/app/views/admin/imports/_show_failed_tab.html.erb +37 -0
- data/app/views/admin/imports/_show_success_tab.html.erb +31 -0
- data/app/views/admin/imports/edit.html.erb +8 -0
- data/app/views/admin/imports/index.html.erb +56 -0
- data/app/views/admin/imports/index.json.jbuilder +3 -0
- data/app/views/admin/imports/new.html.erb +7 -0
- data/app/views/admin/imports/show.html.erb +123 -0
- data/app/views/admin/imports/show.json.jbuilder +3 -0
- data/app/views/admin/layouts/application.html.erb +30 -0
- data/app/views/admin/layouts/blazer/application.html.erb +23 -0
- data/app/views/admin/layouts/mailer.html.erb +13 -0
- data/app/views/admin/layouts/mailer.text.erb +1 -0
- data/app/views/admin/mappings/_form.html.erb +17 -0
- data/app/views/admin/mappings/_mapping.json.jbuilder +4 -0
- data/app/views/admin/mappings/edit.html.erb +6 -0
- data/app/views/admin/mappings/index.html.erb +37 -0
- data/app/views/admin/mappings/index.json.jbuilder +3 -0
- data/app/views/admin/mappings/new.html.erb +5 -0
- data/app/views/admin/mappings/show.html.erb +27 -0
- data/app/views/admin/mappings/show.json.jbuilder +3 -0
- data/app/views/admin/notifications/_notification.html.haml +31 -0
- data/app/views/admin/notifications/index.html.erb +54 -0
- data/app/views/admin/notifications/update.js.erb +7 -0
- data/app/views/admin/search/index.html.erb +38 -0
- data/app/views/admin/shared/_flash_messages.html.erb +5 -0
- data/app/views/admin/shared/_footer.html.erb +56 -0
- data/app/views/admin/shared/_js_behaviors.html.erb +147 -0
- data/app/views/admin/shared/_navbar.html.erb +78 -0
- data/app/views/admin/shared/_navbar_blazer.html.erb +42 -0
- data/app/views/admin/shared/_schema_timestamp.html.erb +16 -0
- data/app/views/admin/shared/_toast.html.erb +13 -0
- data/app/views/admin/users/index.html.erb +21 -0
- data/config/authorities/formats.yml +25 -0
- data/config/authorities/languages.yml +50 -0
- data/config/authorities/resource_type.yml +82 -0
- data/config/blazer.yml +79 -0
- data/config/gbl_v1_schema.json +118 -0
- data/config/geomg_aardvark_schema.json +211 -0
- data/config/geomg_schema.json +123 -0
- data/config/locales/devise.en.yml +65 -0
- data/config/locales/devise_invitable.en.yml +31 -0
- data/config/locales/documents.en.yml +189 -0
- data/config/locales/en.yml +51 -0
- data/config/locales/geoblacklight.en.yml +178 -0
- data/config/locales/simple_form.en.yml +31 -0
- data/config/routes.rb +162 -0
- data/db/migrate/20230316183001_add_geoblacklight_admin.rb +399 -0
- data/db/seeds.rb +26 -0
- data/db/seeds_elements.csv +56 -0
- data/db/seeds_elements.numbers +0 -0
- data/db/seeds_form_elements.csv +71 -0
- data/db/seeds_form_elements.numbers +0 -0
- data/db/structure.sql +816 -0
- data/geoblacklight_admin.gemspec +67 -0
- data/lib/generators/geoblacklight_admin/config_generator.rb +336 -0
- data/lib/generators/geoblacklight_admin/example_docs_generator.rb +18 -0
- data/lib/generators/geoblacklight_admin/helpers_generator.rb +18 -0
- data/lib/generators/geoblacklight_admin/install_generator.rb +60 -0
- data/lib/generators/geoblacklight_admin/jobs_generator.rb +21 -0
- data/lib/generators/geoblacklight_admin/models_generator.rb +23 -0
- data/lib/generators/geoblacklight_admin/templates/.env.development.example +28 -0
- data/lib/generators/geoblacklight_admin/templates/.solr_wrapper.yml +7 -0
- data/lib/generators/geoblacklight_admin/templates/_user_util_links.html.erb +30 -0
- data/lib/generators/geoblacklight_admin/templates/config/database.yml +18 -0
- data/lib/generators/geoblacklight_admin/templates/config/geomg_aardvark_schema.json +211 -0
- data/lib/generators/geoblacklight_admin/templates/config/initializers/geoblacklight_admin.rb +25 -0
- data/lib/generators/geoblacklight_admin/templates/config/initializers/kithe.rb +31 -0
- data/lib/generators/geoblacklight_admin/templates/config/initializers/pagy.rb +158 -0
- data/lib/generators/geoblacklight_admin/templates/config/initializers/statesman.rb +7 -0
- data/lib/generators/geoblacklight_admin/templates/javascript/channels/consumer.js +6 -0
- data/lib/generators/geoblacklight_admin/templates/javascript/channels/export_channel.js +30 -0
- data/lib/generators/geoblacklight_admin/templates/javascript/channels/index.js +5 -0
- data/lib/generators/geoblacklight_admin/templates/javascript/controllers/application_controller.js +17 -0
- data/lib/generators/geoblacklight_admin/templates/javascript/controllers/document_controller.js +26 -0
- data/lib/generators/geoblacklight_admin/templates/javascript/controllers/index.js +10 -0
- data/lib/generators/geoblacklight_admin/templates/javascript/controllers/results_controller.js +310 -0
- data/lib/generators/geoblacklight_admin/templates/javascript/packs/application.js +23 -0
- data/lib/generators/geoblacklight_admin/templates/javascript/src/js/admin/qa_autocomplete.js +1134 -0
- data/lib/generators/geoblacklight_admin/templates/package.json +32 -0
- data/lib/generators/geoblacklight_admin/templates/solr/README-geoblacklight-solr-development.txt +3 -0
- data/lib/generators/geoblacklight_admin/templates/solr/conf/_rest_managed.json +3 -0
- data/lib/generators/geoblacklight_admin/templates/solr/conf/admin-extra.html +31 -0
- data/lib/generators/geoblacklight_admin/templates/solr/conf/core.properties +5 -0
- data/lib/generators/geoblacklight_admin/templates/solr/conf/elevate.xml +36 -0
- data/lib/generators/geoblacklight_admin/templates/solr/conf/mapping-ISOLatin1Accent.txt +246 -0
- data/lib/generators/geoblacklight_admin/templates/solr/conf/protwords.txt +21 -0
- data/lib/generators/geoblacklight_admin/templates/solr/conf/schema.xml +229 -0
- data/lib/generators/geoblacklight_admin/templates/solr/conf/scripts.conf +24 -0
- data/lib/generators/geoblacklight_admin/templates/solr/conf/solrconfig.xml +266 -0
- data/lib/generators/geoblacklight_admin/templates/solr/conf/spellings.txt +2 -0
- data/lib/generators/geoblacklight_admin/templates/solr/conf/stopwords.txt +58 -0
- data/lib/generators/geoblacklight_admin/templates/solr/conf/stopwords_en.txt +58 -0
- data/lib/generators/geoblacklight_admin/templates/solr/conf/synonyms.txt +43 -0
- data/lib/generators/geoblacklight_admin/templates/solr/conf/xslt/example.xsl +132 -0
- data/lib/generators/geoblacklight_admin/templates/solr/conf/xslt/example_atom.xsl +67 -0
- data/lib/generators/geoblacklight_admin/templates/solr/conf/xslt/example_rss.xsl +66 -0
- data/lib/generators/geoblacklight_admin/templates/solr/conf/xslt/luke.xsl +337 -0
- data/lib/generators/geoblacklight_admin/templates/solr/snapshots/.keep +0 -0
- data/lib/generators/geoblacklight_admin/views_generator.rb +19 -0
- data/lib/geoblacklight_admin/engine.rb +20 -0
- data/lib/geoblacklight_admin/version.rb +5 -0
- data/lib/geoblacklight_admin.rb +7 -0
- data/lib/tasks/.keep +0 -0
- data/lib/tasks/geoblacklight_admin.rake +209 -0
- data/spec/test_app_templates/lib/generators/test_app_generator.rb +35 -0
- data/template.rb +16 -0
- metadata +1037 -0
@@ -0,0 +1,110 @@
|
|
1
|
+
<div class="row flex-xl-nowrap">
|
2
|
+
<main class="col-md-12">
|
3
|
+
<h1 style="width:100%;">
|
4
|
+
Document · Versions
|
5
|
+
</h1>
|
6
|
+
<% if params[:document_id] %>
|
7
|
+
<h2 class='h3'>
|
8
|
+
<%= link_to(@document.title, document_path(@document)) %>
|
9
|
+
·
|
10
|
+
<%= @document.versions.count %> versions
|
11
|
+
</h2>
|
12
|
+
<% end %>
|
13
|
+
<table class='table table-responsive'>
|
14
|
+
<thead>
|
15
|
+
<th>Version</th>
|
16
|
+
<th>Change</th>
|
17
|
+
<th>Time Ago</th>
|
18
|
+
</thead>
|
19
|
+
<tbody>
|
20
|
+
<%- @document.versions.reverse.each_with_index do |version, index| %>
|
21
|
+
<tr>
|
22
|
+
<td>
|
23
|
+
<%= @document.versions.count - index %>
|
24
|
+
</td>
|
25
|
+
<td>
|
26
|
+
<table>
|
27
|
+
<thead>
|
28
|
+
<th>Operator</th>
|
29
|
+
<th>Field</th>
|
30
|
+
<th>Change</th>
|
31
|
+
</thead>
|
32
|
+
<tbody>
|
33
|
+
<%- # Current Document %>
|
34
|
+
<%- if index == 0 %>
|
35
|
+
<%- current = @document.json_attributes %>
|
36
|
+
<%- previous = version.previous.reify&.json_attributes %>
|
37
|
+
<%- diff = Hashdiff.diff(previous,current) %>
|
38
|
+
<%- changeset = version.changeset.except(:json_attributes).collect{ |change| ["+", change[0], change[1][1]] }.flatten %>
|
39
|
+
<%- diff << changeset %>
|
40
|
+
<%- diff.each do |d| %>
|
41
|
+
<%- next if d[0] == '~' %>
|
42
|
+
<tr class="<%= diff_class(d[0]) %>">
|
43
|
+
<td><%= d[0] %></td>
|
44
|
+
<td><%= d[1] %></td>
|
45
|
+
<td>
|
46
|
+
<%= d[2] %> <%= d[3] %>
|
47
|
+
</td>
|
48
|
+
</tr>
|
49
|
+
<%- end %>
|
50
|
+
<%- # Previous Document with another previous one %>
|
51
|
+
<%- elsif version.previous && version.previous.reify %>
|
52
|
+
<%- current = version.reify&.json_attributes %>
|
53
|
+
<%- previous = version.previous.reify&.json_attributes %>
|
54
|
+
<%- diff = Hashdiff.diff(previous,current) %>
|
55
|
+
<%- changeset = version.changeset.except(:json_attributes).collect{ |change| ["+", change[0], change[1][1]] }.flatten %>
|
56
|
+
<%- diff << changeset %>
|
57
|
+
<%- diff.each do |d| %>
|
58
|
+
<%- next if d[0] == '~' %>
|
59
|
+
<tr class="<%= diff_class(d[0]) %>">
|
60
|
+
<td><%= d[0] %></td>
|
61
|
+
<td><%= d[1] %></td>
|
62
|
+
<td>
|
63
|
+
<%- if d[2].kind_of?(Document::Reference) %>
|
64
|
+
<%= d[2].category %>
|
65
|
+
—
|
66
|
+
<%= d[2].value %>
|
67
|
+
<%- else %>
|
68
|
+
<%= d[2] %>
|
69
|
+
<%- end %>
|
70
|
+
<%= d[3] %>
|
71
|
+
</td>
|
72
|
+
</tr>
|
73
|
+
<%- end %>
|
74
|
+
<%- # Very first Document %>
|
75
|
+
<% else %>
|
76
|
+
<%- current = version.changeset %>
|
77
|
+
<%- previous = {} %>
|
78
|
+
<%- diff = Hashdiff.diff(previous,current) %>
|
79
|
+
<%- changeset = version.changeset.except(:json_attributes, :updated_at).collect{ |change| ["+", change[0], change[1][1]] }.flatten %>
|
80
|
+
|
81
|
+
<%- diff.each do |d| %>
|
82
|
+
<%- next if d[0] == '~' %>
|
83
|
+
<%- next if d[2] == [""] %>
|
84
|
+
<%- next if d[2].nil? %>
|
85
|
+
|
86
|
+
<tr class="<%= diff_class(d[0]) %>">
|
87
|
+
<td><%= d[0] %></td>
|
88
|
+
<td><%= d[1] %></td>
|
89
|
+
<td>
|
90
|
+
<%- if d[2].kind_of?(Document::Reference) %>
|
91
|
+
<%= d[2].category %>
|
92
|
+
—
|
93
|
+
<%= d[2].value %>
|
94
|
+
<%- else %>
|
95
|
+
<%= d[2] %>
|
96
|
+
<%- end %>
|
97
|
+
</td>
|
98
|
+
</tr>
|
99
|
+
<%- end %>
|
100
|
+
<%- end %>
|
101
|
+
</tbody>
|
102
|
+
</table>
|
103
|
+
</td>
|
104
|
+
<td><%= time_ago_in_words(version.created_at) %>
|
105
|
+
</tr>
|
106
|
+
<%- end %>
|
107
|
+
</tbody>
|
108
|
+
</table>
|
109
|
+
</main>
|
110
|
+
</div>
|
@@ -0,0 +1,2 @@
|
|
1
|
+
json.extract! element, :id, :label, :solr_field, :field_definition, :field_type, :required, :repeatable, :formable, :placeholder_text, :data_entry_hint, :test_fixture_example, :controlled_vocabulary, :js_behaviors, :html_attributes, :display_only_on_persisted, :importable, :import_deliminated, :import_transformation_method, :exportable, :export_transformation_method, :indexable, :index_transformation_method, :validation_method, :created_at, :updated_at
|
2
|
+
json.url element_url(element, format: :json)
|
@@ -0,0 +1,45 @@
|
|
1
|
+
|
2
|
+
<%= simple_form_for(@element) do |f| %>
|
3
|
+
<%= f.error_notification %>
|
4
|
+
<%= f.error_notification message: f.object.errors[:base].to_sentence if f.object.errors[:base].present? %>
|
5
|
+
|
6
|
+
<div class="form-inputs">
|
7
|
+
<div class="grouping">
|
8
|
+
<h3 id="definition">Definition</h3>
|
9
|
+
<%= f.input :label %>
|
10
|
+
<%= f.input :solr_field %>
|
11
|
+
<%= f.input :field_definition %>
|
12
|
+
<%= f.input :field_type, as: :select, collection: Element::FIELD_TYPES.map { |ft| [ft, ft] }, input_html: { class: "form-control" } %>
|
13
|
+
<%= f.input :required %>
|
14
|
+
<%= f.input :repeatable %>
|
15
|
+
<%= f.input :validation_method %>
|
16
|
+
<div>
|
17
|
+
|
18
|
+
<div class="grouping">
|
19
|
+
<h3 id="form-settings">Form Settings</h3>
|
20
|
+
<%= f.input :formable %>
|
21
|
+
<%= f.input :placeholder_text %>
|
22
|
+
<%= f.input :data_entry_hint %>
|
23
|
+
<%= f.input :test_fixture_example %>
|
24
|
+
<%= f.input :controlled_vocabulary %>
|
25
|
+
<%= f.input :js_behaviors %>
|
26
|
+
<%= f.input :html_attributes, as: :text, input_html: { 'rows' => 5 } %>
|
27
|
+
<%= f.input :display_only_on_persisted %>
|
28
|
+
</div>
|
29
|
+
|
30
|
+
<div class="grouping">
|
31
|
+
<h3 id="propagation">Propagation</h3>
|
32
|
+
<%= f.input :importable %>
|
33
|
+
<%= f.input :import_deliminated %>
|
34
|
+
<%= f.input :import_transformation_method %>
|
35
|
+
<%= f.input :exportable %>
|
36
|
+
<%= f.input :export_transformation_method %>
|
37
|
+
<%= f.input :indexable %>
|
38
|
+
<%= f.input :index_transformation_method %>
|
39
|
+
</div>
|
40
|
+
</div>
|
41
|
+
|
42
|
+
<div class="form-actions">
|
43
|
+
<%= f.button :submit, class: "btn btn-primary" %>
|
44
|
+
</div>
|
45
|
+
<% end %>
|
@@ -0,0 +1,68 @@
|
|
1
|
+
<%- @page_title = "GEOMG - Elements" %>
|
2
|
+
|
3
|
+
<h1 style="width:100%;">
|
4
|
+
Elements
|
5
|
+
<%= link_to '+ New Element', new_admin_element_path, { class: 'btn btn-primary float-right' } %>
|
6
|
+
</h1>
|
7
|
+
|
8
|
+
<p class="alert alert-warning"><strong>Notice</strong> - This table defines the application's metadata schema fields. To add a new field to your <%= link_to 'Document', new_admin_document_path %> form, edit your <%=link_to 'Form Elements', admin_form_elements_path %>.</p>
|
9
|
+
|
10
|
+
<h6>
|
11
|
+
<span class='float-left mt-3'>
|
12
|
+
<%== pagy_info(@pagy, 'elements'.pluralize(@pagy.count)) %>
|
13
|
+
</span>
|
14
|
+
<span class='float-right'>
|
15
|
+
<%== pagy_bootstrap_nav(@pagy) %>
|
16
|
+
</span>
|
17
|
+
</h6>
|
18
|
+
|
19
|
+
<table class="table table-striped table-bordered sortable">
|
20
|
+
<thead class="thead-dark">
|
21
|
+
<tr>
|
22
|
+
<th class="header">Label</th>
|
23
|
+
<th class="header">Solr field</th>
|
24
|
+
<th class="header">Field definition</th>
|
25
|
+
<th class="header">Field type</th>
|
26
|
+
<th class="header">Required</th>
|
27
|
+
<th class="header">Repeatable</th>
|
28
|
+
<th class="header">Reorder</th>
|
29
|
+
<th class="header" colspan="3">Actions</th>
|
30
|
+
</tr>
|
31
|
+
</thead>
|
32
|
+
|
33
|
+
<tbody>
|
34
|
+
<% @elements.each do |element| %>
|
35
|
+
<tr data-id="<%=element.id%>">
|
36
|
+
<td><%= link_to element.label, admin_element_path(element) %></td>
|
37
|
+
<td><%= element.solr_field %></td>
|
38
|
+
<td><%= element.field_definition.present? ? link_to( element.field_definition, element.field_definition) : '' %></td>
|
39
|
+
<td><%= element.field_type %></td>
|
40
|
+
<td><%= element.required %></td>
|
41
|
+
<td><%= element.repeatable %></td>
|
42
|
+
<td class="handle" style="text-align:center">↕</td>
|
43
|
+
<td><%= link_to 'Show', admin_element_path(element) %></td>
|
44
|
+
<td><%= link_to 'Edit', edit_admin_element_path(element) %></td>
|
45
|
+
<td><%= link_to 'Destroy', admin_element_path(element), method: :delete, data: { confirm: 'Are you sure?' } %></td>
|
46
|
+
</tr>
|
47
|
+
<% end %>
|
48
|
+
</tbody>
|
49
|
+
</table>
|
50
|
+
<br>
|
51
|
+
|
52
|
+
<h6>
|
53
|
+
<span class='float-left mt-3'>
|
54
|
+
<%== pagy_info(@pagy, 'elements'.pluralize(@pagy.count)) %>
|
55
|
+
</span>
|
56
|
+
<span class='float-right'>
|
57
|
+
<%== pagy_bootstrap_nav(@pagy) %>
|
58
|
+
</span>
|
59
|
+
</h6>
|
60
|
+
|
61
|
+
<br/>
|
62
|
+
|
63
|
+
<script>
|
64
|
+
GEOMG.SortElements(
|
65
|
+
$("tbody"),
|
66
|
+
"<%= sort_admin_elements_path %>"
|
67
|
+
);
|
68
|
+
</script>
|
@@ -0,0 +1 @@
|
|
1
|
+
json.array! @elements, partial: "elements/element", as: :element
|
@@ -0,0 +1,121 @@
|
|
1
|
+
<%- @page_title = "Element - #{@element.label}" %>
|
2
|
+
|
3
|
+
<h1>Element</h1>
|
4
|
+
|
5
|
+
<div class="row">
|
6
|
+
<div class="col-9">
|
7
|
+
<h2>
|
8
|
+
<%= @element.label %>
|
9
|
+
<%= link_to '~ Edit Element', edit_element_path, { class: 'btn btn-primary float-right' } %>
|
10
|
+
</h2>
|
11
|
+
|
12
|
+
<table class="table table-bordered">
|
13
|
+
<thead class="thead-dark">
|
14
|
+
<tr>
|
15
|
+
<th class="header" style="width:300px;">Attribute</th>
|
16
|
+
<th class="header">Value</th>
|
17
|
+
</tr>
|
18
|
+
</thead>
|
19
|
+
<tr>
|
20
|
+
<th>Label</th>
|
21
|
+
<td><%= @element.label %></td>
|
22
|
+
</tr>
|
23
|
+
<tr>
|
24
|
+
<th>Solr field</th>
|
25
|
+
<td><%= @element.solr_field %></td>
|
26
|
+
</tr>
|
27
|
+
<tr>
|
28
|
+
<th>Field definition</th>
|
29
|
+
<td><%= @element.field_definition.present? ? link_to( @element.field_definition, @element.field_definition) : '' %></td>
|
30
|
+
</tr>
|
31
|
+
<tr>
|
32
|
+
<th>Field type</th>
|
33
|
+
<td><%= @element.field_type %></td>
|
34
|
+
</tr>
|
35
|
+
<tr>
|
36
|
+
<th>Required</th>
|
37
|
+
<td><%= @element.required %></td>
|
38
|
+
</tr>
|
39
|
+
<tr>
|
40
|
+
<th>Repeatable</th>
|
41
|
+
<td><%= @element.repeatable %></td>
|
42
|
+
</tr>
|
43
|
+
<tr>
|
44
|
+
<th>Formable</th>
|
45
|
+
<td><%= @element.formable %></td>
|
46
|
+
</tr>
|
47
|
+
<tr>
|
48
|
+
<th>Placeholder text</th>
|
49
|
+
<td><%= @element.placeholder_text %></td>
|
50
|
+
</tr>
|
51
|
+
<tr>
|
52
|
+
<th>Data entry hint</th>
|
53
|
+
<td><%= @element.data_entry_hint %></td>
|
54
|
+
</tr>
|
55
|
+
<tr>
|
56
|
+
<th>Test fixture example</th>
|
57
|
+
<td><%= @element.test_fixture_example %></td>
|
58
|
+
</tr>
|
59
|
+
<tr>
|
60
|
+
<th>Controlled vocabulary</th>
|
61
|
+
<td><%= @element.controlled_vocabulary %></td>
|
62
|
+
</tr>
|
63
|
+
<tr>
|
64
|
+
<th>JS Behavior</th>
|
65
|
+
<td><%= @element.js_behaviors %></td>
|
66
|
+
</tr>
|
67
|
+
<tr>
|
68
|
+
<th>HTML attributes</th>
|
69
|
+
<td><%= @element.html_attributes %></td>
|
70
|
+
</tr>
|
71
|
+
<tr>
|
72
|
+
<th>Display only on persisted?</th>
|
73
|
+
<td><%= @element.display_only_on_persisted %></td>
|
74
|
+
</tr>
|
75
|
+
<tr>
|
76
|
+
<th>Importable?</th>
|
77
|
+
<td><%= @element.importable %></td>
|
78
|
+
</tr>
|
79
|
+
<tr>
|
80
|
+
<th>Import deliminated?</th>
|
81
|
+
<td><%= @element.import_deliminated %></td>
|
82
|
+
</tr>
|
83
|
+
<tr>
|
84
|
+
<th>Import transformation method</th>
|
85
|
+
<td><%= @element.import_transformation_method %></td>
|
86
|
+
</tr>
|
87
|
+
<tr>
|
88
|
+
<th>Exportable?</th>
|
89
|
+
<td><%= @element.exportable %></td>
|
90
|
+
</tr>
|
91
|
+
<tr>
|
92
|
+
<th>Export transformation method</th>
|
93
|
+
<td><%= @element.export_transformation_method %></td>
|
94
|
+
</tr>
|
95
|
+
<tr>
|
96
|
+
<th>Indexable?</th>
|
97
|
+
<td><%= @element.indexable %></td>
|
98
|
+
</tr>
|
99
|
+
<tr>
|
100
|
+
<th>Index transformation method</th>
|
101
|
+
<td><%= @element.index_transformation_method %></td>
|
102
|
+
</tr>
|
103
|
+
<tr>
|
104
|
+
<th>Validation method</th>
|
105
|
+
<td><%= @element.validation_method %></td>
|
106
|
+
</tr>
|
107
|
+
</table>
|
108
|
+
</div>
|
109
|
+
|
110
|
+
<div class="col-3">
|
111
|
+
<h3><%= link_to "Elements", elements_path %></h3>
|
112
|
+
<%- @elements = Element.all %>
|
113
|
+
<ul>
|
114
|
+
<%- @elements.each do |elm| %>
|
115
|
+
<li><%= link_to_unless_current(elm.label, elm) %></li>
|
116
|
+
<%- end %>
|
117
|
+
</ul>
|
118
|
+
</div>
|
119
|
+
</div>
|
120
|
+
<%= link_to 'Edit', edit_element_path(@element) %> |
|
121
|
+
<%= link_to 'Back', elements_path %>
|
@@ -0,0 +1 @@
|
|
1
|
+
json.partial! "elements/element", element: @element
|
@@ -0,0 +1,46 @@
|
|
1
|
+
<div class="row">
|
2
|
+
<div class="col-6">
|
3
|
+
<%= simple_form_for(@form_element.becomes(FormElement)) do |f| %>
|
4
|
+
<%= f.error_notification %>
|
5
|
+
<%= f.error_notification message: f.object.errors[:base].to_sentence if f.object.errors[:base].present? %>
|
6
|
+
|
7
|
+
<div class="form-inputs">
|
8
|
+
<%= f.input :choose_type do %>
|
9
|
+
<%= f.select :type, [["Control", "FormControl"], ["Header", "FormHeader"], ["Group", "FormGroup"], ["Feature", "FormFeature"]], {}, { class: "form-control", autofocus: true } %>
|
10
|
+
<% end %>
|
11
|
+
|
12
|
+
<%= f.input :element do %>
|
13
|
+
<%= f.select :element_solr_field, Element.all.order(:position => :asc).map{ |e| [e.label, e.solr_field] }, { include_blank: true }, { class: "form-control" } %>
|
14
|
+
<% end %>
|
15
|
+
|
16
|
+
<%= f.input :label %>
|
17
|
+
</div>
|
18
|
+
|
19
|
+
<div class="form-actions">
|
20
|
+
<%= f.button :submit, class: "btn btn-primary" %>
|
21
|
+
</div>
|
22
|
+
<% end %>
|
23
|
+
</div>
|
24
|
+
<div class="col-6">
|
25
|
+
<h3>Field Definitions</h3>
|
26
|
+
<dl>
|
27
|
+
<dt>Choose type</dd>
|
28
|
+
<dd>
|
29
|
+
<dl class="ml-3">
|
30
|
+
<dt>Control</dt>
|
31
|
+
<dd>A field on the Document data entry form.</dd>
|
32
|
+
<dt>Header</dt>
|
33
|
+
<dd>A top-level heading on the Document data entry form.</dd>
|
34
|
+
<dt>Group</dt>
|
35
|
+
<dd>A group heading on the Document data entry form.</dd>
|
36
|
+
<dt>Feature</dt>
|
37
|
+
<dd>References a related data-collection feature.</dd>
|
38
|
+
</dl>
|
39
|
+
</dd>
|
40
|
+
<dt>Element</dt>
|
41
|
+
<dd>If adding a Control, choose the associated Element.</dd>
|
42
|
+
<dt>Label</dt>
|
43
|
+
<dd>If adding a Header or Group or Feature, set a text value.</dd>
|
44
|
+
</dl>
|
45
|
+
</div>
|
46
|
+
</div>
|
@@ -0,0 +1,49 @@
|
|
1
|
+
<%- @page_title = "GEOMG - Form Elements" %>
|
2
|
+
|
3
|
+
<h1 style="width:100%;">
|
4
|
+
Form Elements
|
5
|
+
<%= link_to '+ New Form Element', new_admin_form_element_path, { class: 'btn btn-primary float-right' } %>
|
6
|
+
</h1>
|
7
|
+
|
8
|
+
<p class="alert alert-warning"><strong>Notice</strong> - This table defines the headings and fields on the <%= link_to 'Document', new_admin_document_path %> form. To add a new field to your metadata schema, define an <%= link_to 'Element', admin_elements_path %>.</p>
|
9
|
+
|
10
|
+
<table class="table table-striped table-bordered sortable">
|
11
|
+
<thead class="thead-dark">
|
12
|
+
<tr>
|
13
|
+
<th class="header">Type</th>
|
14
|
+
<th class="header">Label</th>
|
15
|
+
<th class="header">Element</th>
|
16
|
+
<th class="header">Reorder</th>
|
17
|
+
<th class="header" colspan="3"></th>
|
18
|
+
</tr>
|
19
|
+
</thead>
|
20
|
+
|
21
|
+
<tbody>
|
22
|
+
<% @form_elements.order(:position => :asc).each do |form_element| %>
|
23
|
+
<tr data-id="<%=form_element.id%>">
|
24
|
+
<td><%= form_element.type %></td>
|
25
|
+
<td><%= form_element.label %></td>
|
26
|
+
<td>
|
27
|
+
<%- if form_element.element_solr_field.present? %>
|
28
|
+
<%= Element.find_by(solr_field: form_element.element_solr_field)&.label %>
|
29
|
+
<%- end %>
|
30
|
+
</td>
|
31
|
+
<td class="handle" style="text-align:center">↕</td>
|
32
|
+
<td><%= link_to 'Show', admin_form_element_path(form_element) %></td>
|
33
|
+
<td><%= link_to 'Edit', edit_admin_form_element_path(form_element) %></td>
|
34
|
+
<td><%= link_to 'Destroy', admin_form_element_path(form_element), method: :delete, data: { confirm: 'Are you sure?' } %></td>
|
35
|
+
</tr>
|
36
|
+
<% end %>
|
37
|
+
</tbody>
|
38
|
+
</table>
|
39
|
+
|
40
|
+
<br>
|
41
|
+
|
42
|
+
<%= link_to '+ New Form Element', new_admin_form_element_path, { class: 'btn btn-primary' } %>
|
43
|
+
|
44
|
+
<script>
|
45
|
+
GEOMG.SortElements(
|
46
|
+
$("tbody"),
|
47
|
+
"<%= sort_admin_form_elements_path %>"
|
48
|
+
);
|
49
|
+
</script>
|
@@ -0,0 +1 @@
|
|
1
|
+
json.array! @form_elements, partial: "form_elements/form_element", as: :form_element
|
@@ -0,0 +1,19 @@
|
|
1
|
+
<p id="notice"><%= notice %></p>
|
2
|
+
|
3
|
+
<p>
|
4
|
+
<strong>Type:</strong>
|
5
|
+
<%= @form_element.type %>
|
6
|
+
</p>
|
7
|
+
|
8
|
+
<p>
|
9
|
+
<strong>Label:</strong>
|
10
|
+
<%= @form_element.label %>
|
11
|
+
</p>
|
12
|
+
|
13
|
+
<p>
|
14
|
+
<strong>Element:</strong>
|
15
|
+
<%= @form_element.element_solr_field %>
|
16
|
+
</p>
|
17
|
+
|
18
|
+
<%= link_to 'Edit', edit_form_element_path(@form_element) %> |
|
19
|
+
<%= link_to 'Back', form_elements_path %>
|
@@ -0,0 +1 @@
|
|
1
|
+
json.partial! "form_elements/form_element", form_element: @form_element
|
@@ -0,0 +1,86 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
json.links do
|
3
|
+
json.self url_for(search_state.to_h.merge(only_path: false))
|
4
|
+
json.prev url_for(search_state.to_h.merge(only_path: false, page: @response.prev_page.to_s)) if @response.prev_page
|
5
|
+
json.next url_for(search_state.to_h.merge(only_path: false, page: @response.next_page.to_s)) if @response.next_page
|
6
|
+
json.last url_for(search_state.to_h.merge(only_path: false, page: @response.total_pages.to_s))
|
7
|
+
end
|
8
|
+
|
9
|
+
json.meta do
|
10
|
+
json.pages @presenter.pagination_info
|
11
|
+
end
|
12
|
+
|
13
|
+
json.data do
|
14
|
+
json.array! @presenter.documents do |document|
|
15
|
+
document_url = polymorphic_url(url_for_document(document))
|
16
|
+
json.id document.id
|
17
|
+
json.type document[blacklight_config.view_config(:index).display_type_field]
|
18
|
+
json.attributes do
|
19
|
+
doc_presenter = index_presenter(document)
|
20
|
+
|
21
|
+
doc_presenter.fields_to_render.each do |field_name, field|
|
22
|
+
json.partial! 'field', field: field,
|
23
|
+
field_name: field_name,
|
24
|
+
document_url: document_url,
|
25
|
+
doc_presenter: doc_presenter
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
json.links do
|
30
|
+
json.self document_url
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
json.included do
|
36
|
+
json.array! @presenter.search_facets do |facet|
|
37
|
+
json.type 'facet'
|
38
|
+
json.id facet.name
|
39
|
+
json.attributes do
|
40
|
+
facet_config = facet_configuration_for_field(facet.name)
|
41
|
+
json.label facet_field_label(facet_config.key)
|
42
|
+
json.items do
|
43
|
+
json.array! facet.items do |item|
|
44
|
+
json.id
|
45
|
+
json.attributes do
|
46
|
+
json.label item.label
|
47
|
+
json.value item.value
|
48
|
+
json.hits item.hits
|
49
|
+
end
|
50
|
+
json.links do
|
51
|
+
if facet_in_params?(facet.name, item.value)
|
52
|
+
json.remove search_action_path(search_state.remove_facet_params(facet.name, item.value))
|
53
|
+
else
|
54
|
+
json.self path_for_facet(facet.name, item.value, only_path: false)
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
json.links do
|
61
|
+
json.self search_facet_path(id: facet.name, only_path: false)
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
json.array! search_fields do |(label, key)|
|
66
|
+
json.type 'search_field'
|
67
|
+
json.id key
|
68
|
+
json.attributes do
|
69
|
+
json.label label
|
70
|
+
end
|
71
|
+
json.links do
|
72
|
+
json.self url_for(search_state.to_h.merge(search_field: key, only_path: false))
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
76
|
+
json.array! active_sort_fields do |key, field|
|
77
|
+
json.type 'sort'
|
78
|
+
json.id key
|
79
|
+
json.attributes do
|
80
|
+
json.label field.label
|
81
|
+
end
|
82
|
+
json.links do
|
83
|
+
json.self url_for(search_state.to_h.merge(sort: key, only_path: false))
|
84
|
+
end
|
85
|
+
end
|
86
|
+
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
json.links do
|
3
|
+
json.self url_for(search_state.to_h.merge(only_path: false))
|
4
|
+
json.prev url_for(search_state.to_h.merge(only_path: false, page: @response.prev_page.to_s)) if @response.prev_page
|
5
|
+
json.next url_for(search_state.to_h.merge(only_path: false, page: @response.next_page.to_s)) if @response.next_page
|
6
|
+
json.last url_for(search_state.to_h.merge(only_path: false, page: @response.total_pages.to_s))
|
7
|
+
end
|
8
|
+
|
9
|
+
json.meta do
|
10
|
+
json.pages @presenter.pagination_info
|
11
|
+
end
|
12
|
+
|
13
|
+
json.data do
|
14
|
+
json.array! @presenter.documents do |document|
|
15
|
+
json.id document.id
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
json.included do
|
20
|
+
json.array! search_fields do |(label, key)|
|
21
|
+
json.type 'search_field'
|
22
|
+
json.id key
|
23
|
+
json.attributes do
|
24
|
+
json.label label
|
25
|
+
end
|
26
|
+
json.links do
|
27
|
+
json.self url_for(search_state.to_h.merge(search_field: key, only_path: false))
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
json.array! active_sort_fields do |key, field|
|
32
|
+
json.type 'sort'
|
33
|
+
json.id key
|
34
|
+
json.attributes do
|
35
|
+
json.label field.label
|
36
|
+
end
|
37
|
+
json.links do
|
38
|
+
json.self url_for(search_state.to_h.merge(sort: key, only_path: false))
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
%p
|
2
|
+
= link_to('Return to Import', import_path(@import_document.import_id))
|
3
|
+
|
4
|
+
%h1 ImportDocument
|
5
|
+
%p Raw CSV mapped to GEOMG ImportDocument
|
6
|
+
|
7
|
+
%hr
|
8
|
+
|
9
|
+
%h3=@import_document.title
|
10
|
+
%p
|
11
|
+
%span
|
12
|
+
= @import_document.state_machine.current_state
|
13
|
+
|
14
|
+
- if @import_document.state_machine.current_state == 'failed'
|
15
|
+
%p
|
16
|
+
%span
|
17
|
+
= @import_document.state_machine.last_transition.metadata
|
18
|
+
|
19
|
+
%div.import-document
|
20
|
+
!= ap(@import_document.json_attributes, { html: true })
|