geoblacklight_admin 0.8.0 → 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.
- checksums.yaml +4 -4
- data/app/controllers/admin/document_licensed_accesses_controller.rb +169 -0
- data/app/controllers/admin/documents_controller.rb +12 -12
- data/app/controllers/admin/elements_controller.rb +1 -1
- data/app/controllers/admin/import_distributions_controller.rb +2 -1
- data/app/controllers/admin/imports_controller.rb +2 -1
- data/app/indexers/document_indexer.rb +2 -2
- data/app/javascript/controllers/results_controller.js +5 -15
- data/app/jobs/bulk_action_run_document_job.rb +12 -2
- data/app/jobs/export_job.rb +40 -30
- data/app/jobs/export_json_bulk_job.rb +1 -1
- data/app/jobs/export_json_job.rb +1 -1
- data/app/jobs/import_document_job.rb +12 -1
- data/app/jobs/import_run_job.rb +5 -0
- data/app/models/asset.rb +13 -3
- data/app/models/document/controlled_lists.rb +3 -2
- data/app/models/document/date_validator.rb +14 -12
- data/app/models/document.rb +21 -107
- data/app/models/{document_access.rb → document_licensed_access.rb} +8 -6
- data/app/models/geoblacklight_admin/schema.rb +0 -10
- data/app/models/import_document.rb +5 -0
- data/app/services/export_csv_document_distributions_service.rb +8 -4
- data/app/services/export_csv_document_licensed_access_links_service.rb +27 -0
- data/app/services/export_csv_service.rb +5 -1
- data/app/views/admin/document_assets/_assets_table.html.erb +4 -0
- data/app/views/admin/document_assets/index.html.erb +3 -1
- data/app/views/admin/document_distributions/destroy_all.html.erb +1 -1
- data/app/views/admin/document_distributions/index.html.erb +5 -7
- data/app/views/admin/document_licensed_accesses/_document_licensed_access.json.jbuilder +4 -0
- data/app/views/admin/{document_accesses → document_licensed_accesses}/_form.html.erb +4 -5
- data/app/views/admin/{document_accesses → document_licensed_accesses}/destroy_all.html.erb +7 -7
- data/app/views/admin/document_licensed_accesses/edit.html.erb +5 -0
- data/app/views/admin/{document_accesses → document_licensed_accesses}/import.html.erb +12 -9
- data/app/views/admin/document_licensed_accesses/index.html.erb +78 -0
- data/app/views/admin/document_licensed_accesses/index.json.jbuilder +3 -0
- data/app/views/admin/document_licensed_accesses/new.html.erb +8 -0
- data/app/views/admin/documents/_form_control.html.erb +0 -10
- data/app/views/admin/documents/_form_nav.html.erb +3 -12
- data/app/views/admin/documents/_form_nav_kithe.html.erb +0 -4
- data/app/views/admin/documents/_result_selected_options.html.erb +14 -18
- data/app/views/admin/documents/features/_document_references.html.erb +18 -20
- data/app/views/admin/documents/features/_licensed_access.html.erb +3 -0
- data/app/views/admin/elements/index.html.erb +0 -18
- data/app/views/admin/import_distributions/_form.html.erb +1 -1
- data/app/views/admin/import_distributions/_show_queued_tab.html.erb +36 -0
- data/app/views/admin/import_distributions/index.html.erb +3 -3
- data/app/views/admin/import_distributions/new.html.erb +3 -1
- data/app/views/admin/import_distributions/show.html.erb +5 -0
- data/app/views/admin/imports/_form.html.erb +1 -1
- data/app/views/admin/imports/_show_queued_tab.html.erb +31 -0
- data/app/views/admin/imports/index.html.erb +3 -3
- data/app/views/admin/imports/new.html.erb +3 -1
- data/app/views/admin/imports/show.html.erb +6 -0
- data/app/views/admin/notifications/_notification.html.haml +0 -1
- data/app/views/admin/notifications/index.html.erb +2 -2
- data/app/views/admin/notifications/update.js.erb +1 -1
- data/app/views/admin/shared/_navbar.html.erb +9 -8
- data/config/routes.rb +2 -25
- data/db/migrate/20240321000000_rename_document_accesses_to_document_licensed_accesses.rb +5 -0
- data/db/seeds_form_elements.csv +1 -2
- data/db/seeds_form_elements.numbers +0 -0
- data/lib/generators/geoblacklight_admin/config_generator.rb +4 -26
- data/lib/generators/geoblacklight_admin/templates/config/initializers/mime_types.rb +1 -1
- data/lib/geoblacklight_admin/version.rb +1 -1
- metadata +17 -30
- data/app/controllers/admin/document_accesses_controller.rb +0 -169
- data/app/controllers/admin/document_downloads_controller.rb +0 -129
- data/app/models/document_download.rb +0 -39
- data/app/services/export_csv_document_access_links_service.rb +0 -47
- data/app/services/export_csv_document_downloads_service.rb +0 -47
- data/app/views/admin/document_accesses/_document_access.json.jbuilder +0 -4
- data/app/views/admin/document_accesses/edit.html.erb +0 -5
- data/app/views/admin/document_accesses/index.html.erb +0 -78
- data/app/views/admin/document_accesses/index.json.jbuilder +0 -3
- data/app/views/admin/document_accesses/new.html.erb +0 -6
- data/app/views/admin/document_accesses/show.html.erb +0 -19
- data/app/views/admin/document_accesses/show.json.jbuilder +0 -3
- data/app/views/admin/document_downloads/_document_download.json.jbuilder +0 -4
- data/app/views/admin/document_downloads/_form.html.erb +0 -15
- data/app/views/admin/document_downloads/destroy_all.html.erb +0 -70
- data/app/views/admin/document_downloads/edit.html.erb +0 -5
- data/app/views/admin/document_downloads/import.html.erb +0 -74
- data/app/views/admin/document_downloads/index.html.erb +0 -72
- data/app/views/admin/document_downloads/index.json.jbuilder +0 -3
- data/app/views/admin/document_downloads/new.html.erb +0 -5
- data/app/views/admin/document_downloads/show.html.erb +0 -24
- data/app/views/admin/document_downloads/show.json.jbuilder +0 -3
- data/app/views/admin/documents/features/_institutional_access_links.html.erb +0 -3
- data/app/views/admin/documents/features/_multiple_download_links.html.erb +0 -30
@@ -1,19 +0,0 @@
|
|
1
|
-
<p id="notice"><%= notice %></p>
|
2
|
-
|
3
|
-
<p>
|
4
|
-
<strong>Kithe model:</strong>
|
5
|
-
<%= @document_access.kithe_model_id %>
|
6
|
-
</p>
|
7
|
-
|
8
|
-
<p>
|
9
|
-
<strong>Institution code:</strong>
|
10
|
-
<%= @document_access.institution_code %>
|
11
|
-
</p>
|
12
|
-
|
13
|
-
<p>
|
14
|
-
<strong>Access url:</strong>
|
15
|
-
<%= @document_access.access_url %>
|
16
|
-
</p>
|
17
|
-
|
18
|
-
<%= link_to 'Edit', edit_document_access_path(@document_access) %> |
|
19
|
-
<%= link_to 'Back', document_accesses_path %>
|
@@ -1,15 +0,0 @@
|
|
1
|
-
|
2
|
-
<%= simple_form_for([:admin, @document, @document_download]) 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 :friendlier_id, input_html: { value: @document.friendlier_id, readonly: true } %>
|
8
|
-
<%= f.input :label, autofocus: true %>
|
9
|
-
<%= f.input :value, label: 'Download URL' %>
|
10
|
-
</div>
|
11
|
-
|
12
|
-
<div class="form-actions">
|
13
|
-
<%= f.button :submit, 'Create Download URL', {class: 'btn btn-primary'} %>
|
14
|
-
</div>
|
15
|
-
<% end %>
|
@@ -1,70 +0,0 @@
|
|
1
|
-
<p id="notice"><%= notice %></p>
|
2
|
-
|
3
|
-
<h1 style="width:100%; border-bottom:dotted;" class="mb-4">
|
4
|
-
Document · Destroy Download Links
|
5
|
-
<% if params[:document_id] %>
|
6
|
-
<%= link_to '+ New Download Link', new_document_document_download_path(@document), { class: 'btn btn-primary float-right' } %>
|
7
|
-
<% end %>
|
8
|
-
</h1>
|
9
|
-
|
10
|
-
<div class="row">
|
11
|
-
<div class="col-6">
|
12
|
-
<% if params[:document_id] %>
|
13
|
-
<h2 class='h3'><%= @document.title %></h2>
|
14
|
-
<% else %>
|
15
|
-
<h2 class='h3'>Destroy Multiple Download Links</h2>
|
16
|
-
<% end %>
|
17
|
-
|
18
|
-
<p class="alert alert-danger" role="alert">
|
19
|
-
<strong>Warning:</strong> All matching Download Links will be destroyed. There is <strong>NO UNDO</strong> here.
|
20
|
-
</p>
|
21
|
-
<h3 class='h4'>Upload a CSV File</h3>
|
22
|
-
|
23
|
-
<%= simple_form_for DocumentDownload.new, url: destroy_all_admin_document_downloads_path, method: :post, multipart: true do |f| %>
|
24
|
-
<div class="form-group">
|
25
|
-
<div class="form-inputs">
|
26
|
-
<%= f.simple_fields_for :downloads do |download_fields| %>
|
27
|
-
<%= download_fields.input :file, as: :file, input_html: {} %>
|
28
|
-
<%- end %>
|
29
|
-
</div>
|
30
|
-
|
31
|
-
<div class="form-actions">
|
32
|
-
<%= submit_tag "- Destroy All", {class: 'btn btn-danger'} %>
|
33
|
-
</div>
|
34
|
-
</div>
|
35
|
-
<% end %>
|
36
|
-
</div>
|
37
|
-
<div class="col-6">
|
38
|
-
<h4>Example CSV File</h4>
|
39
|
-
<table class="table table-bordered">
|
40
|
-
<thead>
|
41
|
-
<tr>
|
42
|
-
<th>id</th>
|
43
|
-
<th>friendlier_id</th>
|
44
|
-
</tr>
|
45
|
-
</thead>
|
46
|
-
<tbody>
|
47
|
-
<tr>
|
48
|
-
<td>1</td>
|
49
|
-
<td>a35bf4a4-e3ef-483e-98c4-7ea1b04b0f0d</td>
|
50
|
-
</tr>
|
51
|
-
<tr>
|
52
|
-
<td>207</td>
|
53
|
-
<td>a35bf4a4-e3ef-483e-98c4-7ea1b04b0f0d</td>
|
54
|
-
</tr>
|
55
|
-
<tr>
|
56
|
-
<td>...</td>
|
57
|
-
<td>...</td>
|
58
|
-
</tr>
|
59
|
-
</tbody>
|
60
|
-
</table>
|
61
|
-
|
62
|
-
<h5>CSV File Column Definitions</h5>
|
63
|
-
<dl>
|
64
|
-
<dt>id</dt>
|
65
|
-
<dd>The database table row identifier</dd>
|
66
|
-
<dt>friendlier_id</dt>
|
67
|
-
<dd>The associated GBLADMIN document's friendlier id</dd>
|
68
|
-
</dl>
|
69
|
-
</div>
|
70
|
-
</div>
|
@@ -1,74 +0,0 @@
|
|
1
|
-
<p id="notice"><%= notice %></p>
|
2
|
-
|
3
|
-
<h1 style="width:100%; border-bottom:dotted;" class="mb-4">
|
4
|
-
Document · Download Links
|
5
|
-
<% if params[:document_id] %>
|
6
|
-
<%= link_to '+ New Download Link', new_admin_document_document_download_path(@document), { class: 'btn btn-primary float-right' } %>
|
7
|
-
<% end %>
|
8
|
-
</h1>
|
9
|
-
|
10
|
-
<div class="row">
|
11
|
-
<div class="col-6">
|
12
|
-
<% if params[:document_id] %>
|
13
|
-
<h2 class='h3'><%= @document.title %></h2>
|
14
|
-
<% else %>
|
15
|
-
<h2 class='h3'>Import for Multiple Documents</h2>
|
16
|
-
<% end %>
|
17
|
-
|
18
|
-
<p class="alert alert-info" role="alert">
|
19
|
-
<strong>Note:</strong> New Download Links will be created. Existing Download Links will be updated per the CSV file.
|
20
|
-
</p>
|
21
|
-
|
22
|
-
<h3 class="h4">Upload a CSV File</h3>
|
23
|
-
<%= simple_form_for DocumentDownload.new, url: import_admin_document_downloads_path, method: :post, multipart: true do |f| %>
|
24
|
-
<div class="form-inputs">
|
25
|
-
<%= f.simple_fields_for :downloads do |download_fields| %>
|
26
|
-
<%= download_fields.input :file, as: :file, input_html: {} %>
|
27
|
-
<%- end %>
|
28
|
-
</div>
|
29
|
-
|
30
|
-
<div class="form-actions">
|
31
|
-
<%= submit_tag "+ Import CSV", {class: 'btn btn-primary'} %>
|
32
|
-
</div>
|
33
|
-
<% end %>
|
34
|
-
</div>
|
35
|
-
<div class="col-6">
|
36
|
-
<h4>Example CSV File</h4>
|
37
|
-
<table class="table table-bordered">
|
38
|
-
<thead>
|
39
|
-
<tr>
|
40
|
-
<th>friendlier_id</th>
|
41
|
-
<th>label</th>
|
42
|
-
<th>value</th>
|
43
|
-
</tr>
|
44
|
-
</thead>
|
45
|
-
<tbody>
|
46
|
-
<tr>
|
47
|
-
<td>00add5b8-a7b1-42d4-b4de-ca99716a5096</td>
|
48
|
-
<td>GeoTIFF</td>
|
49
|
-
<td>https://s3.amazonaws.com/holc/tiles/WI/Madison/1937/rectified.zip</td>
|
50
|
-
</tr>
|
51
|
-
<tr>
|
52
|
-
<td>00add5b8-a7b1-42d4-b4de-ca99716a5096</td>
|
53
|
-
<td>JPEG</td>
|
54
|
-
<td>https://s3.amazonaws.com/holc/tiles/WI/Madison/1937/holc-scan.jpg</td>
|
55
|
-
</tr>
|
56
|
-
<tr>
|
57
|
-
<td>...</td>
|
58
|
-
<td>...</td>
|
59
|
-
<td>...</td>
|
60
|
-
</tr>
|
61
|
-
</tbody>
|
62
|
-
</table>
|
63
|
-
|
64
|
-
<h5>CSV File Column Definitions</h5>
|
65
|
-
<dl>
|
66
|
-
<dt>friendlier_id</dt>
|
67
|
-
<dd>The associated GEOMG document's friendlier id</dd>
|
68
|
-
<dt>label</dt>
|
69
|
-
<dd>The label for the Download link</dd>
|
70
|
-
<dt>value</dt>
|
71
|
-
<dd>The URL for the Download link</dd>
|
72
|
-
</dl>
|
73
|
-
</div>
|
74
|
-
</div>
|
@@ -1,72 +0,0 @@
|
|
1
|
-
<%- @page_title = "GBL♦Admin - Document - Download Links" %>
|
2
|
-
|
3
|
-
<div class="row mb-2">
|
4
|
-
<div class="col">
|
5
|
-
<h1 style="width:100%;">
|
6
|
-
Document · Download Links
|
7
|
-
|
8
|
-
<% if params[:document_id] %>
|
9
|
-
<%= link_to '+ Import CSV', import_admin_document_document_downloads_path(@document), { class: 'btn btn-primary float-right' } %>
|
10
|
-
|
11
|
-
<%= link_to '+ New Download URL', new_admin_document_document_download_path(@document), { class: 'btn btn-primary float-right mr-2' } %>
|
12
|
-
<% else %>
|
13
|
-
<%= link_to '- Delete CSV', destroy_all_admin_document_downloads_path, { class: 'btn btn-danger float-right' } %>
|
14
|
-
<%= link_to '+ Import CSV', import_admin_document_downloads_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
|
-
·
|
21
|
-
<%= @document_downloads.count %> downloads
|
22
|
-
</h2>
|
23
|
-
<% else %>
|
24
|
-
<h2 class='h3'>Download Links</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
|
-
<table class="table table-striped table-bordered sortable">
|
39
|
-
<thead class="thead-dark">
|
40
|
-
<tr>
|
41
|
-
<th class="header">Layer Slug</th>
|
42
|
-
<th class="header">Download Label</th>
|
43
|
-
<th class="header">Download URL</th>
|
44
|
-
<th class="header" colspan="2">Actions</th>
|
45
|
-
</tr>
|
46
|
-
</thead>
|
47
|
-
|
48
|
-
<tbody>
|
49
|
-
<% @document_downloads.each do |document_download| %>
|
50
|
-
<tr>
|
51
|
-
<td><%= link_to document_download.friendlier_id, admin_document_path(document_download.document) %></td>
|
52
|
-
<td><%= document_download.label %></td>
|
53
|
-
<td><%= link_to document_download.value %></td>
|
54
|
-
<td><%= link_to 'Edit', edit_admin_document_document_download_path(document_download.document, document_download) %></td>
|
55
|
-
<td><%= link_to 'Destroy', admin_document_document_download_path(document_download.document, document_download), method: :delete, data: { confirm: 'Are you sure?' } %></td>
|
56
|
-
</tr>
|
57
|
-
<% end %>
|
58
|
-
</tbody>
|
59
|
-
</table>
|
60
|
-
|
61
|
-
<% if @pagy %>
|
62
|
-
<h6>
|
63
|
-
<span class='float-left mt-3'>
|
64
|
-
<%== pagy_info(@pagy) %>
|
65
|
-
</span>
|
66
|
-
<span class='float-right'>
|
67
|
-
<%== pagy_bootstrap_nav(@pagy) %>
|
68
|
-
</span>
|
69
|
-
</h6>
|
70
|
-
<% end %>
|
71
|
-
</div>
|
72
|
-
</div>
|
@@ -1,24 +0,0 @@
|
|
1
|
-
<p id="notice"><%= notice %></p>
|
2
|
-
|
3
|
-
<p>
|
4
|
-
<strong>Friendlier:</strong>
|
5
|
-
<%= @document_download.friendlier_id %>
|
6
|
-
</p>
|
7
|
-
|
8
|
-
<p>
|
9
|
-
<strong>Label:</strong>
|
10
|
-
<%= @document_download.label %>
|
11
|
-
</p>
|
12
|
-
|
13
|
-
<p>
|
14
|
-
<strong>Value:</strong>
|
15
|
-
<%= @document_download.value %>
|
16
|
-
</p>
|
17
|
-
|
18
|
-
<p>
|
19
|
-
<strong>Position:</strong>
|
20
|
-
<%= @document_download.position %>
|
21
|
-
</p>
|
22
|
-
|
23
|
-
<%= link_to 'Edit', edit_admin_document_download_path(@document_download) %> |
|
24
|
-
<%= link_to 'Back', admin_document_downloads_path %>
|
@@ -1,30 +0,0 @@
|
|
1
|
-
<% unless ENV["GBL_ADMIN_REFERENCES_MIGRATED"] == "true" %>
|
2
|
-
<%= Rails.logger.warn("Deprecation warning: Multiple Download Links will not be supported soon. Use DocumentReferences instead.") %>
|
3
|
-
<%- if @document.persisted? %>
|
4
|
-
<h3 id="multiple-download-links"><%= link_to "Multiple Download Links", admin_document_document_downloads_url(@document) %></h3>
|
5
|
-
<div class="table-responsive">
|
6
|
-
<table class="table table-striped table-bordered">
|
7
|
-
<thead>
|
8
|
-
<tr>
|
9
|
-
<th colspan="2">Actions</th>
|
10
|
-
<th>Layer Slug</th>
|
11
|
-
<th>Download Label</th>
|
12
|
-
<th>Download URL</th>
|
13
|
-
</tr>
|
14
|
-
</thead>
|
15
|
-
|
16
|
-
<tbody>
|
17
|
-
<% @document.document_downloads.each do |document_download| %>
|
18
|
-
<tr>
|
19
|
-
<td><%= link_to 'Edit', edit_admin_document_document_download_path(document_download.document, document_download) %></td>
|
20
|
-
<td><%= link_to 'Destroy', admin_document_document_download_path(document_download.document, document_download), method: :delete, data: { confirm: 'Are you sure?' } %></td>
|
21
|
-
<td><%= link_to document_download.friendlier_id, admin_document_path(document_download.document) %></td>
|
22
|
-
<td><%= document_download.label %></td>
|
23
|
-
<td><%= link_to document_download.value %></td>
|
24
|
-
</tr>
|
25
|
-
<% end %>
|
26
|
-
</tbody>
|
27
|
-
</table>
|
28
|
-
</div>
|
29
|
-
<% end %>
|
30
|
-
<% end %>
|