geoblacklight_admin 0.0.1 → 0.1.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/README.md +27 -3
- data/Rakefile +30 -12
- data/app/assets/javascripts/geoblacklight_admin.js +1 -0
- data/app/assets/stylesheets/geoblacklight_admin/_core.scss +5 -0
- data/app/assets/stylesheets/geoblacklight_admin/modules/_chosen.scss +425 -0
- data/app/controllers/admin/admin_controller.rb +4 -2
- data/app/controllers/admin/advanced_search_controller.rb +123 -103
- data/app/controllers/admin/api_controller.rb +123 -108
- data/app/controllers/admin/bookmarks_controller.rb +4 -4
- data/app/controllers/admin/bulk_actions_controller.rb +9 -4
- data/app/controllers/admin/concerns/upload_util.rb +2 -0
- data/app/controllers/admin/document_accesses_controller.rb +10 -4
- data/app/controllers/admin/document_assets_controller.rb +14 -11
- data/app/controllers/admin/document_downloads_controller.rb +12 -10
- data/app/controllers/admin/documents_controller.rb +16 -8
- data/app/controllers/admin/elements_controller.rb +6 -5
- data/app/controllers/admin/form_elements_controller.rb +4 -4
- data/app/controllers/admin/ids_controller.rb +107 -87
- data/app/controllers/admin/import_documents_controller.rb +1 -1
- data/app/controllers/admin/imports_controller.rb +7 -3
- data/app/controllers/admin/mappings_controller.rb +6 -4
- data/app/controllers/admin/notifications_controller.rb +1 -1
- data/app/controllers/admin/search_controller.rb +1 -1
- data/app/controllers/admin/users_controller.rb +1 -1
- data/app/helpers/form_input_helper.rb +4 -4
- data/app/helpers/geoblacklight_admin_helper.rb +1 -1
- data/app/jobs/export_job.rb +2 -1
- data/app/models/admin/bookmark.rb +18 -0
- data/app/models/api_search_builder.rb +3 -1
- data/app/models/document/bbox_validator.rb +9 -5
- data/app/models/document/date_range_validator.rb +13 -10
- data/app/models/document/geom_validator.rb +4 -2
- data/app/models/document.rb +15 -7
- data/app/models/element.rb +9 -7
- data/app/models/form_control.rb +2 -0
- data/app/models/form_element.rb +2 -0
- data/app/models/form_feature.rb +2 -0
- data/app/models/form_group.rb +2 -0
- data/app/models/form_header.rb +2 -0
- data/app/models/geoblacklight_admin/schema.rb +5 -2
- data/app/models/geoblacklight_admin.rb +2 -0
- data/app/models/import/csv_duplicates_validator.rb +2 -1
- data/app/models/import/csv_header_validator.rb +2 -1
- data/app/models/import.rb +4 -7
- data/app/models/user.rb +1 -1
- data/app/services/export_csv_service.rb +5 -1
- data/app/views/admin/advanced_search/facets.json.jbuilder +9 -8
- data/app/views/admin/advanced_search/index.json.jbuilder +8 -7
- data/app/views/admin/api/_field.json.jbuilder +1 -1
- data/app/views/admin/api/fetch.json.jbuilder +8 -7
- data/app/views/admin/api/index.json.jbuilder +8 -7
- data/app/views/admin/bookmarks/index.html.erb +2 -2
- data/app/views/admin/bulk_actions/index.html.erb +3 -3
- data/app/views/admin/bulk_actions/show.html.erb +1 -1
- data/app/views/admin/document_accesses/_form.html.erb +1 -1
- data/app/views/admin/document_accesses/destroy_all.html.erb +2 -2
- data/app/views/admin/document_accesses/edit.html.erb +1 -1
- data/app/views/admin/document_accesses/import.html.erb +2 -2
- data/app/views/admin/document_accesses/index.html.erb +9 -9
- data/app/views/admin/document_accesses/new.html.erb +1 -1
- data/app/views/admin/document_downloads/_form.html.erb +1 -1
- data/app/views/admin/document_downloads/destroy_all.html.erb +1 -1
- data/app/views/admin/document_downloads/edit.html.erb +2 -3
- data/app/views/admin/document_downloads/import.html.erb +1 -1
- data/app/views/admin/document_downloads/index.html.erb +9 -9
- data/app/views/admin/document_downloads/new.html.erb +1 -1
- data/app/views/admin/document_downloads/show.html.erb +2 -2
- data/app/views/admin/documents/_document_bookmark.html.erb +1 -1
- data/app/views/admin/documents/_form_nav.html.erb +1 -1
- data/app/views/admin/documents/_json_btaa_aardvark.jbuilder +1 -3
- data/app/views/admin/documents/edit.html.erb +1 -1
- data/app/views/admin/documents/features/_multiple_download_links.html.erb +2 -2
- data/app/views/admin/documents/index.html.erb +2 -4
- data/app/views/admin/documents/versions.html.erb +1 -1
- data/app/views/admin/elements/_element.json.jbuilder +4 -1
- data/app/views/admin/elements/_form.html.erb +1 -1
- data/app/views/admin/elements/edit.html.erb +2 -2
- data/app/views/admin/elements/index.html.erb +3 -3
- data/app/views/admin/elements/index.json.jbuilder +2 -0
- data/app/views/admin/elements/new.html.erb +1 -1
- data/app/views/admin/elements/show.html.erb +6 -6
- data/app/views/admin/elements/show.json.jbuilder +2 -0
- data/app/views/admin/form_elements/_form.html.erb +1 -1
- data/app/views/admin/form_elements/_form_element.json.jbuilder +2 -0
- data/app/views/admin/form_elements/edit.html.erb +2 -2
- data/app/views/admin/form_elements/index.html.erb +1 -1
- data/app/views/admin/form_elements/index.json.jbuilder +2 -0
- data/app/views/admin/form_elements/new.html.erb +1 -1
- data/app/views/admin/form_elements/show.html.erb +2 -2
- data/app/views/admin/form_elements/show.json.jbuilder +2 -0
- data/app/views/admin/ids/fetch.json.jbuilder +8 -7
- data/app/views/admin/ids/index.json.jbuilder +3 -2
- data/app/views/admin/import_documents/show.html.haml +1 -1
- data/app/views/admin/imports/_import.json.jbuilder +2 -1
- data/app/views/admin/imports/_show_failed_tab.html.erb +2 -2
- data/app/views/admin/imports/_show_success_tab.html.erb +1 -1
- data/app/views/admin/imports/edit.html.erb +3 -3
- data/app/views/admin/imports/index.html.erb +3 -3
- data/app/views/admin/layouts/application.html.erb +4 -4
- data/app/views/admin/mappings/_form.html.erb +1 -1
- data/app/views/admin/mappings/_mapping.json.jbuilder +2 -1
- data/app/views/admin/mappings/edit.html.erb +2 -2
- data/app/views/admin/mappings/new.html.erb +1 -1
- data/app/views/admin/mappings/show.html.erb +2 -2
- data/app/views/admin/notifications/index.html.erb +3 -3
- data/app/views/admin/search/index.html.erb +2 -2
- data/app/views/admin/shared/_navbar.html.erb +8 -3
- data/app/views/catalog/_show_gbl_admin.html.erb +3 -0
- data/config/routes.rb +37 -33
- data/db/migrate/20230316183001_add_geoblacklight_admin_gem.rb +408 -0
- data/db/seeds.rb +7 -5
- data/lib/generators/geoblacklight_admin/config_generator.rb +43 -31
- data/lib/generators/geoblacklight_admin/install_generator.rb +2 -3
- data/lib/generators/geoblacklight_admin/jobs_generator.rb +3 -2
- data/lib/generators/geoblacklight_admin/models_generator.rb +0 -1
- data/lib/generators/geoblacklight_admin/templates/_show_sidebar.html.erb +19 -0
- data/lib/generators/geoblacklight_admin/templates/_user_util_links.html.erb +1 -1
- data/lib/generators/geoblacklight_admin/templates/config/database.yml +9 -5
- data/lib/generators/geoblacklight_admin/templates/config/initializers/geoblacklight_admin.rb +1 -2
- data/lib/generators/geoblacklight_admin/templates/config/initializers/pagy.rb +150 -68
- data/lib/generators/geoblacklight_admin/templates/config/settings.yml +241 -0
- data/lib/generators/geoblacklight_admin/templates/package.json +1 -0
- data/lib/generators/geoblacklight_admin/views_generator.rb +0 -1
- data/lib/geoblacklight_admin/engine.rb +5 -6
- data/lib/geoblacklight_admin/version.rb +1 -1
- data/lib/geoblacklight_admin.rb +1 -1
- data/lib/tasks/geoblacklight_admin.rake +10 -6
- metadata +79 -48
- data/.editorconfig +0 -18
- data/.gitignore +0 -75
- data/.standard.yml +0 -4
- data/Gemfile +0 -59
- data/LICENSE +0 -21
- data/app/assets/images/.keep +0 -0
- data/app/controllers/admin/concerns/.keep +0 -0
- data/app/models/bookmark.rb +0 -17
- data/app/models/concerns/.keep +0 -0
- data/db/migrate/20230316183001_add_geoblacklight_admin.rb +0 -399
- data/geoblacklight_admin.gemspec +0 -67
- data/lib/generators/geoblacklight_admin/templates/.env.development.example +0 -28
- data/lib/generators/geoblacklight_admin/templates/.solr_wrapper.yml +0 -7
- data/lib/generators/geoblacklight_admin/templates/solr/snapshots/.keep +0 -0
- data/lib/tasks/.keep +0 -0
- data/spec/test_app_templates/lib/generators/test_app_generator.rb +0 -35
- data/template.rb +0 -16
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<%- @page_title = "
|
|
1
|
+
<%- @page_title = "GBL♦Admin - Bulk Actions" %>
|
|
2
2
|
|
|
3
3
|
<h1 style="width:100%;">
|
|
4
4
|
Bulk Actions
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
<h6>
|
|
9
9
|
<span class='float-left mt-3'>
|
|
10
|
-
<%== pagy_info(@pagy
|
|
10
|
+
<%== pagy_info(@pagy) %>
|
|
11
11
|
</span>
|
|
12
12
|
<span class='float-right'>
|
|
13
13
|
<%== pagy_bootstrap_nav(@pagy) %>
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
|
|
45
45
|
<h6>
|
|
46
46
|
<span class='float-left mt-3'>
|
|
47
|
-
<%== pagy_info(@pagy
|
|
47
|
+
<%== pagy_info(@pagy) %>
|
|
48
48
|
</span>
|
|
49
49
|
<span class='float-right'>
|
|
50
50
|
<%== pagy_bootstrap_nav(@pagy) %>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
<%= simple_form_for [@document, @document_access] do |f| %>
|
|
2
|
+
<%= simple_form_for [:admin, @document, @document_access] do |f| %>
|
|
3
3
|
<%= f.error_notification %>
|
|
4
4
|
<%= f.error_notification message: f.object.errors[:base].to_sentence if f.object.errors[:base].present? %>
|
|
5
5
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<h1 style="width:100%; border-bottom:dotted;" class="mb-4">
|
|
4
4
|
Document · Destroy Document Access Links
|
|
5
5
|
<% if params[:document_id] %>
|
|
6
|
-
<%= link_to '+ New Access URL',
|
|
6
|
+
<%= link_to '+ New Access URL', new_admin_document_document_access_path(@document), { class: 'btn btn-primary float-right' } %>
|
|
7
7
|
<% end %>
|
|
8
8
|
</h1>
|
|
9
9
|
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
</p>
|
|
21
21
|
<h3 class='h4'>Upload a CSV File</h3>
|
|
22
22
|
|
|
23
|
-
<%= simple_form_for DocumentAccess.new, url:
|
|
23
|
+
<%= simple_form_for DocumentAccess.new, url: destroy_all_admin_document_accesses_path, method: :post, multipart: true do |f| %>
|
|
24
24
|
<div class="form-group">
|
|
25
25
|
<div class="form-inputs">
|
|
26
26
|
<%= f.simple_fields_for :assets do |asset_fields| %>
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<h1 style="width:100%; border-bottom:dotted;" class="mb-4">
|
|
4
4
|
Document · Institutional Access
|
|
5
5
|
<% if params[:document_id] %>
|
|
6
|
-
<%= link_to '+ New Access URL',
|
|
6
|
+
<%= link_to '+ New Access URL', new_admin_document_document_access_path(@document), { class: 'btn btn-primary float-right' } %>
|
|
7
7
|
<% end %>
|
|
8
8
|
</h1>
|
|
9
9
|
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
<% end %>
|
|
17
17
|
|
|
18
18
|
<h3 class='h4'>Import a CSV File</h3>
|
|
19
|
-
<%= simple_form_for DocumentAccess.new, url:
|
|
19
|
+
<%= simple_form_for DocumentAccess.new, url: import_admin_document_accesses_path, method: :post, multipart: true do |f| %>
|
|
20
20
|
<div class="form-inputs">
|
|
21
21
|
<%= f.simple_fields_for :assets do |asset_fields| %>
|
|
22
22
|
<%= asset_fields.input :file, as: :file, input_html: {} %>
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
<%- @page_title = "
|
|
1
|
+
<%- @page_title = "GBL♦Admin - Document - Access Links" %>
|
|
2
2
|
|
|
3
3
|
<h1 style="width:100%;">
|
|
4
4
|
Document · Access Links
|
|
5
5
|
|
|
6
6
|
<% if params[:document_id] %>
|
|
7
|
-
<%= link_to '+ Import CSV',
|
|
7
|
+
<%= link_to '+ Import CSV', import_admin_document_document_accesses_path(@document), { class: 'btn btn-primary float-right' } %>
|
|
8
8
|
|
|
9
|
-
<%= link_to '+ New Access URL',
|
|
9
|
+
<%= link_to '+ New Access URL', new_admin_document_document_access_path(@document), { class: 'btn btn-primary float-right mr-2' } %>
|
|
10
10
|
<% else %>
|
|
11
11
|
<%= link_to '- Delete CSV', destroy_all_admin_document_accesses_path, { class: 'btn btn-danger float-right' } %>
|
|
12
12
|
<%= link_to '+ Import CSV', import_admin_document_accesses_path, { class: 'btn btn-primary float-right mr-4' } %>
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
</h1>
|
|
15
15
|
<% if params[:document_id] %>
|
|
16
16
|
<h2 class='h3'>
|
|
17
|
-
<%= link_to(@document.title,
|
|
17
|
+
<%= link_to(@document.title, admin_document_path(@document)) %>
|
|
18
18
|
·
|
|
19
19
|
<%= @document_accesses.count %> urls
|
|
20
20
|
</h2>
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
<% if @pagy %>
|
|
26
26
|
<h6>
|
|
27
27
|
<span class='float-left mt-3'>
|
|
28
|
-
<%== pagy_info(@pagy
|
|
28
|
+
<%== pagy_info(@pagy) %>
|
|
29
29
|
</span>
|
|
30
30
|
<span class='float-right'>
|
|
31
31
|
<%== pagy_bootstrap_nav(@pagy) %>
|
|
@@ -48,9 +48,9 @@
|
|
|
48
48
|
<tbody>
|
|
49
49
|
<% @document_accesses.each do |document_access| %>
|
|
50
50
|
<tr>
|
|
51
|
-
<td><%= link_to 'Edit',
|
|
52
|
-
<td><%= link_to 'Destroy',
|
|
53
|
-
<td><%= link_to document_access.friendlier_id,
|
|
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
54
|
<td><%= document_access.institution_code %></td>
|
|
55
55
|
<td><%= b1g_institution_codes[document_access.institution_code] %></td>
|
|
56
56
|
<td><%= link_to(document_access.access_url, document_access.access_url) %></td>
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
<% if @pagy %>
|
|
63
63
|
<h6>
|
|
64
64
|
<span class='float-left mt-3'>
|
|
65
|
-
<%== pagy_info(@pagy
|
|
65
|
+
<%== pagy_info(@pagy) %>
|
|
66
66
|
</span>
|
|
67
67
|
<span class='float-right'>
|
|
68
68
|
<%== pagy_bootstrap_nav(@pagy) %>
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
</p>
|
|
21
21
|
<h3 class='h4'>Upload a CSV File</h3>
|
|
22
22
|
|
|
23
|
-
<%= simple_form_for DocumentDownload.new, url:
|
|
23
|
+
<%= simple_form_for DocumentDownload.new, url: destroy_all_admin_document_downloads_path, method: :post, multipart: true do |f| %>
|
|
24
24
|
<div class="form-group">
|
|
25
25
|
<div class="form-inputs">
|
|
26
26
|
<%= f.simple_fields_for :downloads do |download_fields| %>
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
</p>
|
|
21
21
|
|
|
22
22
|
<h3 class="h4">Upload a CSV File</h3>
|
|
23
|
-
<%= simple_form_for DocumentDownload.new, url:
|
|
23
|
+
<%= simple_form_for DocumentDownload.new, url: import_admin_document_downloads_path, method: :post, multipart: true do |f| %>
|
|
24
24
|
<div class="form-inputs">
|
|
25
25
|
<%= f.simple_fields_for :downloads do |download_fields| %>
|
|
26
26
|
<%= download_fields.input :file, as: :file, input_html: {} %>
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
<%- @page_title = "
|
|
1
|
+
<%- @page_title = "GBL♦Admin - Document - Download Links" %>
|
|
2
2
|
|
|
3
3
|
<h1 style="width:100%;">
|
|
4
4
|
Document · Download Links
|
|
5
5
|
|
|
6
6
|
<% if params[:document_id] %>
|
|
7
|
-
<%= link_to '+ Import CSV',
|
|
7
|
+
<%= link_to '+ Import CSV', import_admin_document_document_downloads_path(@document), { class: 'btn btn-primary float-right' } %>
|
|
8
8
|
|
|
9
|
-
<%= link_to '+ New Download URL',
|
|
9
|
+
<%= link_to '+ New Download URL', new_admin_document_document_download_path(@document), { class: 'btn btn-primary float-right mr-2' } %>
|
|
10
10
|
<% else %>
|
|
11
11
|
<%= link_to '- Delete CSV', destroy_all_admin_document_downloads_path, { class: 'btn btn-danger float-right' } %>
|
|
12
12
|
<%= link_to '+ Import CSV', import_admin_document_downloads_path, { class: 'btn btn-primary float-right mr-4' } %>
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
</h1>
|
|
15
15
|
<% if params[:document_id] %>
|
|
16
16
|
<h2 class='h3'>
|
|
17
|
-
<%= link_to(@document.title,
|
|
17
|
+
<%= link_to(@document.title, admin_document_path(@document)) %>
|
|
18
18
|
·
|
|
19
19
|
<%= @document_downloads.count %> downloads
|
|
20
20
|
</h2>
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
<% if @pagy %>
|
|
26
26
|
<h6>
|
|
27
27
|
<span class='float-left mt-3'>
|
|
28
|
-
<%== pagy_info(@pagy
|
|
28
|
+
<%== pagy_info(@pagy) %>
|
|
29
29
|
</span>
|
|
30
30
|
<span class='float-right'>
|
|
31
31
|
<%== pagy_bootstrap_nav(@pagy) %>
|
|
@@ -46,9 +46,9 @@
|
|
|
46
46
|
<tbody>
|
|
47
47
|
<% @document_downloads.each do |document_download| %>
|
|
48
48
|
<tr>
|
|
49
|
-
<td><%= link_to 'Edit',
|
|
50
|
-
<td><%= link_to 'Destroy',
|
|
51
|
-
<td><%= link_to document_download.friendlier_id,
|
|
49
|
+
<td><%= link_to 'Edit', edit_admin_document_document_download_path(document_download.document, document_download) %></td>
|
|
50
|
+
<td><%= link_to 'Destroy', admin_document_document_download_path(document_download.document, document_download), method: :delete, data: { confirm: 'Are you sure?' } %></td>
|
|
51
|
+
<td><%= link_to document_download.friendlier_id, admin_document_path(document_download.document) %></td>
|
|
52
52
|
<td><%= document_download.label %></td>
|
|
53
53
|
<td><%= link_to document_download.value %></td>
|
|
54
54
|
</tr>
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
<% if @pagy %>
|
|
60
60
|
<h6>
|
|
61
61
|
<span class='float-left mt-3'>
|
|
62
|
-
<%== pagy_info(@pagy
|
|
62
|
+
<%== pagy_info(@pagy) %>
|
|
63
63
|
</span>
|
|
64
64
|
<span class='float-right'>
|
|
65
65
|
<%== pagy_bootstrap_nav(@pagy) %>
|
|
@@ -20,5 +20,5 @@
|
|
|
20
20
|
<%= @document_download.position %>
|
|
21
21
|
</p>
|
|
22
22
|
|
|
23
|
-
<%= link_to 'Edit',
|
|
24
|
-
<%= link_to 'Back',
|
|
23
|
+
<%= link_to 'Edit', edit_admin_document_download_path(@document_download) %> |
|
|
24
|
+
<%= link_to 'Back', admin_document_downloads_path %>
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
</span>
|
|
10
10
|
|
|
11
11
|
<span class="create_bookmark <%= 'hidden' if current_user.document_is_bookmarked?(document) %>">
|
|
12
|
-
<%= link_to
|
|
12
|
+
<%= link_to admin_bookmarks_path(document: document, user: current_user.id), method: :post, id: 'random_id', remote: true do %>
|
|
13
13
|
<%= content_tag :span, { data: { toggle: 'tooltip', friendlier_id: document.friendlier_id }, title: 'Not bookmarked' } do %>
|
|
14
14
|
<%= inline_svg_tag "bookmark-regular.svg", class: 'icon baseline bookmark-icon' %>
|
|
15
15
|
<% end %>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<div class="make-me-sticky mt-4 ml-4">
|
|
2
2
|
<nav class="nav flex-column ml-4 mt-6">
|
|
3
|
-
<strong class="mt-4"><%= link_to "View in
|
|
3
|
+
<strong class="mt-4"><%= link_to "GBL♦Admin | View in GeoBlacklight", blacklight_link(@document), { class: 'btn btn-warning' } %></strong>
|
|
4
4
|
|
|
5
5
|
<%- form_elements = FormElement.all.order(position: :asc) %>
|
|
6
6
|
<%- form_elements.each do |form_element| %>
|
|
@@ -9,8 +9,6 @@ Element.exportable.each do |elm|
|
|
|
9
9
|
json.set! elm.solr_field.to_s.to_sym, document.send(elm.export_value)
|
|
10
10
|
end
|
|
11
11
|
else
|
|
12
|
-
unless document.send(elm.export_value).blank?
|
|
13
|
-
json.set! elm.solr_field.to_s.to_sym, document.send(elm.export_value)
|
|
14
|
-
end
|
|
12
|
+
json.set! elm.solr_field.to_s.to_sym, document.send(elm.export_value) unless document.send(elm.export_value).blank?
|
|
15
13
|
end
|
|
16
14
|
end
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
<% @document.document_downloads.each do |document_download| %>
|
|
16
16
|
<tr>
|
|
17
17
|
<td><%= link_to 'Edit', edit_admin_document_document_download_path(document_download.document, document_download) %></td>
|
|
18
|
-
<td><%= link_to 'Destroy',
|
|
19
|
-
<td><%= link_to document_download.friendlier_id,
|
|
18
|
+
<td><%= link_to 'Destroy', admin_document_document_download_path(document_download.document, document_download), method: :delete, data: { confirm: 'Are you sure?' } %></td>
|
|
19
|
+
<td><%= link_to document_download.friendlier_id, admin_document_path(document_download.document) %></td>
|
|
20
20
|
<td><%= document_download.label %></td>
|
|
21
21
|
<td><%= link_to document_download.value %></td>
|
|
22
22
|
</tr>
|
|
@@ -1,2 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
json.extract! element, :id, :label, :solr_field, :field_definition, :field_type, :required, :repeatable, :formable,
|
|
4
|
+
:placeholder_text, :data_entry_hint, :test_fixture_example, :controlled_vocabulary, :js_behaviors, :html_attributes, :display_only_on_persisted, :importable, :import_deliminated, :import_transformation_method, :exportable, :export_transformation_method, :indexable, :index_transformation_method, :validation_method, :created_at, :updated_at
|
|
2
5
|
json.url element_url(element, format: :json)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<%- @page_title = "
|
|
1
|
+
<%- @page_title = "GBL♦Admin - Elements" %>
|
|
2
2
|
|
|
3
3
|
<h1 style="width:100%;">
|
|
4
4
|
Elements
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
<h6>
|
|
11
11
|
<span class='float-left mt-3'>
|
|
12
|
-
<%== pagy_info(@pagy
|
|
12
|
+
<%== pagy_info(@pagy) %>
|
|
13
13
|
</span>
|
|
14
14
|
<span class='float-right'>
|
|
15
15
|
<%== pagy_bootstrap_nav(@pagy) %>
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
|
|
52
52
|
<h6>
|
|
53
53
|
<span class='float-left mt-3'>
|
|
54
|
-
<%== pagy_info(@pagy
|
|
54
|
+
<%== pagy_info(@pagy) %>
|
|
55
55
|
</span>
|
|
56
56
|
<span class='float-right'>
|
|
57
57
|
<%== pagy_bootstrap_nav(@pagy) %>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<%- @page_title = "Element - #{@element.label}" %>
|
|
1
|
+
<%- @page_title = "GBL♦Admin - Element - #{@element.label}" %>
|
|
2
2
|
|
|
3
3
|
<h1>Element</h1>
|
|
4
4
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
<div class="col-9">
|
|
7
7
|
<h2>
|
|
8
8
|
<%= @element.label %>
|
|
9
|
-
<%= link_to '~ Edit Element',
|
|
9
|
+
<%= link_to '~ Edit Element', edit_admin_element_path, { class: 'btn btn-primary float-right' } %>
|
|
10
10
|
</h2>
|
|
11
11
|
|
|
12
12
|
<table class="table table-bordered">
|
|
@@ -108,14 +108,14 @@
|
|
|
108
108
|
</div>
|
|
109
109
|
|
|
110
110
|
<div class="col-3">
|
|
111
|
-
<h3><%= link_to "Elements",
|
|
111
|
+
<h3><%= link_to "Elements", admin_elements_path %></h3>
|
|
112
112
|
<%- @elements = Element.all %>
|
|
113
113
|
<ul>
|
|
114
114
|
<%- @elements.each do |elm| %>
|
|
115
|
-
<li><%= link_to_unless_current(elm.label, elm) %></li>
|
|
115
|
+
<li><%= link_to_unless_current(elm.label, admin_element_url(elm)) %></li>
|
|
116
116
|
<%- end %>
|
|
117
117
|
</ul>
|
|
118
118
|
</div>
|
|
119
119
|
</div>
|
|
120
|
-
<%= link_to 'Edit',
|
|
121
|
-
<%= link_to 'Back',
|
|
120
|
+
<%= link_to 'Edit', edit_admin_element_path(@element) %> |
|
|
121
|
+
<%= link_to 'Back', admin_elements_path %>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<div class="row">
|
|
2
2
|
<div class="col-6">
|
|
3
|
-
<%= simple_form_for(@form_element.becomes(FormElement)) do |f| %>
|
|
3
|
+
<%= simple_form_for([:admin, @form_element.becomes(FormElement)]) do |f| %>
|
|
4
4
|
<%= f.error_notification %>
|
|
5
5
|
<%= f.error_notification message: f.object.errors[:base].to_sentence if f.object.errors[:base].present? %>
|
|
6
6
|
|
|
@@ -15,5 +15,5 @@
|
|
|
15
15
|
<%= @form_element.element_solr_field %>
|
|
16
16
|
</p>
|
|
17
17
|
|
|
18
|
-
<%= link_to 'Edit',
|
|
19
|
-
<%= link_to 'Back',
|
|
18
|
+
<%= link_to 'Edit', edit_admin_form_element_path(@form_element) %> |
|
|
19
|
+
<%= link_to 'Back', admin_form_elements_path %>
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
|
+
|
|
2
3
|
json.links do
|
|
3
4
|
json.self url_for(search_state.to_h.merge(only_path: false))
|
|
4
5
|
json.prev url_for(search_state.to_h.merge(only_path: false, page: @response.prev_page.to_s)) if @response.prev_page
|
|
@@ -19,10 +20,10 @@ json.data do
|
|
|
19
20
|
doc_presenter = index_presenter(document)
|
|
20
21
|
|
|
21
22
|
doc_presenter.fields_to_render.each do |field_name, field|
|
|
22
|
-
json.partial!
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
json.partial! "field", field: field,
|
|
24
|
+
field_name: field_name,
|
|
25
|
+
document_url: document_url,
|
|
26
|
+
doc_presenter: doc_presenter
|
|
26
27
|
end
|
|
27
28
|
end
|
|
28
29
|
|
|
@@ -34,7 +35,7 @@ end
|
|
|
34
35
|
|
|
35
36
|
json.included do
|
|
36
37
|
json.array! @presenter.search_facets do |facet|
|
|
37
|
-
json.type
|
|
38
|
+
json.type "facet"
|
|
38
39
|
json.id facet.name
|
|
39
40
|
json.attributes do
|
|
40
41
|
facet_config = facet_configuration_for_field(facet.name)
|
|
@@ -63,7 +64,7 @@ json.included do
|
|
|
63
64
|
end
|
|
64
65
|
|
|
65
66
|
json.array! search_fields do |(label, key)|
|
|
66
|
-
json.type
|
|
67
|
+
json.type "search_field"
|
|
67
68
|
json.id key
|
|
68
69
|
json.attributes do
|
|
69
70
|
json.label label
|
|
@@ -74,7 +75,7 @@ json.included do
|
|
|
74
75
|
end
|
|
75
76
|
|
|
76
77
|
json.array! active_sort_fields do |key, field|
|
|
77
|
-
json.type
|
|
78
|
+
json.type "sort"
|
|
78
79
|
json.id key
|
|
79
80
|
json.attributes do
|
|
80
81
|
json.label field.label
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
|
+
|
|
2
3
|
json.links do
|
|
3
4
|
json.self url_for(search_state.to_h.merge(only_path: false))
|
|
4
5
|
json.prev url_for(search_state.to_h.merge(only_path: false, page: @response.prev_page.to_s)) if @response.prev_page
|
|
@@ -18,7 +19,7 @@ end
|
|
|
18
19
|
|
|
19
20
|
json.included do
|
|
20
21
|
json.array! search_fields do |(label, key)|
|
|
21
|
-
json.type
|
|
22
|
+
json.type "search_field"
|
|
22
23
|
json.id key
|
|
23
24
|
json.attributes do
|
|
24
25
|
json.label label
|
|
@@ -29,7 +30,7 @@ json.included do
|
|
|
29
30
|
end
|
|
30
31
|
|
|
31
32
|
json.array! active_sort_fields do |key, field|
|
|
32
|
-
json.type
|
|
33
|
+
json.type "sort"
|
|
33
34
|
json.id key
|
|
34
35
|
json.attributes do
|
|
35
36
|
json.label field.label
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
json.extract! import, :id, :name, :filename, :source, :description, :row_count, :headers, :encoding, :content_type,
|
|
3
|
+
json.extract! import, :id, :name, :filename, :source, :description, :row_count, :headers, :encoding, :content_type,
|
|
4
|
+
:extension, :validity, :validation_result, :created_at, :updated_at
|
|
4
5
|
json.url import_url(import, format: :json)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<h6>
|
|
2
2
|
<span class='float-left mt-3'>
|
|
3
|
-
<%== pagy_info(@pagy_failed
|
|
3
|
+
<%== pagy_info(@pagy_failed) %>
|
|
4
4
|
</span>
|
|
5
5
|
<span class='float-right'>
|
|
6
6
|
<%== pagy_bootstrap_nav(@pagy_failed) %>
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
<td><%= doc.title %></td>
|
|
28
28
|
<td><%= doc.friendlier_id %></td>
|
|
29
29
|
<td>
|
|
30
|
-
<%= link_to
|
|
30
|
+
<%= link_to admin_import_import_document_path(@import, doc) do %>
|
|
31
31
|
<%= doc.state_machine&.last_transition&.metadata %>
|
|
32
32
|
<% end %>
|
|
33
33
|
</td>
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<h1>Editing Import</h1>
|
|
2
2
|
|
|
3
|
-
<%= simple_form_for(@import, :url =>
|
|
3
|
+
<%= simple_form_for(@import, :url => admin_import_path) do |f| %>
|
|
4
4
|
<%= render 'form', import: @import, f: f %>
|
|
5
5
|
<% end %>
|
|
6
6
|
|
|
7
|
-
<%= link_to 'Show',
|
|
8
|
-
<%= link_to 'Back',
|
|
7
|
+
<%= link_to 'Show', admin_import_path(@import) %> |
|
|
8
|
+
<%= link_to 'Back', admin_imports_path %>
|