geoblacklight_admin 0.4.1 → 0.5.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 (109) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +10 -55
  3. data/Rakefile +3 -0
  4. data/app/assets/javascripts/geoblacklight_admin/chosen.js +7 -3
  5. data/app/assets/javascripts/geoblacklight_admin/datepicker.js +2 -2
  6. data/app/assets/javascripts/geoblacklight_admin/inputmask.js +2 -2
  7. data/app/assets/javascripts/geoblacklight_admin/truncate.js +2 -2
  8. data/app/assets/javascripts/geoblacklight_admin.js +1 -4
  9. data/app/assets/stylesheets/geoblacklight_admin/_core.scss +3 -1
  10. data/app/assets/stylesheets/geoblacklight_admin/modules/_images.scss +4 -0
  11. data/app/assets/stylesheets/geoblacklight_admin/modules/_nav.scss +4 -0
  12. data/app/assets/stylesheets/geoblacklight_admin/modules/_results.scss +5 -0
  13. data/app/controllers/admin/admin_controller.rb +1 -1
  14. data/app/controllers/admin/advanced_search_controller.rb +0 -1
  15. data/app/controllers/admin/assets_controller.rb +142 -0
  16. data/app/controllers/admin/bulk_actions_controller.rb +1 -1
  17. data/app/controllers/admin/document_accesses_controller.rb +3 -3
  18. data/app/controllers/admin/document_assets_controller.rb +33 -23
  19. data/app/controllers/admin/documents_controller.rb +6 -2
  20. data/app/controllers/admin/ids_controller.rb +0 -1
  21. data/app/controllers/admin/imports_controller.rb +2 -2
  22. data/app/helpers/asset_helper.rb +8 -0
  23. data/app/helpers/document_helper.rb +4 -0
  24. data/app/helpers/geoblacklight_admin_helper.rb +11 -1
  25. data/{lib/generators/geoblacklight_admin/templates → app}/javascript/controllers/results_controller.js +38 -0
  26. data/app/javascript/entrypoints/engine.js +8 -0
  27. data/app/javascript/index.js +8 -0
  28. data/app/jobs/bulk_action_revert_document_job.rb +2 -2
  29. data/app/jobs/bulk_action_run_document_job.rb +5 -1
  30. data/app/jobs/bulk_action_run_job.rb +11 -1
  31. data/app/jobs/geoblacklight_admin/delete_thumbnail_job.rb +17 -0
  32. data/app/jobs/geoblacklight_admin/remove_parent_dct_references_uri_job.rb +16 -0
  33. data/app/jobs/geoblacklight_admin/set_parent_dct_references_uri_job.rb +19 -0
  34. data/app/jobs/geoblacklight_admin/store_image_job.rb +21 -2
  35. data/app/models/asset.rb +38 -0
  36. data/app/models/blacklight_api.rb +2 -2
  37. data/app/models/blacklight_api_facets.rb +1 -1
  38. data/app/models/blacklight_api_ids.rb +2 -2
  39. data/app/models/bulk_action_document_state_machine.rb +2 -4
  40. data/app/models/bulk_action_state_machine.rb +3 -3
  41. data/app/models/bulk_actions/change_publication_state.rb +10 -0
  42. data/app/models/document/reference.rb +24 -0
  43. data/app/models/document.rb +122 -11
  44. data/app/models/document_thumbnail_state_machine.rb +22 -0
  45. data/app/models/document_thumbnail_transition.rb +26 -0
  46. data/app/models/element.rb +1 -1
  47. data/app/models/geoblacklight_admin/field_mappings_btaa_aardvark.rb +7 -1
  48. data/app/models/geoblacklight_admin/schema.rb +37 -1
  49. data/app/models/geoblacklight_admin/solr_utils.rb +87 -0
  50. data/app/models/kithe/vips_cli_image_to_png.rb +114 -0
  51. data/app/services/geoblacklight_admin/image_service/iiif.rb +2 -2
  52. data/app/services/geoblacklight_admin/image_service/iiif_manifest.rb +111 -0
  53. data/app/services/geoblacklight_admin/image_service/tms.rb +50 -0
  54. data/app/services/geoblacklight_admin/image_service/wms.rb +1 -4
  55. data/app/services/geoblacklight_admin/image_service.rb +16 -40
  56. data/app/services/geoblacklight_admin/item_viewer.rb +1 -1
  57. data/app/uploaders/asset_uploader.rb +6 -11
  58. data/app/views/admin/assets/_form.html.erb +19 -0
  59. data/app/views/admin/assets/display_attach_form.html.erb +39 -0
  60. data/app/views/admin/assets/edit.html.erb +9 -0
  61. data/app/views/admin/assets/index.html.erb +75 -0
  62. data/app/views/admin/assets/show.html.erb +100 -0
  63. data/app/views/admin/bulk_actions/index.html.erb +50 -48
  64. data/app/views/admin/bulk_actions/show.html.erb +3 -2
  65. data/app/views/admin/document_accesses/index.html.erb +68 -64
  66. data/app/views/admin/document_assets/_form.html.erb +17 -0
  67. data/app/views/admin/document_assets/display_attach_form.html.erb +4 -9
  68. data/app/views/admin/document_assets/edit.html.erb +5 -0
  69. data/app/views/admin/document_assets/index.html.erb +88 -72
  70. data/app/views/admin/document_downloads/index.html.erb +64 -62
  71. data/app/views/admin/documents/_document.html.erb +37 -16
  72. data/app/views/admin/documents/_form.html.erb +21 -6
  73. data/app/views/admin/documents/_form_nav.html.erb +12 -3
  74. data/app/views/admin/documents/_result_selected_options.html.erb +6 -1
  75. data/app/views/admin/documents/admin.html.erb +210 -0
  76. data/app/views/admin/documents/index.html.erb +10 -1
  77. data/app/views/admin/documents/versions.html.erb +3 -3
  78. data/app/views/admin/elements/index.html.erb +55 -54
  79. data/app/views/admin/form_elements/index.html.erb +38 -35
  80. data/app/views/admin/imports/index.html.erb +52 -50
  81. data/app/views/admin/layouts/application.html.erb +7 -4
  82. data/app/views/admin/shared/_js_behaviors.html.erb +6 -3
  83. data/app/views/admin/shared/_navbar.html.erb +11 -8
  84. data/config/locales/documents.en.yml +6 -0
  85. data/config/routes.rb +1 -0
  86. data/config/vite.json +14 -0
  87. data/db/migrate/20240619171628_create_document_thumbnail_statesman.rb +18 -0
  88. data/lib/generators/geoblacklight_admin/config_generator.rb +63 -15
  89. data/lib/generators/geoblacklight_admin/install_generator.rb +1 -0
  90. data/lib/generators/geoblacklight_admin/templates/api_controller.rb +0 -2
  91. data/lib/generators/geoblacklight_admin/templates/base.html.erb +53 -0
  92. data/lib/generators/geoblacklight_admin/templates/config/initializers/kithe.rb +1 -0
  93. data/lib/generators/geoblacklight_admin/templates/config/settings.yml +15 -1
  94. data/lib/generators/geoblacklight_admin/templates/config/vite.json +16 -0
  95. data/lib/generators/geoblacklight_admin/templates/frontend/entrypoints/application.js +30 -0
  96. data/lib/generators/geoblacklight_admin/templates/package-test.json +10 -0
  97. data/lib/generators/geoblacklight_admin/templates/package.json +5 -29
  98. data/lib/generators/geoblacklight_admin/templates/vite.config.ts +8 -0
  99. data/lib/geoblacklight_admin/engine.rb +1 -0
  100. data/lib/geoblacklight_admin/rake_task.rb +5 -0
  101. data/lib/geoblacklight_admin/tasks/images.rake +33 -0
  102. data/lib/geoblacklight_admin/tasks/solr.rake +11 -0
  103. data/lib/geoblacklight_admin/version.rb +1 -1
  104. metadata +75 -19
  105. data/lib/generators/geoblacklight_admin/templates/javascript/controllers/application_controller.js +0 -17
  106. data/lib/generators/geoblacklight_admin/templates/javascript/controllers/document_controller.js +0 -26
  107. data/lib/generators/geoblacklight_admin/templates/javascript/controllers/index.js +0 -10
  108. data/lib/tasks/geoblacklight_admin/images.rake +0 -30
  109. data/lib/tasks/geoblacklight_admin.rake +0 -213
@@ -24,7 +24,16 @@
24
24
  <% if doc.present? %>
25
25
  <%= render "document", document: doc, index: index %>
26
26
  <% else %>
27
- <p><%= "#{index + 1}." %> Database is missing document <%= document['id'] %></p>
27
+ <li>
28
+ <div class="row">
29
+ <div class="thumbnail col-1">
30
+ &nbsp;
31
+ </div>
32
+ <div class="result col">
33
+ <p><%= "#{index + 1}." %> Database is missing document <%= document['id'] %></p>
34
+ </div>
35
+ </div>
36
+ </li>
28
37
  <% end %>
29
38
  <% end %>
30
39
  </ol>
@@ -34,7 +34,7 @@
34
34
  <%- if index == 0 %>
35
35
  <%- current = @document.json_attributes %>
36
36
  <%- previous = version&.previous&.reify&.json_attributes %>
37
- <%- diff = Hashdiff.diff(previous,current) %>
37
+ <%- diff = ::Hashdiff.diff(previous,current) %>
38
38
  <%- changeset = version.changeset.except(:json_attributes).collect{ |change| ["+", change[0], change[1][1]] }.flatten %>
39
39
  <%- diff << changeset %>
40
40
  <%- diff.each do |d| %>
@@ -51,7 +51,7 @@
51
51
  <%- elsif version.previous && version.previous.reify %>
52
52
  <%- current = version.reify&.json_attributes %>
53
53
  <%- previous = version.previous.reify&.json_attributes %>
54
- <%- diff = Hashdiff.diff(previous,current) %>
54
+ <%- diff = ::Hashdiff.diff(previous,current) %>
55
55
  <%- changeset = version.changeset.except(:json_attributes).collect{ |change| ["+", change[0], change[1][1]] }.flatten %>
56
56
  <%- diff << changeset %>
57
57
  <%- diff.each do |d| %>
@@ -75,7 +75,7 @@
75
75
  <% else %>
76
76
  <%- current = version.changeset %>
77
77
  <%- previous = {} %>
78
- <%- diff = Hashdiff.diff(previous,current) %>
78
+ <%- diff = ::Hashdiff.diff(previous,current) %>
79
79
  <%- changeset = version.changeset.except(:json_attributes, :updated_at).collect{ |change| ["+", change[0], change[1][1]] }.flatten %>
80
80
 
81
81
  <%- diff.each do |d| %>
@@ -1,64 +1,65 @@
1
1
  <%- @page_title = "GBL♦Admin - Elements" %>
2
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>
3
+ <div class="row mb-2">
4
+ <div class="col">
5
+ <h1 style="width:100%;">
6
+ Elements
7
+ <%= link_to '+ New Element', new_admin_element_path, { class: 'btn btn-primary float-right' } %>
8
+ </h1>
7
9
 
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>
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>
9
11
 
10
- <h6>
11
- <span class='float-left mt-3'>
12
- <%== pagy_info(@pagy) %>
13
- </span>
14
- <span class='float-right'>
15
- <%== pagy_bootstrap_nav(@pagy) %>
16
- </span>
17
- </h6>
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>
18
20
 
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>
21
+ <table class="table table-striped table-bordered sortable">
22
+ <thead class="thead-dark">
23
+ <tr>
24
+ <th class="header">Label</th>
25
+ <th class="header">Solr field</th>
26
+ <th class="header">Field definition</th>
27
+ <th class="header">Field type</th>
28
+ <th class="header">Required</th>
29
+ <th class="header">Repeatable</th>
30
+ <th class="header">Reorder</th>
31
+ <th class="header" colspan="3">Actions</th>
32
+ </tr>
33
+ </thead>
32
34
 
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">&varr;</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>
35
+ <tbody>
36
+ <% @elements.each do |element| %>
37
+ <tr data-id="<%=element.id%>">
38
+ <td><%= link_to element.label, admin_element_path(element) %></td>
39
+ <td><%= element.solr_field %></td>
40
+ <td><%= element.field_definition.present? ? link_to( element.field_definition, element.field_definition) : '' %></td>
41
+ <td><%= element.field_type %></td>
42
+ <td><%= element.required %></td>
43
+ <td><%= element.repeatable %></td>
44
+ <td class="handle" style="text-align:center">&varr;</td>
45
+ <td><%= link_to 'Show', admin_element_path(element) %></td>
46
+ <td><%= link_to 'Edit', edit_admin_element_path(element) %></td>
47
+ <td><%= link_to 'Destroy', admin_element_path(element), method: :delete, data: { confirm: 'Are you sure?' } %></td>
48
+ </tr>
49
+ <% end %>
50
+ </tbody>
51
+ </table>
51
52
 
52
- <h6>
53
- <span class='float-left mt-3'>
54
- <%== pagy_info(@pagy) %>
55
- </span>
56
- <span class='float-right'>
57
- <%== pagy_bootstrap_nav(@pagy) %>
58
- </span>
59
- </h6>
60
-
61
- <br/>
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
+ </div>
62
+ </div>
62
63
 
63
64
  <script>
64
65
  GBLADMIN.SortElements(
@@ -1,45 +1,48 @@
1
1
  <%- @page_title = "GBL♦Admin - Form Elements" %>
2
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>
3
+ <div class="row mb-2">
4
+ <div class="col">
5
+ <h1 style="width:100%;">
6
+ Form Elements
7
+ <%= link_to '+ New Form Element', new_admin_form_element_path, { class: 'btn btn-primary float-right' } %>
8
+ </h1>
7
9
 
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>
10
+ <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
11
 
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>
12
+ <table class="table table-striped table-bordered sortable">
13
+ <thead class="thead-dark">
14
+ <tr>
15
+ <th class="header">Type</th>
16
+ <th class="header">Label</th>
17
+ <th class="header">Element</th>
18
+ <th class="header">Reorder</th>
19
+ <th class="header" colspan="2">Actions</th>
20
+ </tr>
21
+ </thead>
20
22
 
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">&varr;</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>
23
+ <tbody>
24
+ <% @form_elements.order(:position => :asc).each do |form_element| %>
25
+ <tr data-id="<%=form_element.id%>">
26
+ <td><%= form_element.type %></td>
27
+ <td><%= form_element.label %></td>
28
+ <td>
29
+ <%- if form_element.element_solr_field.present? %>
30
+ <%= Element.find_by(solr_field: form_element.element_solr_field)&.label %>
31
+ <%- end %>
32
+ </td>
33
+ <td class="handle" style="text-align:center">&varr;</td>
34
+ <td><%= link_to 'Edit', edit_admin_form_element_path(form_element) %></td>
35
+ <td><%= link_to 'Destroy', admin_form_element_path(form_element), method: :delete, data: { confirm: 'Are you sure?' } %></td>
36
+ </tr>
37
+ <% end %>
38
+ </tbody>
39
+ </table>
39
40
 
40
- <br>
41
+ <br>
41
42
 
42
- <%= link_to '+ New Form Element', new_admin_form_element_path, { class: 'btn btn-primary' } %>
43
+ <%= link_to '+ New Form Element', new_admin_form_element_path, { class: 'btn btn-primary' } %>
44
+ </div>
45
+ </div>
43
46
 
44
47
  <script>
45
48
  GBLADMIN.SortElements(
@@ -1,56 +1,58 @@
1
1
  <%- @page_title = "GBL♦Admin - Imports" %>
2
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>
3
+ <div class="row mb-2">
4
+ <div class="col">
5
+ <h1 style="width:100%;">
6
+ Imports
7
+ <%= link_to '+ New Import', new_admin_import_path, { class: 'btn btn-primary float-right' } %>
8
+ </h1>
7
9
 
8
- <h6>
9
- <span class='float-left mt-3'>
10
- <%== pagy_info(@pagy) %>
11
- </span>
12
- <span class='float-right'>
13
- <%== pagy_bootstrap_nav(@pagy) %>
14
- </span>
15
- </h6>
10
+ <h6>
11
+ <span class='float-left mt-3'>
12
+ <%== pagy_info(@pagy) %>
13
+ </span>
14
+ <span class='float-right'>
15
+ <%== pagy_bootstrap_nav(@pagy) %>
16
+ </span>
17
+ </h6>
16
18
 
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>
19
+ <table class="table table-striped table-bordered sortable">
20
+ <thead class="thead-dark">
21
+ <tr>
22
+ <th class="header">Name</th>
23
+ <th class="header">Filename</th>
24
+ <th class="header">Source</th>
25
+ <th class="header">Description</th>
26
+ <th class="header">Row count</th>
27
+ <th class="header">Date</th>
28
+ <th class="header" colspan="3">Actions</th>
29
+ </tr>
30
+ </thead>
29
31
 
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>
32
+ <tbody>
33
+ <% @imports.each do |import| %>
34
+ <tr>
35
+ <td><%= import.name %></td>
36
+ <td><%= import.filename %></td>
37
+ <td><%= import.source %></td>
38
+ <td><%= import.description %></td>
39
+ <td><%= import.row_count %></td>
40
+ <td><%= import.created_at %></td>
41
+ <td><%= link_to 'Show', admin_import_path(import) %></td>
42
+ <td><%= link_to 'Edit', edit_admin_import_path(import) %></td>
43
+ <td><%= link_to 'Destroy', admin_import_path(import), method: :delete, data: { confirm: 'Are you sure?' } %></td>
44
+ </tr>
45
+ <% end %>
46
+ </tbody>
47
+ </table>
46
48
 
47
- <h6>
48
- <span class='float-left mt-3'>
49
- <%== pagy_info(@pagy) %>
50
- </span>
51
- <span class='float-right'>
52
- <%== pagy_bootstrap_nav(@pagy) %>
53
- </span>
54
- </h6>
55
-
56
- <br/>
49
+ <h6>
50
+ <span class='float-left mt-3'>
51
+ <%== pagy_info(@pagy) %>
52
+ </span>
53
+ <span class='float-right'>
54
+ <%== pagy_bootstrap_nav(@pagy) %>
55
+ </span>
56
+ </h6>
57
+ </div>
58
+ </div>
@@ -6,8 +6,11 @@
6
6
  <%= csp_meta_tag %>
7
7
 
8
8
  <%= stylesheet_link_tag "application", media: "all" %>
9
- <%= javascript_include_tag "geoblacklight_admin", "data-turbolinks-track": "reload" %>
10
- <%= javascript_pack_tag "application", "data-turbolinks-track": "reload" %>
9
+ <%= javascript_include_tag "application", "data-turbolinks-track": "reload" %>
10
+
11
+ <!-- Vite -->
12
+ <%= vite_client_tag %>
13
+ <%= vite_javascript_tag 'application', media: 'all' %>
11
14
 
12
15
  <script src="https://unpkg.com/@popperjs/core@2"></script>
13
16
  <script type="text/javascript" src="https://cdn.jsdelivr.net/momentjs/latest/moment.min.js"></script>
@@ -18,12 +21,12 @@
18
21
 
19
22
  <body data-locale="en">
20
23
  <%= render "admin/shared/navbar" %>
21
- <div class="container-fluid">
24
+ <main class="container-fluid">
22
25
  <%= render "admin/shared/schema_timestamp" %>
23
26
  <%= render "admin/shared/flash_messages" %>
24
27
  <div id="toast-wrapper" aria-live="polite" aria-atomic="true"></div>
25
28
  <%= yield %>
26
- </div>
29
+ </main>
27
30
  <%= render "admin/shared/footer" %>
28
31
  <%= render "admin/shared/js_behaviors" %>
29
32
  </body>
@@ -112,9 +112,12 @@
112
112
  row.appendChild(document.createElement("td")).innerText = size;
113
113
 
114
114
  // Storage type control, put in params keyed by file ID
115
+ // Removed - we are always using public storage for now
116
+
117
+ // References control, put in params keyed by file ID
115
118
  row.appendChild(document.createElement("td")).innerHTML =
116
- "<select name='storage_type_for[" + shrineHash.id + "]' class='form-control derivative-storage-type'>" +
117
- "<option>public</option><option>restricted</option>" +
119
+ "<select name='dct_references_for[" + shrineHash.id + "]' class='form-control dct-references-s'>" +
120
+ "<%= assets_dct_references_options %>" +
118
121
  "</select>";
119
122
 
120
123
  row.appendChild(document.createElement("td")).innerHTML =
@@ -144,4 +147,4 @@
144
147
  console.log('Upload complete! We’ve uploaded these files:', result.successful)
145
148
  })
146
149
  }
147
- </script>
150
+ </script>
@@ -1,4 +1,4 @@
1
- <nav class="navbar fixed-top navbar-expand-lg navbar-light bg-light">
1
+ <nav class="navbar fixed-top navbar-expand-lg navbar-light bg-light pt-2 pb-2">
2
2
  <a class="navbar-brand gbl-admin" href="<%=admin_documents_url%>">
3
3
  <strong>GBL♦Admin</strong>
4
4
  </a>
@@ -48,6 +48,7 @@
48
48
  <%= link_to "Imports", admin_imports_path, {class: 'dropdown-item'} %>
49
49
  <%= link_to "Bulk Actions", admin_bulk_actions_path, {class: 'dropdown-item'} %>
50
50
  <div class="dropdown-divider"></div>
51
+ <%= link_to "Assets", admin_assets_path, {class: 'dropdown-item'} %>
51
52
  <%= link_to "Access Links", admin_document_accesses_path, {class: 'dropdown-item'} %>
52
53
  <%= link_to "Download Links", admin_document_downloads_path, {class: 'dropdown-item'} %>
53
54
  <div class="dropdown-divider"></div>
@@ -58,15 +59,17 @@
58
59
  <div class="dropdown-divider"></div>
59
60
  <%= link_to "Users", admin_users_index_path, {class: 'dropdown-item'} %>
60
61
  </div>
61
- <li class="nav-item">
62
- <%= link_to "Bookmarks", admin_bookmarks_path, {class: 'nav-link'} if current_user %>
63
62
  </li>
64
63
  <% if user_signed_in? %>
65
- <li class="nav-item">
66
- <%= link_to "Sign out", destroy_user_session_path, { :method => :delete, class: 'nav-link'} %>
67
- </li>
68
- <li class="nav-item">
69
- <%= link_to(current_user.email, edit_user_registration_path, {class: 'nav-link'}) %>
64
+ <li class="nav-item dropdown">
65
+ <a class="nav-link dropdown-toggle" href="#" id="navbarDropdownUser" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
66
+ <%= current_user.email %>
67
+ </a>
68
+ <div class="dropdown-menu" aria-labelledby="navbarDropdownUser">
69
+ <%= link_to "Bookmarks #{bookmarks_badge}".html_safe, admin_bookmarks_path, {class: 'dropdown-item'} %>
70
+ <%= link_to("Edit User Account", edit_user_registration_path, {class: 'dropdown-item'}) %>
71
+ <%= link_to "Sign Out", destroy_user_session_path, { :method => :delete, class: 'dropdown-item'} %>
72
+ </div>
70
73
  </li>
71
74
  <% else %>
72
75
  <li class="nav-item">
@@ -185,6 +185,12 @@ en:
185
185
  harvard_download: Harvard Download
186
186
  open_index_map: OpenIndexMap
187
187
  oembed: oEmbed
188
+ cog: Cloud Optimized GeoTIFF (COG)
189
+ pmtiles: PMTiles
190
+ xyz_tiles: XYZ Tiles (XYZ)
191
+ wmts: Web Map Tile Service (WMTS)
192
+ tile_json: TileJSON
193
+ tile_map_service: Tile Map Service (TMS)
188
194
 
189
195
  simple_form:
190
196
  hints:
data/config/routes.rb CHANGED
@@ -74,6 +74,7 @@ GeoblacklightAdmin::Engine.routes.draw do
74
74
 
75
75
  resources :documents do
76
76
  get "versions"
77
+ get "admin"
77
78
 
78
79
  resources :document_accesses, path: "access" do
79
80
  collection do
data/config/vite.json ADDED
@@ -0,0 +1,14 @@
1
+ {
2
+ "all": {
3
+ "sourceCodeDir": "app/javascript",
4
+ "publicOutputDir": "geoblacklight-admin",
5
+ "watchAdditionalPaths": []
6
+ },
7
+ "development": {
8
+ "autoBuild": true,
9
+ "port": 3037
10
+ },
11
+ "test": {
12
+ "autoBuild": true
13
+ }
14
+ }
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ class CreateDocumentThumbnailStatesman < ActiveRecord::Migration[7.0]
4
+ def change
5
+ create_table 'document_thumbnail_transitions', force: :cascade do |t|
6
+ t.string 'to_state', null: false
7
+ t.text 'metadata', default: '{}'
8
+ t.integer 'sort_key', null: false
9
+ t.uuid 'kithe_model_id', null: false
10
+ t.boolean 'most_recent', null: false
11
+ t.datetime 'created_at', precision: 6, null: false
12
+ t.datetime 'updated_at', precision: 6, null: false
13
+ t.index %w[kithe_model_id most_recent], name: 'thumbnail_transitions_parent_most_recent', unique: true,
14
+ where: 'most_recent'
15
+ t.index %w[kithe_model_id sort_key], name: 'thumbnail_transitions_parent_sort', unique: true
16
+ end
17
+ end
18
+ end