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,27 @@
|
|
1
|
+
<% if @import.errors.any? %>
|
2
|
+
<div class="alert alert-danger mb-4" role="alert">
|
3
|
+
<h2 class="h4" class="alert-heading"><%= pluralize(@import.errors.count, "error") %> prohibited this import from being saved</h2>
|
4
|
+
<ol class="mb-0">
|
5
|
+
<% @import.errors.full_messages.each do |msg| %>
|
6
|
+
<li><%= msg %></li>
|
7
|
+
<% end %>
|
8
|
+
</ol>
|
9
|
+
</div>
|
10
|
+
<% end %>
|
11
|
+
|
12
|
+
<div class="form-inputs">
|
13
|
+
<%= f.input :name, {autofocus: true} %>
|
14
|
+
<%= f.input :source %>
|
15
|
+
<%= f.input :description %>
|
16
|
+
<%= f.file_field :csv_file, direct_upload: true %>
|
17
|
+
<%= f.input :type, collection:[
|
18
|
+
['BTAA CSV', 'ImportBtaa'],
|
19
|
+
['Solr BTAA Aardvark CSV', 'ImportBtaaAardvark'],
|
20
|
+
['Solr GBLv1 CSV', 'ImportGblv1']
|
21
|
+
]
|
22
|
+
%>
|
23
|
+
</div>
|
24
|
+
|
25
|
+
<div class="form-actions">
|
26
|
+
<%= f.button :submit, {class: 'btn btn-primary'} %>
|
27
|
+
</div>
|
@@ -0,0 +1,37 @@
|
|
1
|
+
<h6>
|
2
|
+
<span class='float-left mt-3'>
|
3
|
+
<%== pagy_info(@pagy_failed, 'failed documents'.pluralize(@pagy_failed.count)) %>
|
4
|
+
</span>
|
5
|
+
<span class='float-right'>
|
6
|
+
<%== pagy_bootstrap_nav(@pagy_failed) %>
|
7
|
+
</span>
|
8
|
+
</h6>
|
9
|
+
|
10
|
+
<table class="table table-striped">
|
11
|
+
<thead>
|
12
|
+
<tr>
|
13
|
+
<th>State</th>
|
14
|
+
<th>Title</th>
|
15
|
+
<th>Identifier</th>
|
16
|
+
<th>Reason</th>
|
17
|
+
</tr>
|
18
|
+
</thead>
|
19
|
+
<tbody>
|
20
|
+
<% @import_failed_documents.each_with_index do |doc, index| %>
|
21
|
+
<tr>
|
22
|
+
<td>
|
23
|
+
<span class="badge badge-danger">
|
24
|
+
<%= doc.state_machine.current_state %>
|
25
|
+
</span>
|
26
|
+
</td>
|
27
|
+
<td><%= doc.title %></td>
|
28
|
+
<td><%= doc.friendlier_id %></td>
|
29
|
+
<td>
|
30
|
+
<%= link_to import_import_document_path(@import, doc) do %>
|
31
|
+
<%= doc.state_machine&.last_transition&.metadata %>
|
32
|
+
<% end %>
|
33
|
+
</td>
|
34
|
+
</tr>
|
35
|
+
<% end %>
|
36
|
+
</tbody>
|
37
|
+
</table>
|
@@ -0,0 +1,31 @@
|
|
1
|
+
<h6>
|
2
|
+
<span class='float-left mt-3'>
|
3
|
+
<%== pagy_info(@pagy_success, 'successful documents'.pluralize(@pagy_success.count)) %>
|
4
|
+
</span>
|
5
|
+
<span class='float-right'>
|
6
|
+
<%== pagy_bootstrap_nav(@pagy_success) %>
|
7
|
+
</span>
|
8
|
+
</h6>
|
9
|
+
|
10
|
+
<table class="table table-striped">
|
11
|
+
<thead>
|
12
|
+
<tr>
|
13
|
+
<th>State</th>
|
14
|
+
<th>Title</th>
|
15
|
+
<th>Identifier</th>
|
16
|
+
</tr>
|
17
|
+
</thead>
|
18
|
+
<tbody>
|
19
|
+
<% @import_success_documents.each_with_index do |doc, index| %>
|
20
|
+
<tr>
|
21
|
+
<td>
|
22
|
+
<span class="badge badge-success">
|
23
|
+
<%= doc.state_machine.current_state %>
|
24
|
+
</span>
|
25
|
+
</td>
|
26
|
+
<td><%= doc.title %></td>
|
27
|
+
<td><%= doc.friendlier_id %></td>
|
28
|
+
</tr>
|
29
|
+
<% end %>
|
30
|
+
</tbody>
|
31
|
+
</table>
|
@@ -0,0 +1,56 @@
|
|
1
|
+
<%- @page_title = "GEOMG - Imports" %>
|
2
|
+
|
3
|
+
<h1 style="width:100%;">
|
4
|
+
Imports
|
5
|
+
<%= link_to '+ New Import', new_admin_import_path, { class: 'btn btn-primary float-right' } %>
|
6
|
+
</h1>
|
7
|
+
|
8
|
+
<h6>
|
9
|
+
<span class='float-left mt-3'>
|
10
|
+
<%== pagy_info(@pagy, 'imports'.pluralize(@pagy.count)) %>
|
11
|
+
</span>
|
12
|
+
<span class='float-right'>
|
13
|
+
<%== pagy_bootstrap_nav(@pagy) %>
|
14
|
+
</span>
|
15
|
+
</h6>
|
16
|
+
|
17
|
+
<table class="table table-striped table-bordered sortable">
|
18
|
+
<thead class="thead-dark">
|
19
|
+
<tr>
|
20
|
+
<th class="header">Name</th>
|
21
|
+
<th class="header">Filename</th>
|
22
|
+
<th class="header">Source</th>
|
23
|
+
<th class="header">Description</th>
|
24
|
+
<th class="header">Row count</th>
|
25
|
+
<th class="header">Date</th>
|
26
|
+
<th class="header" colspan="3"></th>
|
27
|
+
</tr>
|
28
|
+
</thead>
|
29
|
+
|
30
|
+
<tbody>
|
31
|
+
<% @imports.each do |import| %>
|
32
|
+
<tr>
|
33
|
+
<td><%= import.name %></td>
|
34
|
+
<td><%= import.filename %></td>
|
35
|
+
<td><%= import.source %></td>
|
36
|
+
<td><%= import.description %></td>
|
37
|
+
<td><%= import.row_count %></td>
|
38
|
+
<td><%= import.created_at %></td>
|
39
|
+
<td><%= link_to 'Show', admin_import_path(import) %></td>
|
40
|
+
<td><%= link_to 'Edit', edit_admin_import_path(import) %></td>
|
41
|
+
<td><%= link_to 'Destroy', admin_import_path(import), method: :delete, data: { confirm: 'Are you sure?' } %></td>
|
42
|
+
</tr>
|
43
|
+
<% end %>
|
44
|
+
</tbody>
|
45
|
+
</table>
|
46
|
+
|
47
|
+
<h6>
|
48
|
+
<span class='float-left mt-3'>
|
49
|
+
<%== pagy_info(@pagy, 'imports'.pluralize(@pagy.count)) %>
|
50
|
+
</span>
|
51
|
+
<span class='float-right'>
|
52
|
+
<%== pagy_bootstrap_nav(@pagy) %>
|
53
|
+
</span>
|
54
|
+
</h6>
|
55
|
+
|
56
|
+
<br/>
|
@@ -0,0 +1,123 @@
|
|
1
|
+
<%= link_to 'Edit Import', edit_admin_import_path(@import) %> |
|
2
|
+
<%= link_to 'Back', admin_imports_path %>
|
3
|
+
|
4
|
+
<div class="row">
|
5
|
+
<div class="col-md-6">
|
6
|
+
<h1>Import</h1>
|
7
|
+
<p>
|
8
|
+
<strong>Name:</strong>
|
9
|
+
<%= @import.name %>
|
10
|
+
</p>
|
11
|
+
|
12
|
+
<p>
|
13
|
+
<strong>Filename:</strong>
|
14
|
+
<a href="<%= rails_blob_path(@import.csv_file, disposition: "attachment")%>">
|
15
|
+
<%= @import.filename %>
|
16
|
+
</a> (<%= @import.content_type %>)
|
17
|
+
</p>
|
18
|
+
|
19
|
+
<p>
|
20
|
+
<strong>State:</strong>
|
21
|
+
<%= @import.state_machine.current_state %>
|
22
|
+
</p>
|
23
|
+
|
24
|
+
<p>
|
25
|
+
<strong>Source:</strong>
|
26
|
+
<%= @import.source %>
|
27
|
+
</p>
|
28
|
+
|
29
|
+
<p>
|
30
|
+
<strong>Description:</strong>
|
31
|
+
<%= @import.description %>
|
32
|
+
</p>
|
33
|
+
</div>
|
34
|
+
<div class="col-md-3">
|
35
|
+
<div class="card">
|
36
|
+
<div class="card-header text-center">
|
37
|
+
<h3 class="h5">CSV Row Count</h3>
|
38
|
+
</div>
|
39
|
+
<ul class="list-group list-group-flush">
|
40
|
+
<li class="list-group-item text-center">
|
41
|
+
<%= @import.row_count %>
|
42
|
+
</li>
|
43
|
+
</ul>
|
44
|
+
</div>
|
45
|
+
</div>
|
46
|
+
|
47
|
+
<div class="col-md-3">
|
48
|
+
<div class="card">
|
49
|
+
<div class="card-header text-center">
|
50
|
+
<h3 class="h5">Imported Documents</h3>
|
51
|
+
</div>
|
52
|
+
<ul class="list-group list-group-flush">
|
53
|
+
<li class="list-group-item text-center">
|
54
|
+
<% if @import.state_machine.current_state == 'mapped' %>
|
55
|
+
<%= form_tag run_admin_import_path(@import), method: :patch do -%>
|
56
|
+
<%= hidden_field_tag :run, true -%>
|
57
|
+
<%= submit_tag 'Run Import' -%>
|
58
|
+
<%- end -%>
|
59
|
+
<% end %>
|
60
|
+
<% if @import.state_machine.current_state == 'imported' %>
|
61
|
+
<%= @import.documents.size %>
|
62
|
+
<% end %>
|
63
|
+
</li>
|
64
|
+
</ul>
|
65
|
+
</div>
|
66
|
+
</div>
|
67
|
+
</div>
|
68
|
+
|
69
|
+
<nav>
|
70
|
+
<div class="nav nav-tabs" id="import-tabs" role="tablist">
|
71
|
+
<a class="nav-item nav-link <%=@import.state_machine.current_state == 'mapped' ? 'active' : '' %>" id="data-mapping-tab" data-toggle="tab" href="#data-mapping" role="tab" aria-controls="data-mapping" aria-selected="true">Data Mapping</a>
|
72
|
+
<a class="nav-item nav-link <%= @import.state_machine.current_state == 'imported' ? 'active' : '' %>" id="import-results-tab" data-toggle="tab" href="#import-results" role="tab" aria-controls="import-results"
|
73
|
+
aria-selected="false">Import Results</a>
|
74
|
+
</div>
|
75
|
+
</nav>
|
76
|
+
|
77
|
+
<div class="tab-content" id="import-content">
|
78
|
+
<div class="tab-pane fade <%=@import.state_machine.current_state == 'mapped' ? 'show active' : '' %>" id="data-mapping" role="tabpanel" aria-labelledby="data-mapping-tab">
|
79
|
+
<h3 class="sr-only">Data Mapping</h3>
|
80
|
+
<table class="table table-striped">
|
81
|
+
<thead>
|
82
|
+
<tr>
|
83
|
+
<th>CSV Header</th>
|
84
|
+
<th>Solr Field Destination</th>
|
85
|
+
<th>Delimited?</th>
|
86
|
+
</tr>
|
87
|
+
</thead>
|
88
|
+
<tbody>
|
89
|
+
<%- @import.mappings.each do |mapping| %>
|
90
|
+
<tr>
|
91
|
+
<td><%= mapping.source_header %></td>
|
92
|
+
<td><%= mapping.destination_field %></td>
|
93
|
+
<td><%= mapping.delimited %></td>
|
94
|
+
</tr>
|
95
|
+
<% end %>
|
96
|
+
</tbody>
|
97
|
+
</table>
|
98
|
+
</div>
|
99
|
+
|
100
|
+
<div class="tab-pane fade <%= @import.state_machine.current_state == 'imported' ? 'show active' : '' %>" id="import-results" role="tabpanel" aria-labelledby="import-results-tab">
|
101
|
+
<h3 class="sr-only">Import Results</h3>
|
102
|
+
|
103
|
+
<br/>
|
104
|
+
|
105
|
+
<nav>
|
106
|
+
<div class="nav nav-tabs" id="import-state-tabs" role="tablist">
|
107
|
+
<a class="nav-item nav-link active" id="import-failed-tab" data-toggle="tab" href="#import-state-failed" role="tab" aria-controls="import-state-failed" aria-selected="true">Failed</a>
|
108
|
+
<a class="nav-item nav-link" id="import-success-tab" data-toggle="tab" href="#import-state-success" role="tab" aria-controls="import-state-success"
|
109
|
+
aria-selected="false">Success</a>
|
110
|
+
</div>
|
111
|
+
</nav>
|
112
|
+
|
113
|
+
<div class="tab-content" id="import-states">
|
114
|
+
<div class="tab-pane fade show active" id="import-state-failed" role="tabpanel" aria-labelledby="import-state-failed-tab">
|
115
|
+
<%= render partial: 'show_failed_tab' %>
|
116
|
+
</div>
|
117
|
+
|
118
|
+
<div class="tab-pane fade" id="import-state-success" role="tabpanel" aria-labelledby="import-state-success-tab">
|
119
|
+
<%= render partial: 'show_success_tab' %>
|
120
|
+
</div>
|
121
|
+
</div>
|
122
|
+
</div>
|
123
|
+
</div>
|
@@ -0,0 +1,30 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title><%= @page_title || 'GBL Admin' %></title>
|
5
|
+
<%= csrf_meta_tags %>
|
6
|
+
<%= csp_meta_tag %>
|
7
|
+
|
8
|
+
<%= stylesheet_link_tag 'application', media: 'all' %>
|
9
|
+
<%= javascript_include_tag "geoblacklight_admin" %>
|
10
|
+
<%= javascript_pack_tag 'application' %>
|
11
|
+
|
12
|
+
<script src="https://unpkg.com/@popperjs/core@2"></script>
|
13
|
+
<script type="text/javascript" src="https://cdn.jsdelivr.net/momentjs/latest/moment.min.js"></script>
|
14
|
+
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/daterangepicker/daterangepicker.min.js"></script>
|
15
|
+
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/daterangepicker/daterangepicker.css" />
|
16
|
+
<link rel="stylesheet" type="text/css" href="https://releases.transloadit.com/uppy/v3.6.1/uppy.min.css">
|
17
|
+
</head>
|
18
|
+
|
19
|
+
<body data-locale="en">
|
20
|
+
<%= render "admin/shared/navbar" %>
|
21
|
+
<div class="container-fluid">
|
22
|
+
<%= render "admin/shared/schema_timestamp" %>
|
23
|
+
<%= render "admin/shared/flash_messages" %>
|
24
|
+
<div id="toast-wrapper" aria-live="polite" aria-atomic="true"></div>
|
25
|
+
<%= yield %>
|
26
|
+
</div>
|
27
|
+
<%= render "admin/shared/footer" %>
|
28
|
+
<%= render "admin/shared/js_behaviors" %>
|
29
|
+
</body>
|
30
|
+
</html>
|
@@ -0,0 +1,23 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title><%= blazer_title ? blazer_title : "GEOMG - Blazer" %></title>
|
5
|
+
|
6
|
+
<meta charset="utf-8" />
|
7
|
+
<script src="https://unpkg.com/@popperjs/core@2"></script>
|
8
|
+
<%= stylesheet_link_tag "blazer/application" %>
|
9
|
+
<%= stylesheet_link_tag 'application', media: 'all' %>
|
10
|
+
<%= javascript_include_tag "blazer/application" %>
|
11
|
+
<script>
|
12
|
+
<%= blazer_js_var "rootPath", root_path %>
|
13
|
+
</script>
|
14
|
+
<%= csrf_meta_tags %>
|
15
|
+
</head>
|
16
|
+
<body style="padding:0; !important">
|
17
|
+
<%= render "shared/navbar_blazer" %>
|
18
|
+
<div class="container-fluid" style="margin-top:6rem;">
|
19
|
+
<%= render "shared/schema_timestamp" %>
|
20
|
+
<%= yield %>
|
21
|
+
</div>
|
22
|
+
</body>
|
23
|
+
</html>
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= yield %>
|
@@ -0,0 +1,17 @@
|
|
1
|
+
|
2
|
+
<%= simple_form_for([@import.becomes(Import), @mapping]) 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
|
+
<%= f.input :source_header %>
|
8
|
+
<%= f.input :destination_field %>
|
9
|
+
<%= f.input :delimited %>
|
10
|
+
<%= f.input :transformation_method %>
|
11
|
+
<%= f.association :import %>
|
12
|
+
</div>
|
13
|
+
|
14
|
+
<div class="form-actions">
|
15
|
+
<%= f.button :submit %>
|
16
|
+
</div>
|
17
|
+
<% end %>
|
@@ -0,0 +1,37 @@
|
|
1
|
+
<h1><%= @import.name %> · Field Mappings</h1>
|
2
|
+
|
3
|
+
<table class="table">
|
4
|
+
<tbody>
|
5
|
+
<%- if @import.mappings.size > 1 %>
|
6
|
+
<%- @import.mappings.each do |mapping| %>
|
7
|
+
<%= simple_form_for [@import, mapping], :url => import_mapping_path(@import, mapping) do |f| %>
|
8
|
+
<tr>
|
9
|
+
<td><%= f.input :source_header, :input_html => {:readonly => true} %></td>
|
10
|
+
<td><%= f.input :destination_field, collection: attribute_collection %></td>
|
11
|
+
<td><%= f.input :delimited %></td>
|
12
|
+
<td><%= f.association :import, as: :hidden %></td>
|
13
|
+
<td><%= f.button :submit, "Update", {class: 'btn btn-primary'} %></td>
|
14
|
+
</tr>
|
15
|
+
<% end %>
|
16
|
+
<% end %>
|
17
|
+
<%- else %>
|
18
|
+
<%= simple_form_for(@import, :url => admin_import_path(@import), :action => 'put') do |form| %>
|
19
|
+
<%- @import.headers.each do |header| %>
|
20
|
+
<tr>
|
21
|
+
<%= form.simple_fields_for :mappings do |f| %>
|
22
|
+
<td><%= f.input :source_header, :input_html => {:value => header, :readonly => true} %></td>
|
23
|
+
<td><%= f.input :destination_field, collection: attribute_collection, selected: mapping_suggestion(@import, header) %></td>
|
24
|
+
<td><%= f.input :delimited, :input_html => { checked: delimiter_suggestion(@import, header) } %></td>
|
25
|
+
<td><%= f.association :import, as: :hidden %></td>
|
26
|
+
<% end %>
|
27
|
+
</tr>
|
28
|
+
<% end %>
|
29
|
+
<tr>
|
30
|
+
<td><%= form.button :submit, "Create Mapping", {class: 'btn btn-primary'} %></td>
|
31
|
+
</tr>
|
32
|
+
<% end %>
|
33
|
+
<% end %>
|
34
|
+
</tbody>
|
35
|
+
</table>
|
36
|
+
|
37
|
+
<br>
|
@@ -0,0 +1,27 @@
|
|
1
|
+
<p>
|
2
|
+
<strong>Source header:</strong>
|
3
|
+
<%= @mapping.source_header %>
|
4
|
+
</p>
|
5
|
+
|
6
|
+
<p>
|
7
|
+
<strong>Destination field:</strong>
|
8
|
+
<%= @mapping.destination_field %>
|
9
|
+
</p>
|
10
|
+
|
11
|
+
<p>
|
12
|
+
<strong>Delimited:</strong>
|
13
|
+
<%= @mapping.delimited %>
|
14
|
+
</p>
|
15
|
+
|
16
|
+
<p>
|
17
|
+
<strong>Transformation method:</strong>
|
18
|
+
<%= @mapping.transformation_method %>
|
19
|
+
</p>
|
20
|
+
|
21
|
+
<p>
|
22
|
+
<strong>Import:</strong>
|
23
|
+
<%= @mapping.import_id %>
|
24
|
+
</p>
|
25
|
+
|
26
|
+
<%= link_to 'Edit', edit_import_mapping_path(@import, @mapping) %> |
|
27
|
+
<%= link_to 'Back', import_mappings_path(@import) %>
|
@@ -0,0 +1,31 @@
|
|
1
|
+
- # Split message "Download Type|Row Count|Button Label"
|
2
|
+
- message = notification.to_notification.params[:message].split("|")
|
3
|
+
|
4
|
+
%tr
|
5
|
+
%td
|
6
|
+
= check_box_tag 'read', notification.read?, notification.read?,
|
7
|
+
onchange: "this.setAttribute('data-params', this.name + '=' + this.checked*this.checked)",
|
8
|
+
data: { remote: true, url: admin_notification_path(notification), method: :patch }
|
9
|
+
%td
|
10
|
+
%strong
|
11
|
+
= message.length > 1 ? message[0] : "CSV"
|
12
|
+
= t('dictionary.download')
|
13
|
+
%td
|
14
|
+
= message.length > 1 ? message[1] : message[0]
|
15
|
+
%td
|
16
|
+
- if notification.file.attached?
|
17
|
+
= link_to rails_blob_path(notification.file.blob, disposition: "attachment"), { class: 'btn btn-primary btn-block' } do
|
18
|
+
:plain
|
19
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-cloud-download" viewBox="0 0 16 16">
|
20
|
+
<path d="M4.406 1.342A5.53 5.53 0 0 1 8 0c2.69 0 4.923 2 5.166 4.579C14.758 4.804 16 6.137 16 7.773 16 9.569 14.502 11 12.687 11H10a.5.5 0 0 1 0-1h2.688C13.979 10 15 8.988 15 7.773c0-1.216-1.02-2.228-2.313-2.228h-.5v-.5C12.188 2.825 10.328 1 8 1a4.53 4.53 0 0 0-2.941 1.1c-.757.652-1.153 1.438-1.153 2.055v.448l-.445.049C2.064 4.805 1 5.952 1 7.318 1 8.785 2.23 10 3.781 10H6a.5.5 0 0 1 0 1H3.781C1.708 11 0 9.366 0 7.318c0-1.763 1.266-3.223 2.942-3.593.143-.863.698-1.723 1.464-2.383z"/>
|
21
|
+
<path d="M7.646 15.854a.5.5 0 0 0 .708 0l3-3a.5.5 0 0 0-.708-.708L8.5 14.293V5.5a.5.5 0 0 0-1 0v8.793l-2.146-2.147a.5.5 0 0 0-.708.708l3 3z"/>
|
22
|
+
</svg>
|
23
|
+
= message.length > 1 ? message[2] : "CSV"
|
24
|
+
= "(#{number_to_human_size(notification.file.blob.byte_size)})"
|
25
|
+
- else
|
26
|
+
= 'N/A'
|
27
|
+
%td
|
28
|
+
%span.reldate{:data => {:asked_at => notification.created_at.to_json.gsub('"', '')}}
|
29
|
+
= notification.created_at
|
30
|
+
|
31
|
+
%td= link_to 'Destroy', admin_notification_path(notification), method: :delete
|
@@ -0,0 +1,54 @@
|
|
1
|
+
<%- @page_title = "GEOMG - Notifications" %>
|
2
|
+
|
3
|
+
<h1 style="width:100%;">
|
4
|
+
<%= t('dictionary.notifications') %>
|
5
|
+
|
6
|
+
<%= link_to('+ Mark All Read', batch_admin_notifications_path(params: {read: 'all'}), {method: 'put', class: "btn btn-primary float-right mr-2"}) %>
|
7
|
+
</h1>
|
8
|
+
|
9
|
+
<% if @pagy %>
|
10
|
+
<h6>
|
11
|
+
<span class='float-left mt-3'>
|
12
|
+
<%== pagy_info(@pagy, 'downloads'.pluralize(@pagy.count)) %>
|
13
|
+
</span>
|
14
|
+
<span class='float-right'>
|
15
|
+
<%== pagy_bootstrap_nav(@pagy) %>
|
16
|
+
</span>
|
17
|
+
</h6>
|
18
|
+
<% end %>
|
19
|
+
|
20
|
+
<table class="table table-striped table-bordered sortable">
|
21
|
+
<thead class="thead-dark">
|
22
|
+
<tr>
|
23
|
+
<th class="header">Read</th>
|
24
|
+
<th class="header">Category</th>
|
25
|
+
<th class="header">Message</th>
|
26
|
+
<th class="header">File</th>
|
27
|
+
<th class="header">Date</th>
|
28
|
+
<th class="header">Actions</th>
|
29
|
+
</tr>
|
30
|
+
</thead>
|
31
|
+
<tbody>
|
32
|
+
<% if @notifications.size > 0 %>
|
33
|
+
<%= render @notifications %>
|
34
|
+
<% else %>
|
35
|
+
<tr>
|
36
|
+
<td colspan="6">Zero notifications</td>
|
37
|
+
</tr>
|
38
|
+
<% end %>
|
39
|
+
</tbody>
|
40
|
+
</table>
|
41
|
+
|
42
|
+
<% if @pagy %>
|
43
|
+
<h6>
|
44
|
+
<span class='float-left mt-3'>
|
45
|
+
<%== pagy_info(@pagy, 'downloads'.pluralize(@pagy.count)) %>
|
46
|
+
</span>
|
47
|
+
<span class='float-right'>
|
48
|
+
<%== pagy_bootstrap_nav(@pagy) %>
|
49
|
+
</span>
|
50
|
+
</h6>
|
51
|
+
<% end %>
|
52
|
+
|
53
|
+
<br>
|
54
|
+
|
@@ -0,0 +1,7 @@
|
|
1
|
+
// Toast
|
2
|
+
$("#toast-wrapper").html('<%= j render partial: "shared/toast", locals: { toast: @toast } %>');
|
3
|
+
$('.toast').toast('show');
|
4
|
+
|
5
|
+
// Notifications badge
|
6
|
+
var notifications_badge = $("#notification-count");
|
7
|
+
notifications_badge.replaceWith("<%= notifications_badge.html_safe %>");
|
@@ -0,0 +1,38 @@
|
|
1
|
+
<%- @page_title= "Search" %>
|
2
|
+
|
3
|
+
<h1 style="width:100%; margin-bottom:2rem;">
|
4
|
+
Advanced Search
|
5
|
+
</h1>
|
6
|
+
|
7
|
+
<div class="row">
|
8
|
+
<div id="search-form" class="col-8">
|
9
|
+
<%= form_tag(documents_path, { method: :get, class: "my-2 my-lg-0" }) do %>
|
10
|
+
<input name="q" autofocus class="form-control mr-sm-8" type="search" placeholder="Search documents" aria-label="Search" value="<%= params[:q] ? params[:q] : ''%>">
|
11
|
+
|
12
|
+
<div id="facet-limits" class="col-md-12 mt-4">
|
13
|
+
<h3>Limit Results By</h3>
|
14
|
+
<% if @facet_options.present? %>
|
15
|
+
<% @facet_options.each do |facet| %>
|
16
|
+
<div class="row">
|
17
|
+
<% if facet['type'] == 'facet' %>
|
18
|
+
<%= label_tag("f[#{facet['id']}]", { class: 'col-sm-4 control-label' }) do %>
|
19
|
+
<%= facet['attributes']['label'] %>
|
20
|
+
<% end %>
|
21
|
+
<%- options = facet['attributes']['items'].collect{ |item| item['attributes']['label'] } %>
|
22
|
+
|
23
|
+
<div class="col-sm-8">
|
24
|
+
<%= select_tag "f[#{facet['id']}]", options_for_select(options), multiple: true, class: 'chosen-select', style: 'width:240px;' %>
|
25
|
+
</div>
|
26
|
+
|
27
|
+
<% end %>
|
28
|
+
</div>
|
29
|
+
<% end %>
|
30
|
+
<% end %>
|
31
|
+
</div>
|
32
|
+
|
33
|
+
<div class="mt-4">
|
34
|
+
<button class="btn btn-outline-success my-2 my-sm-0" type="submit">Search</button>
|
35
|
+
</div>
|
36
|
+
<% end %>
|
37
|
+
</div>
|
38
|
+
</div>
|