geoblacklight_admin 0.5.1 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +18 -9
- data/Rakefile +83 -47
- data/app/assets/javascripts/geoblacklight_admin/chosen.js +1 -0
- data/app/assets/stylesheets/geoblacklight_admin/_core.scss +24 -0
- data/app/assets/stylesheets/geoblacklight_admin/modules/_nav.scss +0 -5
- data/app/assets/stylesheets/geoblacklight_admin/modules/_tables.scss +1 -1
- data/app/controllers/admin/admin_controller.rb +16 -0
- data/app/controllers/admin/advanced_search_controller.rb +1 -1
- data/app/controllers/admin/assets_controller.rb +41 -5
- data/app/controllers/admin/bookmarks_controller.rb +14 -2
- data/app/controllers/admin/bulk_actions_controller.rb +31 -0
- data/app/controllers/admin/document_accesses_controller.rb +38 -0
- data/app/controllers/admin/document_assets_controller.rb +46 -9
- data/app/controllers/admin/document_distributions_controller.rb +172 -0
- data/app/controllers/admin/documents_controller.rb +41 -55
- data/app/controllers/admin/elements_controller.rb +22 -0
- data/app/controllers/admin/form_elements_controller.rb +31 -0
- data/app/controllers/admin/import_documents_controller.rb +11 -1
- data/app/controllers/admin/imports_controller.rb +32 -2
- data/app/controllers/admin/mappings_controller.rb +15 -0
- data/app/controllers/admin/notifications_controller.rb +27 -0
- data/app/controllers/admin/reference_types_controller.rb +106 -0
- data/app/controllers/admin/search_controller.rb +7 -0
- data/app/controllers/admin/users_controller.rb +10 -0
- data/app/helpers/asset_helper.rb +6 -0
- data/app/helpers/bulk_actions_helper.rb +9 -0
- data/app/helpers/document_helper.rb +36 -0
- data/app/helpers/geoblacklight_admin_helper.rb +88 -8
- data/app/helpers/mappings_helper.rb +26 -0
- data/app/indexers/document_indexer.rb +22 -2
- data/app/javascript/channels/consumer.js +6 -0
- data/app/javascript/channels/export_channel.js +30 -0
- data/app/javascript/channels/index.js +3 -0
- data/app/javascript/controllers/results_controller.js +14 -0
- data/app/javascript/index.js +8 -2
- data/app/jobs/export_job.rb +35 -8
- data/app/jobs/geoblacklight_admin/delete_thumbnail_job.rb +19 -0
- data/app/jobs/geoblacklight_admin/remove_parent_dct_references_uri_job.rb +16 -0
- data/app/jobs/geoblacklight_admin/set_parent_dct_references_uri_job.rb +17 -0
- data/app/jobs/geoblacklight_admin/store_image_job.rb +22 -0
- data/app/models/asset.rb +20 -0
- data/app/models/bulk_action.rb +2 -1
- data/app/models/document/geom_validator.rb +8 -0
- data/app/models/document/reference.rb +65 -65
- data/app/models/document.rb +128 -71
- data/app/models/document_distribution.rb +145 -0
- data/app/models/element.rb +2 -0
- data/app/models/geoblacklight_admin/schema.rb +10 -2
- data/app/models/import_document_state_machine.rb +1 -0
- data/app/models/reference_type.rb +40 -0
- data/app/models/user.rb +4 -2
- data/app/services/export_csv_document_distributions_service.rb +61 -0
- data/app/services/geoblacklight_admin/image_service/tms.rb +0 -4
- data/app/services/geoblacklight_admin/image_service.rb +1 -1
- data/app/services/geoblacklight_admin/item_viewer.rb +4 -4
- data/app/views/admin/bulk_actions/show.html.erb +1 -1
- data/app/views/admin/document_accesses/import.html.erb +6 -2
- data/app/views/admin/document_assets/_assets_table.html.erb +49 -0
- data/app/views/admin/document_assets/_form.html.erb +2 -3
- data/app/views/admin/document_assets/index.html.erb +1 -47
- data/app/views/admin/document_distributions/_document_distribution.html.erb +39 -0
- data/app/views/admin/document_distributions/_document_distribution.json.jbuilder +2 -0
- data/app/views/admin/document_distributions/_form.html.erb +34 -0
- data/app/views/admin/document_distributions/destroy_all.html.erb +82 -0
- data/app/views/admin/document_distributions/edit.html.erb +12 -0
- data/app/views/admin/document_distributions/import.html.erb +80 -0
- data/app/views/admin/document_distributions/index.html.erb +143 -0
- data/app/views/admin/document_distributions/index.json.jbuilder +1 -0
- data/app/views/admin/document_distributions/new.html.erb +11 -0
- data/app/views/admin/document_distributions/show.html.erb +10 -0
- data/app/views/admin/document_distributions/show.json.jbuilder +1 -0
- data/app/views/admin/documents/_document.html.erb +1 -3
- data/app/views/admin/documents/_form.html.erb +2 -4
- data/app/views/admin/documents/_form_control.html.erb +5 -2
- data/app/views/admin/documents/_form_nav.html.erb +14 -5
- data/app/views/admin/documents/_form_nav_kithe.html.erb +4 -1
- data/app/views/admin/documents/_json_aardvark.jbuilder +1 -1
- data/app/views/admin/documents/_json_gbl_v1.jbuilder +1 -1
- data/app/views/admin/documents/_result_selected_options.html.erb +5 -2
- data/app/views/admin/documents/admin.html.erb +5 -5
- data/app/views/admin/documents/features/_document_references.html.erb +23 -0
- data/app/views/admin/documents/features/_multiple_download_links.html.erb +29 -26
- data/app/views/admin/ids/fetch.json.jbuilder +0 -2
- data/app/views/admin/ids/index.json.jbuilder +0 -2
- data/app/views/admin/imports/_form.html.erb +1 -1
- data/app/views/admin/imports/show.html.erb +1 -1
- data/app/views/admin/layouts/application.html.erb +4 -2
- data/app/views/admin/reference_types/_form.html.erb +25 -0
- data/app/views/admin/reference_types/_reference_type.html.erb +52 -0
- data/app/views/admin/reference_types/_reference_type.json.jbuilder +2 -0
- data/app/views/admin/reference_types/edit.html.erb +12 -0
- data/app/views/admin/reference_types/index.html.erb +52 -0
- data/app/views/admin/reference_types/index.json.jbuilder +1 -0
- data/app/views/admin/reference_types/new.html.erb +11 -0
- data/app/views/admin/reference_types/show.html.erb +3 -0
- data/app/views/admin/reference_types/show.json.jbuilder +1 -0
- data/app/views/admin/shared/_footer.html.erb +5 -2
- data/app/views/admin/shared/_js_behaviors.html.erb +2 -3
- data/app/views/admin/shared/_navbar.html.erb +9 -2
- data/app/views/admin/users/index.html.erb +0 -1
- data/app/views/catalog/_show_gbl_admin.html.erb +1 -1
- data/config/initializers/defaults.yml +310 -0
- data/config/initializers/rails_config.rb +8 -0
- data/config/locales/documents.en.yml +14 -0
- data/config/routes.rb +30 -5
- data/db/import_references_schema_support.numbers +0 -0
- data/db/migrate/20230316183001_add_geoblacklight_admin_gem.rb +0 -12
- data/db/migrate/20241009200524_create_admin_reference_types.rb +13 -0
- data/db/migrate/20241010161420_create_document_references.rb +14 -0
- data/db/migrate/20241120238823_rename_references_to_distributions.rb +5 -0
- data/db/seeds.rb +5 -0
- data/db/seeds_elements.csv +1 -1
- data/db/seeds_elements.numbers +0 -0
- data/db/seeds_reference_types.csv +29 -0
- data/db/seeds_reference_types.numbers +0 -0
- data/db/structure.sql +1 -38
- data/lib/compose.yml +31 -0
- data/lib/generators/geoblacklight_admin/config_generator.rb +48 -12
- data/lib/generators/geoblacklight_admin/install_generator.rb +8 -0
- data/lib/generators/geoblacklight_admin/templates/config/database.yml +1 -1
- data/lib/generators/geoblacklight_admin/templates/config/initializers/devise.rb +0 -2
- data/lib/generators/geoblacklight_admin/templates/config/initializers/mime_types.rb +1 -0
- data/lib/generators/geoblacklight_admin/templates/demo-app/Dockerfile +31 -0
- data/lib/generators/geoblacklight_admin/templates/demo-app/compose.yml +42 -0
- data/lib/generators/geoblacklight_admin/templates/demo-app/start-server.sh +21 -0
- data/lib/geoblacklight_admin/engine.rb +4 -0
- data/lib/geoblacklight_admin/tasks/distributions.rake +69 -0
- data/lib/geoblacklight_admin/tasks/images.rake +1 -0
- data/lib/geoblacklight_admin/tasks/solr.rake +31 -0
- data/lib/geoblacklight_admin/version.rb +1 -1
- data/lib/geoblacklight_admin.rb +4 -0
- metadata +78 -41
- data/app/javascript/entrypoints/engine.js +0 -8
- data/config/locales/devise_invitable.en.yml +0 -31
- data/lib/generators/geoblacklight_admin/templates/devise/invitations/edit.html.erb +0 -15
- data/lib/generators/geoblacklight_admin/templates/devise/invitations/new.html.erb +0 -15
- data/lib/generators/geoblacklight_admin/templates/devise/mailer/invitation_instructions.html.erb +0 -11
- data/lib/generators/geoblacklight_admin/templates/devise/mailer/invitation_instructions.text.erb +0 -11
@@ -0,0 +1,82 @@
|
|
1
|
+
<p id="notice"><%= notice %></p>
|
2
|
+
|
3
|
+
<h1 style="width:100%; border-bottom:dotted;" class="mb-4">
|
4
|
+
Document · Destroy Distributions
|
5
|
+
<% if params[:document_id] %>
|
6
|
+
<%= link_to '+ New Distribution', new_document_document_distribution_path(@document), { class: 'btn btn-primary float-right' } %>
|
7
|
+
<% end %>
|
8
|
+
</h1>
|
9
|
+
|
10
|
+
<div class="row">
|
11
|
+
<div class="col-4">
|
12
|
+
<% if params[:document_id] %>
|
13
|
+
<h2 class='h3'><%= @document.title %></h2>
|
14
|
+
<% else %>
|
15
|
+
<h2 class='h3'>Destroy Multiple Distributions</h2>
|
16
|
+
<% end %>
|
17
|
+
|
18
|
+
<p class="alert alert-danger" role="alert">
|
19
|
+
<strong>Warning:</strong> All matching Distributions 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 DocumentDistribution.new, url: destroy_all_admin_document_distributions_path, method: :post, multipart: true do |f| %>
|
24
|
+
<div class="form-group">
|
25
|
+
<div class="form-inputs">
|
26
|
+
<%= f.simple_fields_for :distributions do |distribution_fields| %>
|
27
|
+
<%= reference_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-8">
|
38
|
+
<h4>Example CSV File</h4>
|
39
|
+
<table class="table table-bordered">
|
40
|
+
<thead>
|
41
|
+
<tr>
|
42
|
+
<th>friendlier_id</th>
|
43
|
+
<th>reference_type</th>
|
44
|
+
<th>distribution_url</th>
|
45
|
+
<th>label</th>
|
46
|
+
</tr>
|
47
|
+
</thead>
|
48
|
+
<tbody>
|
49
|
+
<tr>
|
50
|
+
<td>00add5b8-a7b1-42d4-b4de-ca99716a5096</td>
|
51
|
+
<td>download</td>
|
52
|
+
<td>https://s3.amazonaws.com/holc/tiles/WI/Madison/1937/rectified.zip</td>
|
53
|
+
<td>GeoTIFF</td>
|
54
|
+
</tr>
|
55
|
+
<tr>
|
56
|
+
<td>00add5b8-a7b1-42d4-b4de-ca99716a5096</td>
|
57
|
+
<td>download</td>
|
58
|
+
<td>https://s3.amazonaws.com/holc/tiles/WI/Madison/1937/holc-scan.jpg</td>
|
59
|
+
<td>JPEG</td>
|
60
|
+
</tr>
|
61
|
+
<tr>
|
62
|
+
<td>...</td>
|
63
|
+
<td>...</td>
|
64
|
+
<td>...</td>
|
65
|
+
<td>...</td>
|
66
|
+
</tr>
|
67
|
+
</tbody>
|
68
|
+
</table>
|
69
|
+
|
70
|
+
<h5>CSV File Column Definitions</h5>
|
71
|
+
<dl>
|
72
|
+
<dt>friendlier_id</dt>
|
73
|
+
<dd>The associated document's friendlier id</dd>
|
74
|
+
<dt>reference_type</dt>
|
75
|
+
<dd>The name of the reference type</dd>
|
76
|
+
<dt>distribution_url</dt>
|
77
|
+
<dd>The URL for the distribution</dd>
|
78
|
+
<dt>label</dt>
|
79
|
+
<dd>The label for the distribution, if the reference type is labeled</dd>
|
80
|
+
</dl>
|
81
|
+
</div>
|
82
|
+
</div>
|
@@ -0,0 +1,12 @@
|
|
1
|
+
<% content_for :title, "Editing document distribution" %>
|
2
|
+
|
3
|
+
<h1>Editing document distribution</h1>
|
4
|
+
|
5
|
+
<%= render "form", document_distribution: @document_distribution %>
|
6
|
+
|
7
|
+
<br>
|
8
|
+
|
9
|
+
<div>
|
10
|
+
<%= link_to "Show this document distribution", admin_document_document_distribution_path(@document, @document_distribution) %> |
|
11
|
+
<%= link_to "Back to document distributions", admin_document_document_distributions_path(@document) %>
|
12
|
+
</div>
|
@@ -0,0 +1,80 @@
|
|
1
|
+
<p id="notice"><%= notice %></p>
|
2
|
+
|
3
|
+
<h1 style="width:100%; border-bottom:dotted;" class="mb-4">
|
4
|
+
Document · Distributions
|
5
|
+
<% if params[:document_id] %>
|
6
|
+
<%= link_to '+ New Distribution', new_admin_document_document_distribution_path(@document), { class: 'btn btn-primary float-right' } %>
|
7
|
+
<% end %>
|
8
|
+
</h1>
|
9
|
+
|
10
|
+
<div class="row">
|
11
|
+
<div class="col-4">
|
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 Distributions will be created. Existing Distributions will be updated per the CSV file.
|
20
|
+
</p>
|
21
|
+
|
22
|
+
<h3 class="h4">Upload a CSV File</h3>
|
23
|
+
<%= simple_form_for DocumentDistribution.new, url: import_admin_document_distributions_path, method: :post, multipart: true do |f| %>
|
24
|
+
<div class="form-inputs">
|
25
|
+
<%= f.simple_fields_for :distributions do |distribution_fields| %>
|
26
|
+
<%= distribution_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-8">
|
36
|
+
<h4>Example CSV File</h4>
|
37
|
+
<table class="table table-bordered">
|
38
|
+
<thead>
|
39
|
+
<tr>
|
40
|
+
<th>friendlier_id</th>
|
41
|
+
<th>reference_type</th>
|
42
|
+
<th>distribution_url</th>
|
43
|
+
<th>label</th>
|
44
|
+
</tr>
|
45
|
+
</thead>
|
46
|
+
<tbody>
|
47
|
+
<tr>
|
48
|
+
<td>00add5b8-a7b1-42d4-b4de-ca99716a5096</td>
|
49
|
+
<td>download</td>
|
50
|
+
<td>https://s3.amazonaws.com/holc/tiles/WI/Madison/1937/rectified.zip</td>
|
51
|
+
<td>GeoTIFF</td>
|
52
|
+
</tr>
|
53
|
+
<tr>
|
54
|
+
<td>00add5b8-a7b1-42d4-b4de-ca99716a5096</td>
|
55
|
+
<td>download</td>
|
56
|
+
<td>https://s3.amazonaws.com/holc/tiles/WI/Madison/1937/holc-scan.jpg</td>
|
57
|
+
<td>JPEG</td>
|
58
|
+
</tr>
|
59
|
+
<tr>
|
60
|
+
<td>...</td>
|
61
|
+
<td>...</td>
|
62
|
+
<td>...</td>
|
63
|
+
<td>...</td>
|
64
|
+
</tr>
|
65
|
+
</tbody>
|
66
|
+
</table>
|
67
|
+
|
68
|
+
<h5>CSV File Column Definitions</h5>
|
69
|
+
<dl>
|
70
|
+
<dt>friendlier_id</dt>
|
71
|
+
<dd>The associated document's friendlier id</dd>
|
72
|
+
<dt>reference_type</dt>
|
73
|
+
<dd>The name of the reference type</dd>
|
74
|
+
<dt>distribution_url</dt>
|
75
|
+
<dd>The URL for the distribution</dd>
|
76
|
+
<dt>label</dt>
|
77
|
+
<dd>The label for the distribution, if the reference type is labeled</dd>
|
78
|
+
</dl>
|
79
|
+
</div>
|
80
|
+
</div>
|
@@ -0,0 +1,143 @@
|
|
1
|
+
<%- @page_title = "GBL♦Admin - Document - Distributions" %>
|
2
|
+
|
3
|
+
<div class="row mb-2">
|
4
|
+
<div class="col">
|
5
|
+
<h1 style="width:100%;">
|
6
|
+
Document · Distributions
|
7
|
+
|
8
|
+
<% if params[:document_id] %>
|
9
|
+
<%= link_to '+ Import CSV', import_admin_document_document_distributions_path(@document), { class: 'btn btn-primary float-right' } %>
|
10
|
+
|
11
|
+
<%= link_to '+ New Distribution', new_admin_document_document_distribution_path(@document), { class: 'btn btn-primary float-right mr-2' } %>
|
12
|
+
<% else %>
|
13
|
+
<%= link_to '- Delete CSV', destroy_all_admin_document_distributions_path, { class: 'btn btn-danger float-right' } %>
|
14
|
+
<%= link_to '+ Import CSV', import_admin_document_distributions_path, { class: 'btn btn-primary float-right mr-4' } %>
|
15
|
+
<% end %>
|
16
|
+
</h1>
|
17
|
+
|
18
|
+
<% if params[:document_id] %>
|
19
|
+
<h2 class='h3'>
|
20
|
+
<%= link_to(@document.title, admin_document_path(@document)) %>
|
21
|
+
·
|
22
|
+
<%= @document_distributions.count %> distributions
|
23
|
+
</h2>
|
24
|
+
<% else %>
|
25
|
+
<h2 class='h3'>Distributions</h2>
|
26
|
+
<% end %>
|
27
|
+
|
28
|
+
<!-- Tab navigation -->
|
29
|
+
<ul class="nav nav-tabs" id="documentTab" role="tablist">
|
30
|
+
<li class="nav-item">
|
31
|
+
<a class="nav-link active" id="html-tab" data-toggle="tab" href="#html" role="tab" aria-controls="html" aria-selected="true">HTML</a>
|
32
|
+
</li>
|
33
|
+
<% if params[:document_id] %>
|
34
|
+
<li class="nav-item">
|
35
|
+
<a class="nav-link" id="json-tab" data-toggle="tab" href="#json" role="tab" aria-controls="json" aria-selected="false">JSON</a>
|
36
|
+
</li>
|
37
|
+
<li class="nav-item">
|
38
|
+
<a class="nav-link" id="csv-tab" data-toggle="tab" href="#csv" role="tab" aria-controls="csv" aria-selected="false">CSV</a>
|
39
|
+
</li>
|
40
|
+
<% end %>
|
41
|
+
</ul>
|
42
|
+
|
43
|
+
<!-- Tab content -->
|
44
|
+
<div class="tab-content" id="documentTabContent">
|
45
|
+
<div class="tab-pane fade show active" id="html" role="tabpanel" aria-labelledby="html-tab">
|
46
|
+
<br />
|
47
|
+
<!-- HTML content -->
|
48
|
+
|
49
|
+
<% if @pagy %>
|
50
|
+
<h6>
|
51
|
+
<span class='float-left mt-3'>
|
52
|
+
<%== pagy_info(@pagy) %>
|
53
|
+
</span>
|
54
|
+
<span class='float-right'>
|
55
|
+
<%== pagy_bootstrap_nav(@pagy) %>
|
56
|
+
</span>
|
57
|
+
</h6>
|
58
|
+
<% end %>
|
59
|
+
|
60
|
+
<% if @document %>
|
61
|
+
<h3>External – Document Distributions</h3>
|
62
|
+
<% end %>
|
63
|
+
|
64
|
+
<table class="table table-striped table-bordered sortable">
|
65
|
+
<thead class="thead-dark">
|
66
|
+
<tr>
|
67
|
+
<th class="header">Layer Slug</th>
|
68
|
+
<th class="header">Type</th>
|
69
|
+
<th class="header">URI</th>
|
70
|
+
<th class="header">Value</th>
|
71
|
+
<th class="header">Label</th>
|
72
|
+
<th class="header" colspan="2">Actions</th>
|
73
|
+
</tr>
|
74
|
+
</thead>
|
75
|
+
|
76
|
+
<tbody>
|
77
|
+
<% @document_distributions.each do |document_distribution| %>
|
78
|
+
<tr>
|
79
|
+
<td><%= link_to document_distribution.friendlier_id, admin_document_path(document_distribution.document) %></td>
|
80
|
+
<td><%= document_distribution.reference_type.reference_type %></td>
|
81
|
+
<td><%= document_distribution.reference_type.reference_uri %></td>
|
82
|
+
<td><%= link_to document_distribution.url, document_distribution.url, target: '_blank' %></td>
|
83
|
+
<td><%= document_distribution.label %></td>
|
84
|
+
<td><%= link_to 'Edit', edit_admin_document_document_distribution_path(document_distribution.document, document_distribution) %></td>
|
85
|
+
<td><%= link_to 'Destroy', admin_document_document_distribution_path(document_distribution.document, document_distribution), method: :delete, data: { confirm: 'Are you sure?' } %></td>
|
86
|
+
</tr>
|
87
|
+
<% end %>
|
88
|
+
</tbody>
|
89
|
+
</table>
|
90
|
+
|
91
|
+
<% if @pagy %>
|
92
|
+
<h6>
|
93
|
+
<span class='float-left mt-3'>
|
94
|
+
<%== pagy_info(@pagy) %>
|
95
|
+
</span>
|
96
|
+
<span class='float-right'>
|
97
|
+
<%== pagy_bootstrap_nav(@pagy) %>
|
98
|
+
</span>
|
99
|
+
</h6>
|
100
|
+
<% end %>
|
101
|
+
|
102
|
+
<% if @document && @document.distributable_assets.any? %>
|
103
|
+
<h3>Internal – Distributable Assets</h3>
|
104
|
+
<%= render partial: 'admin/document_assets/assets_table', locals: { document_assets: @document.document_assets } %>
|
105
|
+
<% end %>
|
106
|
+
</div>
|
107
|
+
|
108
|
+
<% if params[:document_id] %>
|
109
|
+
<div class="tab-pane fade" id="json" role="tabpanel" aria-labelledby="json-tab">
|
110
|
+
<h3 class="mt-4">Ruby Hash</h3>
|
111
|
+
<%= ap(@document.distributions).html_safe %>
|
112
|
+
<h3 class="mt-4">JSON</h3>
|
113
|
+
<%= ap(@document.distributions.to_json).html_safe %>
|
114
|
+
</div>
|
115
|
+
|
116
|
+
<div class="tab-pane fade" id="csv" role="tabpanel" aria-labelledby="csv-tab">
|
117
|
+
<br />
|
118
|
+
|
119
|
+
<!-- CSV content -->
|
120
|
+
<table class="table table-striped table-bordered sortable">
|
121
|
+
<thead class="thead-dark">
|
122
|
+
<tr>
|
123
|
+
<th class="header">Layer Slug</th>
|
124
|
+
<th class="header">Type</th>
|
125
|
+
<th class="header">Value</th>
|
126
|
+
<th class="header">Label</th>
|
127
|
+
</tr>
|
128
|
+
</thead>
|
129
|
+
<tbody>
|
130
|
+
<% @document.distributions_csv.each do |row| %>
|
131
|
+
<tr>
|
132
|
+
<% row.each do |value| %>
|
133
|
+
<td><%= value %></td>
|
134
|
+
<% end %>
|
135
|
+
</tr>
|
136
|
+
<% end %>
|
137
|
+
</tbody>
|
138
|
+
</table>
|
139
|
+
</div>
|
140
|
+
<% end %>
|
141
|
+
</div>
|
142
|
+
</div>
|
143
|
+
</div>
|
@@ -0,0 +1 @@
|
|
1
|
+
json.array! @document_distributions, partial: "document_distributions/document_distribution", as: :document_distribution
|
@@ -0,0 +1,11 @@
|
|
1
|
+
<% content_for :title, "New document distribution" %>
|
2
|
+
|
3
|
+
<h1>New document distribution</h1>
|
4
|
+
|
5
|
+
<%= render "form", document_distribution: @document_distribution %>
|
6
|
+
|
7
|
+
<br>
|
8
|
+
|
9
|
+
<div>
|
10
|
+
<%= link_to "Back to document distributions", admin_document_document_distributions_path(@document) %>
|
11
|
+
</div>
|
@@ -0,0 +1,10 @@
|
|
1
|
+
<p style="color: green"><%= notice %></p>
|
2
|
+
|
3
|
+
<%= render @document_distribution %>
|
4
|
+
|
5
|
+
<div>
|
6
|
+
<%= link_to "Edit this document distribution", edit_admin_document_document_distribution_path(@document, @document_distribution) %> |
|
7
|
+
<%= link_to "Back to document distributions", admin_document_document_distributions_path(@document) %>
|
8
|
+
|
9
|
+
<%= button_to "Destroy this document distribution", admin_document_document_distribution_path(@document, @document_distribution), method: :delete %>
|
10
|
+
</div>
|
@@ -0,0 +1 @@
|
|
1
|
+
json.partial! "document_distributions/document_distribution", document_distribution: @document_distribution
|
@@ -8,9 +8,7 @@
|
|
8
8
|
<% @document = Document.find_by(friendlier_id: document.friendlier_id) %>
|
9
9
|
<% if thumb_to_render?(@document) %>
|
10
10
|
<%= link_to edit_admin_document_path(document.friendlier_id) do %>
|
11
|
-
|
12
|
-
<%= image_tag(@document.thumbnail.file_url(:thumb_standard_2X), class: "thumbnail") %>
|
13
|
-
<% end %>
|
11
|
+
<%= image_tag(thumbnail_to_render(@document), class: "thumbnail") %>
|
14
12
|
<% end %>
|
15
13
|
<% end %>
|
16
14
|
</div>
|
@@ -8,11 +8,9 @@
|
|
8
8
|
<h1 class="h5">
|
9
9
|
<% if @document.persisted? %>
|
10
10
|
<div class="row">
|
11
|
-
<% if @document
|
11
|
+
<% if thumb_to_render?(@document) %>
|
12
12
|
<div class="thumbnail col-2">
|
13
|
-
|
14
|
-
<%= image_tag @document&.thumbnail&.file_url(:thumb_mini) %>
|
15
|
-
<% end %>
|
13
|
+
<%= image_tag thumbnail_to_render(@document), class: "thumbnail" %>
|
16
14
|
</div>
|
17
15
|
<% end %>
|
18
16
|
<div class="col">
|
@@ -37,8 +37,11 @@
|
|
37
37
|
|
38
38
|
<% # References are a special, special case %>
|
39
39
|
<% elsif element.solr_field == 'dct_references_s' %>
|
40
|
-
|
41
|
-
|
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 %>
|
42
45
|
<% end %>
|
43
46
|
|
44
47
|
<% elsif element.repeatable? %>
|
@@ -1,7 +1,7 @@
|
|
1
1
|
<div class="make-me-sticky mt-4 ml-4">
|
2
2
|
<nav class="nav flex-column ml-4 mt-6">
|
3
3
|
<% if @document.persisted? %>
|
4
|
-
<strong class="mb-4"><%= link_to "GBL♦Admin | View in GeoBlacklight", solr_document_url(@document), { class: 'btn btn-warning' } %></strong>
|
4
|
+
<strong class="mb-4"><%= link_to "GBL♦Admin | View in GeoBlacklight", solr_document_url(@document), { class: 'btn btn-gbl-admin btn-warning' } %></strong>
|
5
5
|
<% end %>
|
6
6
|
|
7
7
|
<%- form_elements = FormElement.all.order(position: :asc) %>
|
@@ -14,19 +14,28 @@
|
|
14
14
|
<% end %>
|
15
15
|
<% end %>
|
16
16
|
|
17
|
-
|
17
|
+
<%- if @document.persisted? %>
|
18
18
|
<%= link_to admin_document_document_accesses_url(@document), class: "ml-2" do %>
|
19
19
|
Institutional Access Links
|
20
20
|
<span class="badge badge-light"><%= @document.document_accesses.count %></span>
|
21
21
|
<% end %>
|
22
|
-
|
23
|
-
|
24
|
-
|
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 %>
|
25
29
|
<% end %>
|
30
|
+
|
26
31
|
<%= link_to admin_document_document_assets_url(@document), class: "ml-2" do %>
|
27
32
|
Additional Assets
|
28
33
|
<span class="badge badge-light"><%= @document.document_assets.count %></span>
|
29
34
|
<% end %>
|
35
|
+
<%= link_to admin_document_document_distributions_url(@document), class: "ml-2" do %>
|
36
|
+
Distributions
|
37
|
+
<span class="badge badge-light"><%= @document.distributions.size %></span>
|
38
|
+
<% end %>
|
30
39
|
<% end %>
|
31
40
|
</nav>
|
32
41
|
</div>
|
@@ -23,7 +23,10 @@
|
|
23
23
|
|
24
24
|
<% if @document.persisted? %>
|
25
25
|
<%= link_to "Institutional Access Links", admin_document_document_accesses_url(@document), class: "ml-2" %>
|
26
|
-
|
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 %>
|
27
30
|
<%= link_to "Additional Assets", admin_document_document_assets_url(@document), class: "ml-2" %>
|
28
31
|
<% end %>
|
29
32
|
</nav>
|
@@ -38,7 +38,7 @@ json.dct_accessRights_s no_json_blanks document.send(GeoblacklightAdmin::Schema.
|
|
38
38
|
json.dct_format_s no_json_blanks document.send(GeoblacklightAdmin::Schema.instance.solr_fields[:format])
|
39
39
|
json.gbl_fileSize_s no_json_blanks document.send(GeoblacklightAdmin::Schema.instance.solr_fields[:file_size])
|
40
40
|
json.gbl_wxsIdentifier_s no_json_blanks document.send(GeoblacklightAdmin::Schema.instance.solr_fields[:wxs_identifier])
|
41
|
-
json.dct_references_s no_json_blanks document.
|
41
|
+
json.dct_references_s no_json_blanks document.distributions_json
|
42
42
|
json.id no_json_blanks document.send(GeoblacklightAdmin::Schema.instance.solr_fields[:id])
|
43
43
|
json.dct_identifier_sm no_json_blanks document.send(GeoblacklightAdmin::Schema.instance.solr_fields[:identifier])
|
44
44
|
json.gbl_mdModified_dt no_json_blanks document.send(GeoblacklightAdmin::Schema.instance.solr_fields[:updated_at])
|
@@ -18,7 +18,7 @@ json.dc_creator_sm no_json_blanks document.send(GeoblacklightAdmin::Schema.insta
|
|
18
18
|
json.dc_description_s no_json_blanks document.send(GeoblacklightAdmin::Schema.instance.solr_fields[:description]).join("|")
|
19
19
|
json.dc_format_s no_json_blanks document.send(GeoblacklightAdmin::Schema.instance.solr_fields[:format])
|
20
20
|
json.dc_subject_sm no_json_blanks document.send(GeoblacklightAdmin::Schema.instance.solr_fields[:subject])
|
21
|
-
json.dct_references_s no_json_blanks document.
|
21
|
+
json.dct_references_s no_json_blanks document.distributions_json
|
22
22
|
json.dct_spatial_sm no_json_blanks document.send(GeoblacklightAdmin::Schema.instance.solr_fields[:spatial_coverage])
|
23
23
|
json.layer_modified_dt no_json_blanks document.send(GeoblacklightAdmin::Schema.instance.solr_fields[:updated_at])
|
24
24
|
|
@@ -22,11 +22,14 @@
|
|
22
22
|
<a class="dropdown-item" data-action="click->results#exportJsonBtaaAardvark" href="javascript:void(0);">JSON (BTAA Aardvark)</a>
|
23
23
|
<a class="dropdown-item" data-action="click->results#exportJsonGBLv1" href="javascript:void(0);">JSON (GBL v1.0)</a>
|
24
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>
|
25
28
|
<a class="dropdown-item" data-action="click->results#exportCsvDocumentDownloads" href="javascript:void(0);">
|
26
29
|
CSV - Document Downloads
|
27
30
|
</a>
|
28
|
-
<a class="dropdown-item" data-action="click->results#
|
29
|
-
CSV - Document
|
31
|
+
<a class="dropdown-item" data-action="click->results#exportCsvDocumentReferences" href="javascript:void(0);">
|
32
|
+
CSV - Document References
|
30
33
|
</a>
|
31
34
|
</div>
|
32
35
|
</span>
|
@@ -132,12 +132,12 @@
|
|
132
132
|
</div>
|
133
133
|
|
134
134
|
<div class="card">
|
135
|
-
<div class="card-header" id="
|
136
|
-
<button class="btn btn-link btn-block text-left" type="button" data-toggle="collapse" data-target="#
|
137
|
-
<h3 class="mb-0">
|
135
|
+
<div class="card-header" id="distributions">
|
136
|
+
<button class="btn btn-link btn-block text-left" type="button" data-toggle="collapse" data-target="#distributions-content" aria-controls="distributions-content">
|
137
|
+
<h3 class="mb-0">Distributions</h3>
|
138
138
|
</button>
|
139
139
|
</div>
|
140
|
-
<div id="
|
140
|
+
<div id="distributions-content" class="collapse" aria-labelledby="distributions-content" data-parent="#distributions">
|
141
141
|
<div class="card-body">
|
142
142
|
<table class="table responsive">
|
143
143
|
<thead>
|
@@ -147,7 +147,7 @@
|
|
147
147
|
</tr>
|
148
148
|
</thead>
|
149
149
|
<tbody>
|
150
|
-
<% @document.
|
150
|
+
<% @document.distributions.each do |entry| %>
|
151
151
|
<tr>
|
152
152
|
<td><%= entry[0] %></td>
|
153
153
|
<td>
|
@@ -0,0 +1,23 @@
|
|
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">
|
6
|
+
<tr>
|
7
|
+
<th class="header">Type</th>
|
8
|
+
<th class="header">Value</th>
|
9
|
+
<th class="header">Label</th>
|
10
|
+
</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 %>
|
23
|
+
<% end %>
|
@@ -1,27 +1,30 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
<
|
6
|
-
<
|
7
|
-
<
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
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>
|
13
15
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
</div>
|
27
|
-
<% end %>
|
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 %>
|
@@ -54,7 +54,7 @@
|
|
54
54
|
<% if @import.state_machine.current_state == 'mapped' %>
|
55
55
|
<%= form_tag run_admin_import_path(@import), method: :patch do -%>
|
56
56
|
<%= hidden_field_tag :run, true -%>
|
57
|
-
<%= submit_tag 'Run Import' -%>
|
57
|
+
<%= submit_tag '+ Run Import', class: 'btn btn-primary btn-block' -%>
|
58
58
|
<%- end -%>
|
59
59
|
<% end %>
|
60
60
|
<% if @import.state_machine.current_state == 'imported' %>
|