geoblacklight_admin 0.7.1 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/admin/document_data_dictionaries_controller.rb +5 -0
  3. data/app/controllers/admin/document_licensed_accesses_controller.rb +169 -0
  4. data/app/controllers/admin/documents_controller.rb +12 -12
  5. data/app/controllers/admin/elements_controller.rb +1 -1
  6. data/app/controllers/admin/import_distributions_controller.rb +2 -1
  7. data/app/controllers/admin/imports_controller.rb +2 -1
  8. data/app/indexers/document_indexer.rb +2 -2
  9. data/app/javascript/controllers/results_controller.js +5 -15
  10. data/app/jobs/bulk_action_run_document_job.rb +12 -2
  11. data/app/jobs/export_job.rb +40 -30
  12. data/app/jobs/export_json_bulk_job.rb +1 -1
  13. data/app/jobs/export_json_job.rb +1 -1
  14. data/app/jobs/import_document_job.rb +12 -1
  15. data/app/jobs/import_run_job.rb +5 -0
  16. data/app/models/asset.rb +13 -3
  17. data/app/models/document/controlled_lists.rb +3 -2
  18. data/app/models/document/date_validator.rb +14 -12
  19. data/app/models/document.rb +21 -107
  20. data/app/models/document_data_dictionary.rb +16 -4
  21. data/app/models/document_data_dictionary_entry.rb +1 -0
  22. data/app/models/document_distribution.rb +2 -0
  23. data/app/models/{document_access.rb → document_licensed_access.rb} +8 -6
  24. data/app/models/geoblacklight_admin/schema.rb +0 -10
  25. data/app/models/import_document.rb +5 -0
  26. data/app/services/export_csv_document_distributions_service.rb +8 -4
  27. data/app/services/export_csv_document_licensed_access_links_service.rb +27 -0
  28. data/app/services/export_csv_service.rb +5 -1
  29. data/app/views/admin/document_assets/_assets_table.html.erb +4 -0
  30. data/app/views/admin/document_assets/index.html.erb +3 -1
  31. data/app/views/admin/document_data_dictionaries/_data_dictionaries_table.html.erb +4 -0
  32. data/app/views/admin/document_distributions/destroy_all.html.erb +1 -1
  33. data/app/views/admin/document_distributions/index.html.erb +5 -7
  34. data/app/views/admin/document_licensed_accesses/_document_licensed_access.json.jbuilder +4 -0
  35. data/app/views/admin/{document_accesses → document_licensed_accesses}/_form.html.erb +4 -5
  36. data/app/views/admin/{document_accesses → document_licensed_accesses}/destroy_all.html.erb +7 -7
  37. data/app/views/admin/document_licensed_accesses/edit.html.erb +5 -0
  38. data/app/views/admin/{document_accesses → document_licensed_accesses}/import.html.erb +12 -9
  39. data/app/views/admin/document_licensed_accesses/index.html.erb +78 -0
  40. data/app/views/admin/document_licensed_accesses/index.json.jbuilder +3 -0
  41. data/app/views/admin/document_licensed_accesses/new.html.erb +8 -0
  42. data/app/views/admin/documents/_form_control.html.erb +0 -10
  43. data/app/views/admin/documents/_form_nav.html.erb +3 -12
  44. data/app/views/admin/documents/_form_nav_kithe.html.erb +0 -4
  45. data/app/views/admin/documents/_result_selected_options.html.erb +14 -18
  46. data/app/views/admin/documents/features/_document_references.html.erb +18 -20
  47. data/app/views/admin/documents/features/_licensed_access.html.erb +3 -0
  48. data/app/views/admin/elements/index.html.erb +0 -18
  49. data/app/views/admin/import_distributions/_form.html.erb +1 -1
  50. data/app/views/admin/import_distributions/_show_queued_tab.html.erb +36 -0
  51. data/app/views/admin/import_distributions/index.html.erb +3 -3
  52. data/app/views/admin/import_distributions/new.html.erb +3 -1
  53. data/app/views/admin/import_distributions/show.html.erb +5 -0
  54. data/app/views/admin/imports/_form.html.erb +1 -1
  55. data/app/views/admin/imports/_show_queued_tab.html.erb +31 -0
  56. data/app/views/admin/imports/index.html.erb +3 -3
  57. data/app/views/admin/imports/new.html.erb +3 -1
  58. data/app/views/admin/imports/show.html.erb +6 -0
  59. data/app/views/admin/notifications/_notification.html.haml +0 -1
  60. data/app/views/admin/notifications/index.html.erb +2 -2
  61. data/app/views/admin/notifications/update.js.erb +1 -1
  62. data/app/views/admin/shared/_navbar.html.erb +9 -8
  63. data/app/views/catalog/_show_gbl_admin_data_dictionaries.html.erb +1 -0
  64. data/config/routes.rb +2 -25
  65. data/db/migrate/20240321000000_rename_document_accesses_to_document_licensed_accesses.rb +5 -0
  66. data/db/seeds_form_elements.csv +1 -2
  67. data/db/seeds_form_elements.numbers +0 -0
  68. data/lib/generators/geoblacklight_admin/config_generator.rb +4 -26
  69. data/lib/generators/geoblacklight_admin/templates/config/initializers/mime_types.rb +1 -1
  70. data/lib/geoblacklight_admin/version.rb +1 -1
  71. metadata +17 -30
  72. data/app/controllers/admin/document_accesses_controller.rb +0 -169
  73. data/app/controllers/admin/document_downloads_controller.rb +0 -129
  74. data/app/models/document_download.rb +0 -39
  75. data/app/services/export_csv_document_access_links_service.rb +0 -47
  76. data/app/services/export_csv_document_downloads_service.rb +0 -47
  77. data/app/views/admin/document_accesses/_document_access.json.jbuilder +0 -4
  78. data/app/views/admin/document_accesses/edit.html.erb +0 -5
  79. data/app/views/admin/document_accesses/index.html.erb +0 -78
  80. data/app/views/admin/document_accesses/index.json.jbuilder +0 -3
  81. data/app/views/admin/document_accesses/new.html.erb +0 -6
  82. data/app/views/admin/document_accesses/show.html.erb +0 -19
  83. data/app/views/admin/document_accesses/show.json.jbuilder +0 -3
  84. data/app/views/admin/document_downloads/_document_download.json.jbuilder +0 -4
  85. data/app/views/admin/document_downloads/_form.html.erb +0 -15
  86. data/app/views/admin/document_downloads/destroy_all.html.erb +0 -70
  87. data/app/views/admin/document_downloads/edit.html.erb +0 -5
  88. data/app/views/admin/document_downloads/import.html.erb +0 -74
  89. data/app/views/admin/document_downloads/index.html.erb +0 -72
  90. data/app/views/admin/document_downloads/index.json.jbuilder +0 -3
  91. data/app/views/admin/document_downloads/new.html.erb +0 -5
  92. data/app/views/admin/document_downloads/show.html.erb +0 -24
  93. data/app/views/admin/document_downloads/show.json.jbuilder +0 -3
  94. data/app/views/admin/documents/features/_institutional_access_links.html.erb +0 -3
  95. data/app/views/admin/documents/features/_multiple_download_links.html.erb +0 -30
@@ -0,0 +1,78 @@
1
+ <%- @page_title = "GBL♦Admin - Document - Licensed Access" %>
2
+
3
+ <div class="row mb-2">
4
+ <div class="col">
5
+ <h1 style="width:100%;">
6
+ Document &middot; Licensed Access
7
+
8
+ <% if params[:document_id] %>
9
+ <%= link_to '+ Import CSV', import_admin_document_document_licensed_accesses_path(@document), { class: 'btn btn-primary float-right' } %>
10
+
11
+ <%= link_to '+ New Licensed Access', new_admin_document_document_licensed_access_path(@document), { class: 'btn btn-primary float-right mr-2' } %>
12
+ <% else %>
13
+ <%= link_to '- Delete CSV', destroy_all_admin_document_licensed_accesses_path, { class: 'btn btn-danger float-right' } %>
14
+ <%= link_to '+ Import CSV', import_admin_document_licensed_accesses_path, { class: 'btn btn-primary float-right mr-4' } %>
15
+ <% end %>
16
+ </h1>
17
+ <% if params[:document_id] %>
18
+ <h2 class='h3'>
19
+ <%= link_to(@document.title, admin_document_path(@document)) %>
20
+ &middot;
21
+ <%= @document_licensed_accesses.count %> urls
22
+ </h2>
23
+ <% else %>
24
+ <h2 class='h3'>Licensed Access</h2>
25
+ <% end %>
26
+
27
+ <% if @pagy %>
28
+ <h6>
29
+ <span class='float-left mt-3'>
30
+ <%== pagy_info(@pagy) %>
31
+ </span>
32
+ <span class='float-right'>
33
+ <%== pagy_bootstrap_nav(@pagy) %>
34
+ </span>
35
+ </h6>
36
+ <% end %>
37
+
38
+
39
+ <table class="table table-striped table-bordered sortable">
40
+ <thead class="thead-dark">
41
+ <tr>
42
+ <th class="header">id</th>
43
+ <th class="header">friendlier_id</th>
44
+ <th class="header">institution_code</th>
45
+ <th class="header">institution_name</th>
46
+ <th class="header" style="max-width:200px;">access_url</th>
47
+ <th class="header" colspan="2">Actions</th>
48
+ </tr>
49
+ </thead>
50
+
51
+ <tbody>
52
+ <% @document_licensed_accesses.each do |document_licensed_access| %>
53
+ <tr>
54
+ <td><%= document_licensed_access.id %></td>
55
+ <td><%= link_to document_licensed_access.friendlier_id, admin_document_path(document_licensed_access.document) %></td>
56
+ <td><%= document_licensed_access.institution_code %></td>
57
+ <td><%= b1g_institution_codes[document_licensed_access.institution_code] %></td>
58
+ <td><%= link_to(document_licensed_access.access_url, document_licensed_access.access_url) %></td>
59
+ <td><%= link_to 'Edit', edit_admin_document_document_licensed_access_path(document_licensed_access.document, document_licensed_access) %></td>
60
+ <td><%= link_to 'Destroy', admin_document_document_licensed_access_path(document_licensed_access.document, document_licensed_access), method: :delete, data: { confirm: 'Are you sure?' } %></td>
61
+ </tr>
62
+ <% end %>
63
+ </tbody>
64
+ </table>
65
+
66
+ <% if @pagy %>
67
+ <h6>
68
+ <span class='float-left mt-3'>
69
+ <%== pagy_info(@pagy) %>
70
+ </span>
71
+ <span class='float-right'>
72
+ <%== pagy_bootstrap_nav(@pagy) %>
73
+ </span>
74
+ </h6>
75
+ <% end %>
76
+ </div>
77
+ </div>
78
+ </div>
@@ -0,0 +1,3 @@
1
+ # frozen_string_literal: true
2
+
3
+ json.array! @document_licensed_accesses, partial: "document_licensed_accesses/document_licensed_access", as: :document_licensed_access
@@ -0,0 +1,8 @@
1
+ <%- @page_title = "GBL♦Admin - New Document Licensed Access" %>
2
+
3
+ <h1>New Document Licensed Access</h1>
4
+ <h2 class='h3'><%= @document.title %></h2>
5
+
6
+ <%= render 'form', document_licensed_access: @document_licensed_access %>
7
+
8
+ <%= link_to 'Back', admin_document_document_licensed_accesses_path(@document) %>
@@ -35,17 +35,7 @@
35
35
  <%= f.hidden_field :publication_state %>
36
36
  <% end %>
37
37
 
38
- <% # References are a special, special case %>
39
- <% elsif element.solr_field == 'dct_references_s' %>
40
- <% unless ENV["GBL_ADMIN_REFERENCES_MIGRATED"] == "true" %>
41
- <%- Rails.logger.warn("Deprecation warning: AttrJSON-based dct_references_s will not be supported soon.") %>
42
- <%= f.repeatable_attr_input(element.solr_field.to_sym, build: :at_least_one, html_attributes: options[:html_attributes], simple_form_input_args: { label: element.label }) do |sub_form| %>
43
- <%= category_and_value(sub_form, category_list: Document::Reference::REFERENCE_VALUES.keys) %>
44
- <% end %>
45
- <% end %>
46
-
47
38
  <% elsif element.repeatable? %>
48
-
49
39
  <% # Text Fields %>
50
40
  <% if element.field_type == 'text' %>
51
41
  <%= f.repeatable_attr_input(element.solr_field.to_sym, build: :at_least_one, html_attributes: options[:html_attributes], simple_form_input_args: { label: element.label }) do |input_name, value| %>
@@ -15,19 +15,10 @@
15
15
  <% end %>
16
16
 
17
17
  <%- if @document.persisted? %>
18
- <%= link_to admin_document_document_accesses_url(@document), class: "ml-2" do %>
19
- Institutional Access Links
20
- <span class="badge badge-light"><%= @document.document_accesses.count %></span>
18
+ <%= link_to admin_document_document_licensed_accesses_url(@document), class: "ml-2" do %>
19
+ Licensed Access
20
+ <span class="badge badge-light"><%= @document.document_licensed_accesses.count %></span>
21
21
  <% end %>
22
-
23
- <%- if ENV["GBL_ADMIN_REFERENCES_MIGRATED"] == "false" %>
24
- <%- Rails.logger.warn("Deprecation warning: Multiple Download Links will not be supported soon.") %>
25
- <%= link_to admin_document_document_downloads_url(@document), class: "ml-2" do %>
26
- Multiple Download Links
27
- <span class="badge badge-light"><%= @document.document_downloads.count %></span>
28
- <% end %>
29
- <% end %>
30
-
31
22
  <%= link_to admin_document_document_assets_url(@document), class: "ml-2" do %>
32
23
  Additional Assets
33
24
  <span class="badge badge-light"><%= @document.document_assets.count %></span>
@@ -23,10 +23,6 @@
23
23
 
24
24
  <% if @document.persisted? %>
25
25
  <%= link_to "Institutional Access Links", admin_document_document_accesses_url(@document), class: "ml-2" %>
26
- <% if ENV["GBL_ADMIN_REFERENCES_MIGRATED"] == "false" %>
27
- <%= Rails.logger.warn("Deprecation warning: Multiple Download Links will not be supported soon.") %>
28
- <%= link_to "Multiple Download Links", admin_document_document_downloads_url(@document), class: "ml-2" %>
29
- <% end %>
30
26
  <%= link_to "Additional Assets", admin_document_document_assets_url(@document), class: "ml-2" %>
31
27
  <% end %>
32
28
  </nav>
@@ -14,23 +14,19 @@
14
14
  </button>
15
15
  <div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
16
16
  <a class="dropdown-item" data-action="click->results#exportCSV" href="javascript:void(0);">
17
- CSV
18
- </a>
19
- <div class="dropdown-divider"></div>
20
- <a class="dropdown-item" data-action="click->results#exportJsonFile" href="javascript:void(0);">JSON (Single File)</a>
21
- <a class="dropdown-item" data-action="click->results#exportJsonAardvark" href="javascript:void(0);">JSON (Tree Directory)</a>
22
- <a class="dropdown-item" data-action="click->results#exportJsonBtaaAardvark" href="javascript:void(0);">JSON (BTAA Aardvark)</a>
23
- <a class="dropdown-item" data-action="click->results#exportJsonGBLv1" href="javascript:void(0);">JSON (GBL v1.0)</a>
24
- <div class="dropdown-divider"></div>
25
- <a class="dropdown-item" data-action="click->results#exportCsvDocumentAccessLinks" href="javascript:void(0);">
26
- CSV - Document Access Links
27
- </a>
28
- <a class="dropdown-item" data-action="click->results#exportCsvDocumentDownloads" href="javascript:void(0);">
29
- CSV - Document Downloads
17
+ CSV - Primary
30
18
  </a>
31
19
  <a class="dropdown-item" data-action="click->results#exportCsvDocumentDistributions" href="javascript:void(0);">
32
- CSV - Document Distributions
20
+ CSV - Distributions
21
+ </a>
22
+ <a class="dropdown-item" data-action="click->results#exportCsvDocumentLicensedAccessLinks" href="javascript:void(0);">
23
+ CSV - Licensed Access
33
24
  </a>
25
+ <div class="dropdown-divider"></div>
26
+ <a class="dropdown-item" data-action="click->results#exportJsonFile" href="javascript:void(0);">JSON - Single File</a>
27
+ <a class="dropdown-item" data-action="click->results#exportJsonAardvark" href="javascript:void(0);">JSON - Tree Directory</a>
28
+ <a class="dropdown-item" data-action="click->results#exportJsonBtaaAardvark" href="javascript:void(0);">JSON - BTAA Aardvark</a>
29
+ <a class="dropdown-item" data-action="click->results#exportJsonGBLv1" href="javascript:void(0);">JSON - GBL v1.0</a>
34
30
  </div>
35
31
  </span>
36
32
 
@@ -41,11 +37,11 @@
41
37
  </button>
42
38
  <div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
43
39
  <h6 class="dropdown-header">Publication State</h6>
44
- <a class="dropdown-item" data-action="click->results#setPubFieldNameValue" href="javascript:void(0);">Published</a>
45
- <a class="dropdown-item" data-action="click->results#setPubFieldNameValue" href="javascript:void(0);">Unpublished</a>
46
- <a class="dropdown-item" data-action="click->results#setPubFieldNameValue" href="javascript:void(0);">Draft</a>
40
+ <a class="dropdown-item" data-action="click->results#setPubFieldNameValue" href="javascript:void(0);">Publish</a>
41
+ <a class="dropdown-item" data-action="click->results#setPubFieldNameValue" href="javascript:void(0);">Unpublish</a>
42
+ <a class="dropdown-item" data-action="click->results#setPubFieldNameValue" href="javascript:void(0);">Set as Draft</a>
47
43
  <div class="dropdown-divider"></div>
48
- <h6 class="dropdown-header">Imagery</h6>
44
+ <h6 class="dropdown-header">Thumbnail Images</h6>
49
45
  <a class="dropdown-item" data-action="click->results#harvestThumbnails" href="javascript:void(0);">Harvest Thumbnails</a>
50
46
  <a class="dropdown-item" data-action="click->results#deleteThumbnails" href="javascript:void(0);">Delete Thumbnails</a>
51
47
  </div>
@@ -1,23 +1,21 @@
1
- <% if ENV["GBL_ADMIN_REFERENCES_MIGRATED"] == "true" %>
2
- <%- if @document.persisted? %>
3
- <h3 id="document-distributions"><%= link_to "Distributions", admin_document_document_distributions_url(@document) %></h3>
4
- <table class="table table-striped table-bordered sortable">
5
- <thead class="thead-dark">
1
+ <%- if @document.persisted? %>
2
+ <h3 id="document-distributions"><%= link_to "Distributions", admin_document_document_distributions_url(@document) %></h3>
3
+ <table class="table table-striped table-bordered sortable">
4
+ <thead class="thead-dark">
5
+ <tr>
6
+ <th class="header">Type</th>
7
+ <th class="header">Value</th>
8
+ <th class="header">Label</th>
9
+ </tr>
10
+ </thead>
11
+ <tbody>
12
+ <% @document.document_distributions.each do |document_distribution| %>
6
13
  <tr>
7
- <th class="header">Type</th>
8
- <th class="header">Value</th>
9
- <th class="header">Label</th>
14
+ <td><%= document_distribution.reference_type.name %></td>
15
+ <td><%= document_distribution.url %></td>
16
+ <td><%= document_distribution.label %></td>
10
17
  </tr>
11
- </thead>
12
- <tbody>
13
- <% @document.document_distributions.each do |document_distribution| %>
14
- <tr>
15
- <td><%= document_distribution.reference_type.name %></td>
16
- <td><%= document_distribution.url %></td>
17
- <td><%= document_distribution.label %></td>
18
- </tr>
19
- <% end %>
20
- </tbody>
21
- </table>
22
- <% end %>
18
+ <% end %>
19
+ </tbody>
20
+ </table>
23
21
  <% end %>
@@ -0,0 +1,3 @@
1
+ <% if @document.persisted? %>
2
+ <%= link_to "Licensed Access", admin_document_document_licensed_accesses_url(@document) %>
3
+ <% end %>
@@ -9,15 +9,6 @@
9
9
 
10
10
  <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>
11
11
 
12
- <h6>
13
- <span class='float-left mt-3'>
14
- <%== pagy_info(@pagy) %>
15
- </span>
16
- <span class='float-right'>
17
- <%== pagy_bootstrap_nav(@pagy) %>
18
- </span>
19
- </h6>
20
-
21
12
  <table class="table table-striped table-bordered sortable">
22
13
  <thead class="thead-dark">
23
14
  <tr>
@@ -49,15 +40,6 @@
49
40
  <% end %>
50
41
  </tbody>
51
42
  </table>
52
-
53
- <h6>
54
- <span class='float-left mt-3'>
55
- <%== pagy_info(@pagy) %>
56
- </span>
57
- <span class='float-right'>
58
- <%== pagy_bootstrap_nav(@pagy) %>
59
- </span>
60
- </h6>
61
43
  </div>
62
44
  </div>
63
45
 
@@ -17,5 +17,5 @@
17
17
  </div>
18
18
 
19
19
  <div class="form-actions">
20
- <%= f.button :submit, "+ Create Import Distributions", {class: 'btn btn-primary'} %>
20
+ <%= f.button :submit, "+ Create Distribution Import", {class: 'btn btn-primary'} %>
21
21
  </div>
@@ -0,0 +1,36 @@
1
+ <h6>
2
+ <span class='float-left mt-3'>
3
+ <%== pagy_info(@pagy_queued) %>
4
+ </span>
5
+ <span class='float-right'>
6
+ <%== pagy_bootstrap_nav(@pagy_queued) %>
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_queued_distributions.each_with_index do |distribution, index| %>
21
+ <tr>
22
+ <td>
23
+ <span class="badge badge-danger">
24
+ <%= distribution.state_machine.current_state %>
25
+ </span>
26
+ </td>
27
+ <td><%= distribution.friendlier_id %></td>
28
+ <td>
29
+ <%= link_to admin_import_distribution_path(@import_distribution, distribution) do %>
30
+ <%= distribution.state_machine&.last_transition&.metadata %>
31
+ <% end %>
32
+ </td>
33
+ </tr>
34
+ <% end %>
35
+ </tbody>
36
+ </table>
@@ -1,10 +1,10 @@
1
- <%- @page_title = "GBL♦Admin - Import Distributions" %>
1
+ <%- @page_title = "GBL♦Admin - Distribution Imports" %>
2
2
 
3
3
  <div class="row mb-2">
4
4
  <div class="col">
5
5
  <h1 style="width:100%;">
6
- Import Distributions
7
- <%= link_to '+ New Distributions Import', new_admin_import_distribution_path, { class: 'btn btn-primary float-right' } %>
6
+ Distribution Imports
7
+ <%= link_to '+ New Distribution Import', new_admin_import_distribution_path, { class: 'btn btn-primary float-right' } %>
8
8
  </h1>
9
9
 
10
10
  <h6>
@@ -1,4 +1,6 @@
1
- <h1>New Import Distribution</h1>
1
+ <%- @page_title = "GBL♦Admin - New Distribution Import" %>
2
+
3
+ <h1>New Distribution Import</h1>
2
4
 
3
5
  <%= simple_form_for(@import_distribution.becomes(ImportDistribution), url: admin_import_distributions_path) do |f| %>
4
6
  <%= render 'form', import_distribution: @import_distribution, f: f %>
@@ -104,6 +104,7 @@
104
104
  <nav>
105
105
  <div class="nav nav-tabs" id="import-state-tabs" role="tablist">
106
106
  <a class="nav-item nav-link active" id="import-success-tab" data-toggle="tab" href="#import-state-success" role="tab" aria-controls="import-state-success" aria-selected="true">Success <span class="badge badge-success"><%= @pagy_success.count %></span></a>
107
+ <a class="nav-item nav-link" id="import-queued-tab" data-toggle="tab" href="#import-state-queued" role="tab" aria-controls="import-state-queued" aria-selected="false">Queued <span class="badge badge-warning"><%= @pagy_queued.count %></span></a>
107
108
  <a class="nav-item nav-link" id="import-failed-tab" data-toggle="tab" href="#import-state-failed" role="tab" aria-controls="import-state-failed" aria-selected="false">Failed <span class="badge badge-danger"><%= @pagy_failed.count %></span> </a>
108
109
  </div>
109
110
  </nav>
@@ -113,6 +114,10 @@
113
114
  <%= render partial: 'show_success_tab' %>
114
115
  </div>
115
116
 
117
+ <div class="tab-pane fade show" id="import-state-queued" role="tabpanel" aria-labelledby="import-state-queued-tab">
118
+ <%= render partial: 'show_queued_tab' %>
119
+ </div>
120
+
116
121
  <div class="tab-pane fade" id="import-state-failed" role="tabpanel" aria-labelledby="import-state-failed-tab">
117
122
  <%= render partial: 'show_failed_tab' %>
118
123
  </div>
@@ -23,5 +23,5 @@
23
23
  </div>
24
24
 
25
25
  <div class="form-actions">
26
- <%= f.button :submit, "+ Create Import", {class: 'btn btn-primary'} %>
26
+ <%= f.button :submit, "+ Create Primary Import", {class: 'btn btn-primary'} %>
27
27
  </div>
@@ -0,0 +1,31 @@
1
+ <h6>
2
+ <span class='float-left mt-3'>
3
+ <%== pagy_info(@pagy_queued) %>
4
+ </span>
5
+ <span class='float-right'>
6
+ <%== pagy_bootstrap_nav(@pagy_queued) %>
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_queued_documents.each_with_index do |doc, index| %>
20
+ <tr>
21
+ <td>
22
+ <span class="badge badge-warning">
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>
@@ -1,10 +1,10 @@
1
- <%- @page_title = "GBL♦Admin - Imports" %>
1
+ <%- @page_title = "GBL♦Admin - Primary Imports" %>
2
2
 
3
3
  <div class="row mb-2">
4
4
  <div class="col">
5
5
  <h1 style="width:100%;">
6
- Import Documents
7
- <%= link_to '+ New Documents Import', new_admin_import_path, { class: 'btn btn-primary float-right' } %>
6
+ Primary Imports
7
+ <%= link_to '+ New Primary Import', new_admin_import_path, { class: 'btn btn-primary float-right' } %>
8
8
  </h1>
9
9
 
10
10
  <h6>
@@ -1,4 +1,6 @@
1
- <h1>New Import</h1>
1
+ <%- @page_title = "GBL♦Admin - New Primary Import" %>
2
+
3
+ <h1>New Primary Import</h1>
2
4
 
3
5
  <%= simple_form_for(@import.becomes(Import), url: admin_imports_path) do |f| %>
4
6
  <%= render 'form', import: @import, f: f %>
@@ -132,15 +132,21 @@
132
132
  <nav>
133
133
  <div class="nav nav-tabs" id="import-state-tabs" role="tablist">
134
134
  <a class="nav-item nav-link active" id="import-success-tab" data-toggle="tab" href="#import-state-success" role="tab" aria-controls="import-state-success" aria-selected="true">Success <span class="badge badge-success"><%= @pagy_success.count %></span></a>
135
+ <a class="nav-item nav-link" id="import-queued-tab" data-toggle="tab" href="#import-state-queued" role="tab" aria-controls="import-state-queued" aria-selected="false">Queued <span class="badge badge-warning"><%= @pagy_queued.count %></span></a>
135
136
  <a class="nav-item nav-link" id="import-failed-tab" data-toggle="tab" href="#import-state-failed" role="tab" aria-controls="import-state-failed" aria-selected="false">Failed <span class="badge badge-danger"><%= @pagy_failed.count %></span> </a>
136
137
  </div>
137
138
  </nav>
138
139
 
139
140
  <div class="tab-content" id="import-states">
141
+
140
142
  <div class="tab-pane fade show active" id="import-state-success" role="tabpanel" aria-labelledby="import-state-success-tab">
141
143
  <%= render partial: 'show_success_tab' %>
142
144
  </div>
143
145
 
146
+ <div class="tab-pane fade show" id="import-state-queued" role="tabpanel" aria-labelledby="import-state-queued-tab">
147
+ <%= render partial: 'show_queued_tab' %>
148
+ </div>
149
+
144
150
  <div class="tab-pane fade" id="import-state-failed" role="tabpanel" aria-labelledby="import-state-failed-tab">
145
151
  <%= render partial: 'show_failed_tab' %>
146
152
  </div>
@@ -10,7 +10,6 @@
10
10
  %td
11
11
  %strong
12
12
  = message.length > 1 ? message[0] : "CSV"
13
- = t('dictionary.download')
14
13
  %td
15
14
  = message.length > 1 ? message[1] : message[0]
16
15
  %td
@@ -1,7 +1,7 @@
1
- <%- @page_title = "GBL♦Admin - Notifications" %>
1
+ <%- @page_title = "GBL♦Admin - Exports" %>
2
2
 
3
3
  <h1 style="width:100%;">
4
- <%= t('dictionary.notifications') %>
4
+ <%= t('dictionary.exports') %>
5
5
 
6
6
  <%= link_to('+ Mark All Read', batch_admin_notifications_path(params: {read: 'all'}), {method: 'put', class: "btn btn-primary float-right mr-2"}) %>
7
7
  </h1>
@@ -1,5 +1,5 @@
1
1
  // Toast
2
- $("#toast-wrapper").html('<%= j render partial: "shared/toast", locals: { toast: @toast } %>');
2
+ $("#toast-wrapper").html('<%= j render partial: "admin/shared/toast", locals: { toast: @toast } %>');
3
3
  $('.toast').toast('show');
4
4
 
5
5
  // Notifications badge
@@ -35,7 +35,7 @@
35
35
  <% if user_signed_in? %>
36
36
  <li class="nav-item">
37
37
  <%= link_to admin_notifications_url, { class: 'nav-link' } do %>
38
- <%= "Notifications #{notifications_badge}".html_safe %>
38
+ <%= "Exports #{notifications_badge}".html_safe %>
39
39
  <% end %>
40
40
  </li>
41
41
  <% end %>
@@ -45,15 +45,16 @@
45
45
  </a>
46
46
  <div class="dropdown-menu" aria-labelledby="navbarDropdown">
47
47
  <h6 class="dropdown-header">Data Management</h6>
48
- <%= link_to "Documents", admin_documents_path, {class: 'dropdown-item'} %>
49
- <%= link_to "Import Documents", admin_imports_path, {class: 'dropdown-item'} %>
50
- <%= link_to "Import Distributions", admin_import_distributions_path, {class: 'dropdown-item'} %>
51
- <%= link_to "Bulk Actions", admin_bulk_actions_path, {class: 'dropdown-item'} %>
48
+ <%= link_to "Import Primary", new_admin_import_path, {class: 'dropdown-item'} %>
49
+ <%= link_to "Import Distributions", new_admin_import_distribution_path, {class: 'dropdown-item'} %>
50
+ <%= link_to "Import Licensed Accesses", import_admin_document_licensed_accesses_path, {class: 'dropdown-item'} %>
52
51
  <div class="dropdown-divider"></div>
53
- <h6 class="dropdown-header">Document Relationships</h6>
54
- <%= link_to "Access Links", admin_document_accesses_path, {class: 'dropdown-item'} %>
55
- <%= link_to "Assets", admin_assets_path, {class: 'dropdown-item'} %>
52
+ <h6 class="dropdown-header">View Results</h6>
53
+ <%= link_to "Primary Imports", admin_imports_path, {class: 'dropdown-item'} %>
54
+ <%= link_to "Distribution Imports", admin_import_distributions_path, {class: 'dropdown-item'} %>
56
55
  <%= link_to "Distributions", admin_document_distributions_path, {class: 'dropdown-item'} %>
56
+ <%= link_to "Licensed Accesses", admin_document_licensed_accesses_path, {class: 'dropdown-item'} %>
57
+ <%= link_to "Assets", admin_assets_path, {class: 'dropdown-item'} %>
57
58
  <div class="dropdown-divider"></div>
58
59
  <h6 class="dropdown-header">Business Intelligence</h6>
59
60
  <%= link_to "Blazer", '/admin/blazer', {class: 'dropdown-item', data: { turbolinks: false }} %>
@@ -1,6 +1,7 @@
1
1
  <% if document&.kithe_model&.document_data_dictionaries.present? %>
2
2
  <% document.kithe_model.document_data_dictionaries.each do |dictionary| %>
3
3
  <h3><%= dictionary.name %></h3>
4
+ <p><%= dictionary.description %></p>
4
5
  <table class="table table-striped table-bordered">
5
6
  <thead class="thead-dark">
6
7
  <tr>
data/config/routes.rb CHANGED
@@ -81,11 +81,10 @@ GeoblacklightAdmin::Engine.routes.draw do
81
81
  get "versions"
82
82
  get "admin"
83
83
 
84
- resources :document_accesses, path: "access" do
84
+ resources :document_licensed_accesses, path: "licensed_access" do
85
85
  collection do
86
86
  get "import"
87
87
  post "import"
88
-
89
88
  get "destroy_all"
90
89
  post "destroy_all"
91
90
  end
@@ -125,32 +124,10 @@ GeoblacklightAdmin::Engine.routes.draw do
125
124
  end
126
125
  end
127
126
 
128
- resources :document_accesses, path: "access" do
129
- collection do
130
- get "import"
131
- post "import"
132
-
133
- get "destroy_all"
134
- post "destroy_all"
135
- end
136
- end
137
-
138
- resources :document_downloads, path: "downloads" do
127
+ resources :document_licensed_accesses, path: "licensed_access" do
139
128
  collection do
140
129
  get "import"
141
130
  post "import"
142
-
143
- get "destroy_all"
144
- post "destroy_all"
145
- end
146
- end
147
-
148
- # Document References
149
- resources :document_references, path: "references" do
150
- collection do
151
- get "import"
152
- post "import"
153
-
154
131
  get "destroy_all"
155
132
  post "destroy_all"
156
133
  end
@@ -0,0 +1,5 @@
1
+ class RenameDocumentAccessesToDocumentLicensedAccesses < ActiveRecord::Migration[7.0]
2
+ def change
3
+ rename_table :document_accesses, :document_licensed_accesses
4
+ end
5
+ end
@@ -43,7 +43,6 @@ FormControl,,gbl_georeferenced_b,41
43
43
  FormGroup,Links,,42
44
44
  FormControl,,dct_references_s,43
45
45
  FormControl,,b1g_image_ss,44
46
- FormFeature,Multiple Download Links,,45
47
46
  FormHeader,Administrative,,46
48
47
  FormGroup,Codes,,47
49
48
  FormControl,,geomg_id_s,48
@@ -69,4 +68,4 @@ FormControl,,b1g_child_record_b,67
69
68
  FormControl,,b1g_dct_mediator_sm,68
70
69
  FormControl,,b1g_access_s,69
71
70
  FormHeader,Related Items,,70
72
- FormFeature,Institutional Access Links,,71
71
+ FormFeature,Licensed Access,,71
Binary file