geoblacklight_admin 0.4.1 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
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
@@ -0,0 +1,39 @@
1
+ <div class="scihist-attach-files">
2
+
3
+ <h1>Add Files</h1>
4
+ <h2>To: General Application Asset Pool</h2>
5
+ <p>Once the files have been uploaded and are ready for attachment, you can proceed to Attach.</p>
6
+
7
+ <%= form_with(url: admin_asset_files_ingest_path, method: :post, local: true) do |form| %>
8
+
9
+ <div class="row">
10
+
11
+ <div class="col-md-6 mb-3">
12
+ <h2>1. Upload Files</h2>
13
+
14
+ <%= content_tag "div", class: "uppy-dashboard-container", data: Admin::UploadUtil.kithe_upload_data_config do %>
15
+ <% end %>
16
+ </div>
17
+
18
+ <div class="col-sm-6">
19
+ <h2>2. Attach Files</h2>
20
+ <div class="d-flex justify-content-between">
21
+ <%= form.submit "Attach", class: "btn btn-primary btn-lg", data: { toggle: "kithe-upload-submit" } %>
22
+ <%= link_to "Cancel", admin_assets_url,
23
+ class: "btn btn-outline-secondary btn-lg",
24
+ data: { confirm: "Cancel attach files?" }
25
+ %>
26
+ </div>
27
+ <table class="table table-sm mt-3 attach-files-table" data-toggle="cached-files-table">
28
+ <tr>
29
+ <th class="attach-files-table-filename">Filename</th>
30
+ <th class="attach-files-table-size">Size</th>
31
+ <th class="attach-files-table-references">References</th>
32
+ <th class="attach-files-table-remove"></th>
33
+ </tr>
34
+ </table>
35
+ </div>
36
+ </div>
37
+
38
+ <% end %>
39
+ </div>
@@ -0,0 +1,9 @@
1
+ <h1>Editing Asset</h1>
2
+ <p class="alert alert-warning">Only reason for this form is to add a missing parent_id to an asset.</p>
3
+
4
+ <%= simple_form_for(@asset, :url => admin_asset_path) do |f| %>
5
+ <%= render 'form', asset: @asset, f: f %>
6
+ <% end %>
7
+
8
+ <%= link_to 'Show', admin_asset_path(@asset) %> |
9
+ <%= link_to 'Back', admin_assets_path %>
@@ -0,0 +1,75 @@
1
+ <%- @page_title = "GBL♦Admin - Assets" %>
2
+
3
+ <div class="row mb-2">
4
+ <div class="col">
5
+ <h1 style="width:100%;">
6
+ Assets
7
+ <%= link_to '+ Upload Assets', display_attach_form_admin_assets_url, { class: 'btn btn-primary float-right mr-2' } %>
8
+ </h1>
9
+
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>
18
+
19
+ <table class="table table-striped table-bordered sortable">
20
+ <thead class="thead-dark">
21
+ <tr>
22
+ <th colspan="10">
23
+ <span class="sr-only">Search Assets</span>
24
+ <%= form_tag admin_assets_path, method: :get, class: "form-inline float-right" do %>
25
+ <%= text_field_tag :q, params[:q], class: "form-control mr-2", placeholder: "Search*" %>
26
+ <%= submit_tag "Search", class: "btn btn-primary" %>
27
+ <% end %>
28
+ </th>
29
+ </tr>
30
+ <tr>
31
+ <th class="header">ID*</th>
32
+ <th class="header">File Name*</th>
33
+ <th class="header">MimeType</th>
34
+ <th class="header">Thumbnail</th>
35
+ <th class="header">Parent ID*</th>
36
+ <th class="header">Parent Title</th>
37
+ <th class="header">Created At*</th>
38
+ <th class="header" colspan="3">Actions</th>
39
+ </tr>
40
+ </thead>
41
+
42
+ <tbody>
43
+ <% @assets.each do |asset| %>
44
+ <tr data-id="<%= asset.id %>">
45
+ <td><%= asset.id %></td>
46
+ <td><%= link_to asset.title, asset.file.url %></td>
47
+ <td><%= asset.file_data["metadata"]["mime_type"] %></td>
48
+ <td>
49
+ <% if asset.respond_to?(:thumbnail) %>
50
+ <% unless asset.file_url(:thumb_standard_2X).nil? %>
51
+ <%= image_tag(asset.file_url(:thumb_standard_2X), { height: 100 }) %>
52
+ <% end %>
53
+ <% end %>
54
+ </td>
55
+ <td><%= asset.parent.id if asset.parent.present? %></td>
56
+ <td><%= link_to asset.parent.title, admin_document_path(asset.parent.friendlier_id) if asset.parent.present? %></td>
57
+ <td><%= asset.created_at %></td>
58
+ <td><%= link_to 'Show', admin_asset_path(asset.id) %></td>
59
+ <td><%= link_to 'Edit', edit_admin_asset_path(asset.id) %></td>
60
+ <td><%= link_to 'Destroy', admin_asset_path(asset.id), method: :delete, data: { confirm: 'Are you sure?' } %></td>
61
+ </tr>
62
+ <% end %>
63
+ </tbody>
64
+ </table>
65
+
66
+ <h6>
67
+ <span class='float-left mt-3'>
68
+ <%== pagy_info(@pagy) %>
69
+ </span>
70
+ <span class='float-right'>
71
+ <%== pagy_bootstrap_nav(@pagy) %>
72
+ </span>
73
+ </h6>
74
+ </div>
75
+ </div>
@@ -0,0 +1,100 @@
1
+ <%- @page_title = "GBL♦Admin - Asset - #{@asset.title}" %>
2
+
3
+ <%= link_to 'Back to Assets', admin_assets_path, {class: "mb-2"} %>
4
+
5
+ <h1 class="mt-1">Asset</h1>
6
+
7
+ <div class="row">
8
+ <div class="col-12">
9
+ <h2>
10
+ <% if @asset.parent.present? %>
11
+ <%= link_to @asset.parent.title, admin_document_path(@asset.parent.friendlier_id) %>
12
+ &middot; <%= @asset.title %>
13
+ <% else %>
14
+ <%= @asset.title %>
15
+ <% end %>
16
+ <%= link_to '- Delete Asset', admin_asset_path, { class: 'btn btn-danger float-right ml-2', method: :delete, data: { confirm: 'Are you sure?' } } %>
17
+ <%= link_to '~ Edit Asset', edit_admin_asset_path(@asset.id), { class: 'btn btn-primary float-right'} %>
18
+ </h2>
19
+
20
+ <table class="table table-bordered">
21
+ <thead class="thead-dark">
22
+ <tr>
23
+ <th class="header" style="width:300px;">Attribute</th>
24
+ <th class="header">Value</th>
25
+ </tr>
26
+ </thead>
27
+ <tr>
28
+ <th>Title</th>
29
+ <td><%= @asset.title %></td>
30
+ </tr>
31
+ <tr>
32
+ <th>Asset Link</th>
33
+ <td><%= link_to "Asset Link", @asset.file.url %></td>
34
+ </tr>
35
+ <% if asset_thumb_to_render?(@asset) %>
36
+ <tr>
37
+ <th>Thumbnail</th>
38
+ <td><%= image_tag(@asset.file_url(:thumb_standard_2X)) %></td>
39
+ </tr>
40
+ <% end %>
41
+ <tr>
42
+ <th>Type</th>
43
+ <td><%= @asset.type %></td>
44
+ </tr>
45
+ <tr>
46
+ <th>Position</th>
47
+ <td><%= @asset.position %></td>
48
+ </tr>
49
+ <tr>
50
+ <th>JSON Attributes</th>
51
+ <td><%= ap(JSON.parse(@asset.json_attributes.to_json)).html_safe %></td>
52
+ </tr>
53
+ <% if @asset.parent.present? %>
54
+ <tr>
55
+ <th>Parent Title</th>
56
+ <td><%= @asset.parent.title %></td>
57
+ </tr>
58
+ <tr>
59
+ <th>Parent ID</th>
60
+ <td><%= @asset.parent_id %></td>
61
+ </tr>
62
+ <tr>
63
+ <th>Parent Link</th>
64
+ <td><%= link_to(@asset.parent.friendlier_id, admin_document_path(@asset.parent)) %></td>
65
+ </tr>
66
+ <% else %>
67
+ <tr>
68
+ <th>Parent ID</th>
69
+ <td>FALSE</td>
70
+ </tr>
71
+ <% end %>
72
+ <tr>
73
+ <th>Friendlier ID</th>
74
+ <td><%= @asset.friendlier_id %></td>
75
+ </tr>
76
+ <tr>
77
+ <th>File Data</th>
78
+ <td><%= ap(JSON.parse(@asset.file_data.to_json)).html_safe %></td>
79
+ </tr>
80
+ <% if @asset.respond_to?(:thumbnail) && @asset.file_derivatives(:thumb_standard_2X)&.exists? %>
81
+ <tr>
82
+ <th>Derivatives</th>
83
+ <td>
84
+ <% @asset.file_derivatives.each do |derivative| %>
85
+ <%= image_tag(@asset.file_url(derivative.first)) %>
86
+ <% end %>
87
+ </td>
88
+ </tr>
89
+ <% end %>
90
+ <tr>
91
+ <th>Created At</th>
92
+ <td><%= @asset.created_at %></td>
93
+ </tr>
94
+ <tr>
95
+ <th>Updated At</th>
96
+ <td><%= @asset.updated_at %></td>
97
+ </tr>
98
+ </table>
99
+ </div>
100
+ </div>
@@ -1,54 +1,56 @@
1
1
  <%- @page_title = "GBL♦Admin - Bulk Actions" %>
2
2
 
3
- <h1 style="width:100%;">
4
- Bulk Actions
5
- <%= link_to '+ Bulk Action', new_bulk_action_path, { class: 'btn btn-primary float-right invisible' } %>
6
- </h1>
3
+ <div class="row mb-2">
4
+ <div class="col">
5
+ <h1 style="width:100%;">
6
+ Bulk Actions
7
+ <%= link_to '+ Bulk Action', new_bulk_action_path, { class: 'btn btn-primary float-right invisible' } %>
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">Scope</th>
22
- <th class="header">Field</th>
23
- <th class="header">Value</th>
24
- <th class="header">Date</th>
25
- <th class="header" colspan="3"></th>
26
- </tr>
27
- </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">Scope</th>
24
+ <th class="header">Field</th>
25
+ <th class="header">Value</th>
26
+ <th class="header">Date</th>
27
+ <th class="header" colspan="3"></th>
28
+ </tr>
29
+ </thead>
28
30
 
29
- <tbody>
30
- <% @bulk_actions.each do |bulk_action| %>
31
- <tr>
32
- <td><%= bulk_action.name %></td>
33
- <td><%= CGI.unescape(bulk_action.scope) %></td>
34
- <td><%= bulk_action.field_name %></td>
35
- <td><%= bulk_action.field_value %></td>
36
- <td><%= bulk_action.created_at %></td>
37
- <td><%= link_to 'Show', admin_bulk_action_path(bulk_action) %></td>
38
- <td><%= link_to 'Edit', edit_bulk_action_path(bulk_action) %></td>
39
- <td><%= link_to 'Destroy', admin_bulk_action_path(bulk_action), method: :delete, data: { confirm: 'Are you sure?' } %></td>
40
- </tr>
41
- <% end %>
42
- </tbody>
43
- </table>
31
+ <tbody>
32
+ <% @bulk_actions.each do |bulk_action| %>
33
+ <tr>
34
+ <td><%= bulk_action.name %></td>
35
+ <td><%= CGI.unescape(bulk_action.scope) %></td>
36
+ <td><%= bulk_action.field_name %></td>
37
+ <td><%= bulk_action.field_value %></td>
38
+ <td><%= bulk_action.created_at %></td>
39
+ <td><%= link_to 'Show', admin_bulk_action_path(bulk_action) %></td>
40
+ <td><%= link_to 'Edit', edit_bulk_action_path(bulk_action) %></td>
41
+ <td><%= link_to 'Destroy', admin_bulk_action_path(bulk_action), method: :delete, data: { confirm: 'Are you sure?' } %></td>
42
+ </tr>
43
+ <% end %>
44
+ </tbody>
45
+ </table>
44
46
 
45
- <h6>
46
- <span class='float-left mt-3'>
47
- <%== pagy_info(@pagy) %>
48
- </span>
49
- <span class='float-right'>
50
- <%== pagy_bootstrap_nav(@pagy) %>
51
- </span>
52
- </h6>
53
-
54
- <br/>
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
+ </div>
56
+ </div>
@@ -69,8 +69,9 @@
69
69
  <%== pagy_bootstrap_nav(@pagy) %>
70
70
  </span>
71
71
  </h6>
72
- <table class="table table-striped">
73
- <thead>
72
+
73
+ <table class="table table-striped table-bordered">
74
+ <thead class="thead-dark">
74
75
  <tr>
75
76
  <th>Rails/Database ID</th>
76
77
  <th>Aardvark ID</th>
@@ -1,74 +1,78 @@
1
1
  <%- @page_title = "GBL♦Admin - Document - Access Links" %>
2
2
 
3
- <h1 style="width:100%;">
4
- Document &middot; Access Links
3
+ <div class="row mb-2">
4
+ <div class="col">
5
+ <h1 style="width:100%;">
6
+ Document &middot; Access Links
5
7
 
6
- <% if params[:document_id] %>
7
- <%= link_to '+ Import CSV', import_admin_document_document_accesses_path(@document), { class: 'btn btn-primary float-right' } %>
8
+ <% if params[:document_id] %>
9
+ <%= link_to '+ Import CSV', import_admin_document_document_accesses_path(@document), { class: 'btn btn-primary float-right' } %>
8
10
 
9
- <%= link_to '+ New Access URL', new_admin_document_document_access_path(@document), { class: 'btn btn-primary float-right mr-2' } %>
10
- <% else %>
11
- <%= link_to '- Delete CSV', destroy_all_admin_document_accesses_path, { class: 'btn btn-danger float-right' } %>
12
- <%= link_to '+ Import CSV', import_admin_document_accesses_path, { class: 'btn btn-primary float-right mr-4' } %>
13
- <% end %>
14
- </h1>
15
- <% if params[:document_id] %>
16
- <h2 class='h3'>
17
- <%= link_to(@document.title, admin_document_path(@document)) %>
18
- &middot;
19
- <%= @document_accesses.count %> urls
20
- </h2>
21
- <% else %>
22
- <h2 class='h3'>Institutional Access Links</h2>
23
- <% end %>
11
+ <%= link_to '+ New Access URL', new_admin_document_document_access_path(@document), { class: 'btn btn-primary float-right mr-2' } %>
12
+ <% else %>
13
+ <%= link_to '- Delete CSV', destroy_all_admin_document_accesses_path, { class: 'btn btn-danger float-right' } %>
14
+ <%= link_to '+ Import CSV', import_admin_document_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_accesses.count %> urls
22
+ </h2>
23
+ <% else %>
24
+ <h2 class='h3'>Institutional Access Links</h2>
25
+ <% end %>
24
26
 
25
- <% if @pagy %>
26
- <h6>
27
- <span class='float-left mt-3'>
28
- <%== pagy_info(@pagy) %>
29
- </span>
30
- <span class='float-right'>
31
- <%== pagy_bootstrap_nav(@pagy) %>
32
- </span>
33
- </h6>
34
- <% end %>
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 %>
35
37
 
36
38
 
37
- <table class="table table-striped table-bordered sortable">
38
- <thead class="thead-dark">
39
- <tr>
40
- <th class="header" colspan="2">Actions</th>
41
- <th class="header">Layer Slug</th>
42
- <th class="header">Institution Code</th>
43
- <th class="header">Institution Name</th>
44
- <th class="header" style="max-width:200px;">Access URL</th>
45
- </tr>
46
- </thead>
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>
47
50
 
48
- <tbody>
49
- <% @document_accesses.each do |document_access| %>
50
- <tr>
51
- <td><%= link_to 'Edit', edit_admin_document_document_access_path(document_access.document, document_access) %></td>
52
- <td><%= link_to 'Destroy', admin_document_document_access_path(document_access.document, document_access), method: :delete, data: { confirm: 'Are you sure?' } %></td>
53
- <td><%= link_to document_access.friendlier_id, admin_document_path(document_access.document) %></td>
54
- <td><%= document_access.institution_code %></td>
55
- <td><%= b1g_institution_codes[document_access.institution_code] %></td>
56
- <td><%= link_to(document_access.access_url, document_access.access_url) %></td>
57
- </tr>
58
- <% end %>
59
- </tbody>
60
- </table>
51
+ <tbody>
52
+ <% @document_accesses.each do |document_access| %>
53
+ <tr>
54
+ <td><%= document_access.id %></td>
55
+ <td><%= link_to document_access.friendlier_id, admin_document_path(document_access.document) %></td>
56
+ <td><%= document_access.institution_code %></td>
57
+ <td><%= b1g_institution_codes[document_access.institution_code] %></td>
58
+ <td><%= link_to(document_access.access_url, document_access.access_url) %></td>
59
+ <td><%= link_to 'Edit', edit_admin_document_document_access_path(document_access.document, document_access) %></td>
60
+ <td><%= link_to 'Destroy', admin_document_document_access_path(document_access.document, document_access), method: :delete, data: { confirm: 'Are you sure?' } %></td>
61
+ </tr>
62
+ <% end %>
63
+ </tbody>
64
+ </table>
61
65
 
62
- <% if @pagy %>
63
- <h6>
64
- <span class='float-left mt-3'>
65
- <%== pagy_info(@pagy) %>
66
- </span>
67
- <span class='float-right'>
68
- <%== pagy_bootstrap_nav(@pagy) %>
69
- </span>
70
- </h6>
71
- <% end %>
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>
72
78
  </div>
73
-
74
- <br>
@@ -0,0 +1,17 @@
1
+ <%= @document_asset.class %>
2
+
3
+ <%= simple_form_for [:admin, @document, @document_asset], :url => admin_document_document_asset_path(@document, @document_asset) do |f| %>
4
+ <%= f.error_notification %>
5
+ <%= f.error_notification message: f.object.errors[:base].to_sentence if f.object.errors[:base].present? %>
6
+
7
+ <div class="form-inputs">
8
+ <%= f.input :parent_id, input_html: { value: @document.friendlier_id, readonly: true } %>
9
+ <%= f.input :title %>
10
+ <%= f.input :label %>
11
+ <%= f.input :dct_references_uri_key, collection: I18n.t("activemodel.enum_values.document/reference.category").invert.sort.insert(0, ["Choose Reference Type", nil]), label: 'Reference' %>
12
+ </div>
13
+
14
+ <div class="form-actions">
15
+ <%= f.button :submit, 'Save Asset', {class: 'btn btn-primary'} %>
16
+ </div>
17
+ <% end %>
@@ -1,8 +1,8 @@
1
1
  <div class="scihist-attach-files">
2
2
 
3
3
  <h1>Add Files</h1>
4
- <p>To: <%= @document.title %> (<%= @document.friendlier_id %>)
5
- <p>Once the files have been uploaded and are ready for attachment, you can proceed to Attach</p>
4
+ <h2>To: <%= @document.title %> (<%= @document.friendlier_id %>)</h2>
5
+ <p>Once the files have been uploaded and are ready for attachment, you can proceed to Attach.</p>
6
6
 
7
7
  <%= form_with(url: admin_asset_ingest_path(@document && @document.friendlier_id), method: :post, local: true) do |form| %>
8
8
 
@@ -16,7 +16,7 @@
16
16
  </div>
17
17
 
18
18
  <div class="col-sm-6">
19
- <h2>2. Attach files</h2>
19
+ <h2>2. Attach Files</h2>
20
20
  <div class="d-flex justify-content-between">
21
21
  <%= form.submit "Attach", class: "btn btn-primary btn-lg", data: { toggle: "kithe-upload-submit" } %>
22
22
  <%= link_to "Cancel", admin_document_path(@document),
@@ -24,16 +24,11 @@
24
24
  data: { confirm: "Cancel attach files?" }
25
25
  %>
26
26
  </div>
27
- <p class="text-muted small mt-3">
28
- <i class="fa fa-info-circle mr-2" aria-hidden="true"></i>
29
- Use the <b>restricted</b> storage type for confidential files such as restricted oral histories.
30
- Otherwise, normally use <b>public</b> storage type.
31
- </p>
32
27
  <table class="table table-sm mt-3 attach-files-table" data-toggle="cached-files-table">
33
28
  <tr>
34
29
  <th class="attach-files-table-filename">Filename</th>
35
30
  <th class="attach-files-table-size">Size</th>
36
- <th class="attach-files-table-storage-type">Storage Type</th>
31
+ <th class="attach-files-table-references">References</th>
37
32
  <th class="attach-files-table-remove"></th>
38
33
  </tr>
39
34
  </table>
@@ -0,0 +1,5 @@
1
+ <h1>Editing Document Asset</h1>
2
+
3
+ <%= render 'form', document_asset: @document_asset %>
4
+
5
+ <%= link_to 'Back', admin_document_document_assets_path(@document) %>