geoblacklight_admin 0.0.1 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (186) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +59 -36
  3. data/Rakefile +47 -14
  4. data/app/assets/javascripts/geoblacklight_admin.js +2 -1
  5. data/app/assets/stylesheets/geoblacklight_admin/_core.scss +5 -0
  6. data/app/assets/stylesheets/geoblacklight_admin/modules/_chosen.scss +425 -0
  7. data/app/assets/stylesheets/geoblacklight_admin/modules/_forms.scss +108 -0
  8. data/app/controllers/admin/admin_controller.rb +4 -2
  9. data/app/controllers/admin/advanced_search_controller.rb +123 -103
  10. data/app/controllers/admin/api_controller.rb +123 -108
  11. data/app/controllers/admin/bookmarks_controller.rb +4 -4
  12. data/app/controllers/admin/bulk_actions_controller.rb +9 -4
  13. data/app/controllers/admin/concerns/upload_util.rb +2 -0
  14. data/app/controllers/admin/document_accesses_controller.rb +10 -4
  15. data/app/controllers/admin/document_assets_controller.rb +14 -11
  16. data/app/controllers/admin/document_downloads_controller.rb +12 -10
  17. data/app/controllers/admin/documents_controller.rb +32 -15
  18. data/app/controllers/admin/elements_controller.rb +6 -5
  19. data/app/controllers/admin/form_elements_controller.rb +4 -4
  20. data/app/controllers/admin/ids_controller.rb +107 -87
  21. data/app/controllers/admin/import_documents_controller.rb +1 -1
  22. data/app/controllers/admin/imports_controller.rb +7 -3
  23. data/app/controllers/admin/mappings_controller.rb +6 -4
  24. data/app/controllers/admin/notifications_controller.rb +1 -1
  25. data/app/controllers/admin/search_controller.rb +3 -2
  26. data/app/controllers/admin/users_controller.rb +2 -2
  27. data/app/helpers/form_input_helper.rb +4 -4
  28. data/app/helpers/geoblacklight_admin_helper.rb +1 -1
  29. data/app/indexers/document_indexer.rb +1 -1
  30. data/app/jobs/export_job.rb +9 -6
  31. data/app/jobs/export_json_bulk_job.rb +95 -0
  32. data/app/jobs/export_json_job.rb +14 -12
  33. data/app/models/admin/bookmark.rb +18 -0
  34. data/app/models/api_search_builder.rb +3 -1
  35. data/app/models/blacklight_api.rb +6 -6
  36. data/app/models/blacklight_api_facets.rb +7 -2
  37. data/app/models/blacklight_api_ids.rb +3 -4
  38. data/app/models/bulk_action.rb +1 -1
  39. data/app/models/document/bbox_validator.rb +9 -5
  40. data/app/models/document/date_range_validator.rb +13 -10
  41. data/app/models/document/geom_validator.rb +4 -2
  42. data/app/models/document.rb +15 -7
  43. data/app/models/element.rb +9 -7
  44. data/app/models/form_control.rb +2 -0
  45. data/app/models/form_element.rb +2 -0
  46. data/app/models/form_feature.rb +2 -0
  47. data/app/models/form_group.rb +2 -0
  48. data/app/models/form_header.rb +2 -0
  49. data/app/models/geoblacklight_admin/schema.rb +5 -2
  50. data/app/models/geoblacklight_admin.rb +2 -0
  51. data/app/models/import/csv_duplicates_validator.rb +2 -1
  52. data/app/models/import/csv_header_validator.rb +2 -1
  53. data/app/models/import.rb +4 -7
  54. data/app/models/user.rb +1 -1
  55. data/app/services/export_csv_service.rb +5 -1
  56. data/app/views/admin/advanced_search/facets.json.jbuilder +9 -8
  57. data/app/views/admin/advanced_search/index.json.jbuilder +8 -7
  58. data/app/views/admin/api/_field.json.jbuilder +1 -1
  59. data/app/views/admin/api/fetch.json.jbuilder +8 -7
  60. data/app/views/admin/api/index.json.jbuilder +8 -7
  61. data/app/views/admin/bookmarks/index.html.erb +2 -2
  62. data/app/views/admin/bulk_actions/index.html.erb +3 -3
  63. data/app/views/admin/bulk_actions/show.html.erb +1 -1
  64. data/app/views/admin/document_accesses/_form.html.erb +1 -1
  65. data/app/views/admin/document_accesses/destroy_all.html.erb +3 -3
  66. data/app/views/admin/document_accesses/edit.html.erb +1 -1
  67. data/app/views/admin/document_accesses/import.html.erb +2 -2
  68. data/app/views/admin/document_accesses/index.html.erb +9 -9
  69. data/app/views/admin/document_accesses/new.html.erb +1 -1
  70. data/app/views/admin/document_downloads/_form.html.erb +1 -1
  71. data/app/views/admin/document_downloads/destroy_all.html.erb +2 -2
  72. data/app/views/admin/document_downloads/edit.html.erb +2 -3
  73. data/app/views/admin/document_downloads/import.html.erb +1 -1
  74. data/app/views/admin/document_downloads/index.html.erb +9 -9
  75. data/app/views/admin/document_downloads/new.html.erb +1 -1
  76. data/app/views/admin/document_downloads/show.html.erb +2 -2
  77. data/app/views/admin/documents/_document_bookmark.html.erb +1 -1
  78. data/app/views/admin/documents/_form_nav.html.erb +3 -1
  79. data/app/views/admin/documents/_json_btaa_aardvark.jbuilder +1 -3
  80. data/app/views/admin/documents/_json_file.jbuilder +14 -0
  81. data/app/views/admin/documents/_result_selected_options.html.erb +3 -1
  82. data/app/views/admin/documents/edit.html.erb +1 -1
  83. data/app/views/admin/documents/features/_multiple_download_links.html.erb +2 -2
  84. data/app/views/admin/documents/fetch.json_file.jbuilder +9 -0
  85. data/app/views/admin/documents/index.html.erb +2 -4
  86. data/app/views/admin/documents/index.json_file.jbuilder +9 -0
  87. data/app/views/admin/documents/versions.html.erb +1 -1
  88. data/app/views/admin/elements/_element.json.jbuilder +4 -1
  89. data/app/views/admin/elements/_form.html.erb +1 -1
  90. data/app/views/admin/elements/edit.html.erb +2 -2
  91. data/app/views/admin/elements/index.html.erb +4 -4
  92. data/app/views/admin/elements/index.json.jbuilder +2 -0
  93. data/app/views/admin/elements/new.html.erb +1 -1
  94. data/app/views/admin/elements/show.html.erb +6 -6
  95. data/app/views/admin/elements/show.json.jbuilder +2 -0
  96. data/app/views/admin/form_elements/_form.html.erb +1 -1
  97. data/app/views/admin/form_elements/_form_element.json.jbuilder +2 -0
  98. data/app/views/admin/form_elements/edit.html.erb +2 -2
  99. data/app/views/admin/form_elements/index.html.erb +2 -2
  100. data/app/views/admin/form_elements/index.json.jbuilder +2 -0
  101. data/app/views/admin/form_elements/new.html.erb +1 -1
  102. data/app/views/admin/form_elements/show.html.erb +2 -2
  103. data/app/views/admin/form_elements/show.json.jbuilder +2 -0
  104. data/app/views/admin/ids/fetch.json.jbuilder +8 -7
  105. data/app/views/admin/ids/index.json.jbuilder +3 -2
  106. data/app/views/admin/import_documents/show.html.haml +1 -1
  107. data/app/views/admin/imports/_import.json.jbuilder +2 -1
  108. data/app/views/admin/imports/_show_failed_tab.html.erb +2 -2
  109. data/app/views/admin/imports/_show_success_tab.html.erb +1 -1
  110. data/app/views/admin/imports/edit.html.erb +3 -3
  111. data/app/views/admin/imports/index.html.erb +3 -3
  112. data/app/views/admin/layouts/application.html.erb +4 -4
  113. data/app/views/admin/mappings/_form.html.erb +1 -1
  114. data/app/views/admin/mappings/_mapping.json.jbuilder +2 -1
  115. data/app/views/admin/mappings/edit.html.erb +2 -2
  116. data/app/views/admin/mappings/new.html.erb +1 -1
  117. data/app/views/admin/mappings/show.html.erb +2 -2
  118. data/app/views/admin/notifications/index.html.erb +3 -3
  119. data/app/views/admin/search/index.html.erb +2 -2
  120. data/app/views/admin/shared/_navbar.html.erb +11 -6
  121. data/app/views/admin/shared/_toast.html.erb +1 -1
  122. data/app/views/admin/users/index.html.erb +1 -1
  123. data/app/views/catalog/_show_gbl_admin.html.erb +3 -0
  124. data/config/locales/documents.en.yml +3 -0
  125. data/config/routes.rb +37 -33
  126. data/db/migrate/20230316183001_add_geoblacklight_admin_gem.rb +409 -0
  127. data/db/seeds.rb +7 -6
  128. data/db/seeds_elements.csv +56 -55
  129. data/db/seeds_elements.numbers +0 -0
  130. data/db/seeds_form_elements.csv +65 -64
  131. data/db/seeds_form_elements.numbers +0 -0
  132. data/lib/generators/geoblacklight_admin/config_generator.rb +61 -94
  133. data/lib/generators/geoblacklight_admin/install_generator.rb +3 -12
  134. data/lib/generators/geoblacklight_admin/jobs_generator.rb +3 -2
  135. data/lib/generators/geoblacklight_admin/models_generator.rb +0 -1
  136. data/lib/generators/geoblacklight_admin/templates/_show_sidebar.html.erb +19 -0
  137. data/lib/generators/geoblacklight_admin/templates/_user_util_links.html.erb +1 -1
  138. data/lib/generators/geoblacklight_admin/templates/config/database.yml +9 -5
  139. data/lib/generators/geoblacklight_admin/templates/config/geomg_aardvark_schema.json +12 -6
  140. data/lib/generators/geoblacklight_admin/templates/config/initializers/devise.rb +315 -0
  141. data/lib/generators/geoblacklight_admin/templates/config/initializers/geoblacklight_admin.rb +1 -2
  142. data/lib/generators/geoblacklight_admin/templates/config/initializers/kithe.rb +2 -0
  143. data/lib/generators/geoblacklight_admin/templates/config/initializers/mime_types.rb +15 -0
  144. data/lib/generators/geoblacklight_admin/templates/config/initializers/pagy.rb +152 -68
  145. data/lib/generators/geoblacklight_admin/templates/config/initializers/simple_form.rb +178 -0
  146. data/lib/generators/geoblacklight_admin/templates/config/initializers/simple_form_bootstrap.rb +365 -0
  147. data/lib/generators/geoblacklight_admin/templates/config/settings.yml +293 -0
  148. data/lib/generators/geoblacklight_admin/templates/javascript/controllers/results_controller.js +10 -0
  149. data/lib/generators/geoblacklight_admin/templates/package.json +3 -0
  150. data/lib/generators/geoblacklight_admin/templates/solr/conf/schema.xml +3 -3
  151. data/lib/generators/geoblacklight_admin/views_generator.rb +2 -3
  152. data/lib/geoblacklight_admin/engine.rb +5 -6
  153. data/lib/geoblacklight_admin/version.rb +1 -1
  154. data/lib/geoblacklight_admin.rb +1 -1
  155. data/lib/tasks/geoblacklight_admin.rake +15 -11
  156. metadata +101 -63
  157. data/.editorconfig +0 -18
  158. data/.gitignore +0 -75
  159. data/.standard.yml +0 -4
  160. data/Gemfile +0 -59
  161. data/LICENSE +0 -21
  162. data/app/assets/images/.keep +0 -0
  163. data/app/controllers/admin/concerns/.keep +0 -0
  164. data/app/models/bookmark.rb +0 -17
  165. data/app/models/concerns/.keep +0 -0
  166. data/db/migrate/20230316183001_add_geoblacklight_admin.rb +0 -399
  167. data/geoblacklight_admin.gemspec +0 -67
  168. data/lib/generators/geoblacklight_admin/example_docs_generator.rb +0 -18
  169. data/lib/generators/geoblacklight_admin/templates/.env.development.example +0 -28
  170. data/lib/generators/geoblacklight_admin/templates/.solr_wrapper.yml +0 -7
  171. data/lib/generators/geoblacklight_admin/templates/solr/snapshots/.keep +0 -0
  172. data/lib/tasks/.keep +0 -0
  173. data/spec/test_app_templates/lib/generators/test_app_generator.rb +0 -35
  174. data/template.rb +0 -16
  175. /data/{app/views/admin → lib/generators/geoblacklight_admin/templates}/devise/confirmations/new.html.erb +0 -0
  176. /data/{app/views/admin → lib/generators/geoblacklight_admin/templates}/devise/invitations/edit.html.erb +0 -0
  177. /data/{app/views/admin → lib/generators/geoblacklight_admin/templates}/devise/invitations/new.html.erb +0 -0
  178. /data/{app/views/admin → lib/generators/geoblacklight_admin/templates}/devise/mailer/invitation_instructions.html.erb +0 -0
  179. /data/{app/views/admin → lib/generators/geoblacklight_admin/templates}/devise/mailer/invitation_instructions.text.erb +0 -0
  180. /data/{app/views/admin → lib/generators/geoblacklight_admin/templates}/devise/passwords/edit.html.erb +0 -0
  181. /data/{app/views/admin → lib/generators/geoblacklight_admin/templates}/devise/passwords/new.html.erb +0 -0
  182. /data/{app/views/admin → lib/generators/geoblacklight_admin/templates}/devise/registrations/edit.html.erb +0 -0
  183. /data/{app/views/admin → lib/generators/geoblacklight_admin/templates}/devise/registrations/new.html.erb +0 -0
  184. /data/{app/views/admin → lib/generators/geoblacklight_admin/templates}/devise/sessions/new.html.erb +0 -0
  185. /data/{app/views/admin → lib/generators/geoblacklight_admin/templates}/devise/shared/_links.html.erb +0 -0
  186. /data/{app/views/admin → lib/generators/geoblacklight_admin/templates}/devise/unlocks/new.html.erb +0 -0
@@ -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 bookmarks_path(document: document, user: current_user.id), method: :post, id: 'random_id', remote: true do %>
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,8 @@
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 Geoportal", blacklight_link(@document), { class: 'mt-6', target: :_blank } %></strong>
3
+ <% if @document.persisted? %>
4
+ <strong class="mt-4"><%= link_to "GBL♦Admin | View in GeoBlacklight", solr_document_url(@document), { class: 'btn btn-warning' } %></strong>
5
+ <% end %>
4
6
 
5
7
  <%- form_elements = FormElement.all.order(position: :asc) %>
6
8
  <%- 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
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Required
4
+ json.set! :gbl_mdVersion_s, "BTAA Aardvark"
5
+
6
+ Element.exportable.each do |elm|
7
+ if document.send(elm.export_value).is_a?(Array)
8
+ if document.send(elm.export_value).any?(&:present?)
9
+ json.set! elm.solr_field.to_s.to_sym, document.send(elm.export_value)
10
+ end
11
+ else
12
+ json.set! elm.solr_field.to_s.to_sym, document.send(elm.export_value) unless document.send(elm.export_value).blank?
13
+ end
14
+ end
@@ -1,6 +1,7 @@
1
1
  <span id="result-selected-options" class="hidden" data-scope="pageset" data-controller="results" data-resultset="<%= admin_documents_path( params.to_unsafe_h.merge({rows: '1000000'})) %>" data-pageset="/fetch?">
2
2
 
3
3
  <%= form_with(model: BulkAction.new, html: { id: 'result-action-form', data: { type: "html", action: "submit->results#setPubState" }, style: 'display:inline'}, url: admin_bulk_actions_path) do |form| -%>
4
+ <%= form.hidden_field :request, value: "#{request.protocol}#{request.host}:#{request.port}" %>
4
5
  <%= form.hidden_field :scope, value: "-" %>
5
6
  <%= form.hidden_field :field_name, value: "" %>
6
7
  <%= form.hidden_field :field_value, value: "" %>
@@ -16,7 +17,8 @@
16
17
  CSV
17
18
  </a>
18
19
  <div class="dropdown-divider"></div>
19
- <a class="dropdown-item" data-action="click->results#exportJsonAardvark" href="javascript:void(0);">JSON (Aardvark)</a>
20
+ <a class="dropdown-item" data-action="click->results#exportJsonFile" href="javascript:void(0);">JSON (Single File)</a>
21
+ <a class="dropdown-item" data-action="click->results#exportJsonAardvark" href="javascript:void(0);">JSON (Tree Directory)</a>
20
22
  <a class="dropdown-item" data-action="click->results#exportJsonBtaaAardvark" href="javascript:void(0);">JSON (BTAA Aardvark)</a>
21
23
  <a class="dropdown-item" data-action="click->results#exportJsonGBLv1" href="javascript:void(0);">JSON (GBL v1.0)</a>
22
24
  <div class="dropdown-divider"></div>
@@ -1,4 +1,4 @@
1
- <%- @page_title= "GEOMG - #{@document.title}" %>
1
+ <%- @page_title= "GBL♦Admin - #{@document.title}" %>
2
2
 
3
3
  <div class="row flex-xl-nowrap">
4
4
  <main class="col-md-12">
@@ -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', 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, document_path(document_download.document) %></td>
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>
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ json.ignore_nil!
4
+
5
+ json.array! @documents.map do |document|
6
+ next if document.nil? # Guard against Solr/DB being out of sync
7
+
8
+ json.partial! "json_btaa_aardvark", document: document
9
+ end
@@ -1,4 +1,4 @@
1
- <%- @page_title= "GEOMG - Documents" %>
1
+ <%- @page_title= "GBL♦Admin - Documents" %>
2
2
 
3
3
  <h1 style="width:100%; margin-bottom:2rem;">
4
4
  Documents
@@ -44,6 +44,4 @@
44
44
  </p>
45
45
  <% end %>
46
46
  </div>
47
- </div>
48
-
49
- <%= console %>
47
+ </div>
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ json.ignore_nil!
4
+
5
+ json.array! @documents.load_all.map do |document|
6
+ next if document.nil? # Guard against Solr/DB being out of sync
7
+
8
+ json.partial! "json_btaa_aardvark", document: document
9
+ end
@@ -5,7 +5,7 @@
5
5
  </h1>
6
6
  <% if params[:document_id] %>
7
7
  <h2 class='h3'>
8
- <%= link_to(@document.title, document_path(@document)) %>
8
+ <%= link_to(@document.title, admin_document_path(@document)) %>
9
9
  &middot;
10
10
  <%= @document.versions.count %> versions
11
11
  </h2>
@@ -1,2 +1,5 @@
1
- json.extract! element, :id, :label, :solr_field, :field_definition, :field_type, :required, :repeatable, :formable, :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
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,5 +1,5 @@
1
1
 
2
- <%= simple_form_for(@element) do |f| %>
2
+ <%= simple_form_for([:admin, @element]) 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
 
@@ -2,5 +2,5 @@
2
2
 
3
3
  <%= render 'form', element: @element %>
4
4
 
5
- <%= link_to 'Show', @element %> |
6
- <%= link_to 'Back', elements_path %>
5
+ <%= link_to 'Show', admin_element_path(@element) %> |
6
+ <%= link_to 'Back', admin_elements_path %>
@@ -1,4 +1,4 @@
1
- <%- @page_title = "GEOMG - Elements" %>
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, 'elements'.pluralize(@pagy.count)) %>
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, 'elements'.pluralize(@pagy.count)) %>
54
+ <%== pagy_info(@pagy) %>
55
55
  </span>
56
56
  <span class='float-right'>
57
57
  <%== pagy_bootstrap_nav(@pagy) %>
@@ -61,7 +61,7 @@
61
61
  <br/>
62
62
 
63
63
  <script>
64
- GEOMG.SortElements(
64
+ GBLADMIN.SortElements(
65
65
  $("tbody"),
66
66
  "<%= sort_admin_elements_path %>"
67
67
  );
@@ -1 +1,3 @@
1
+ # frozen_string_literal: true
2
+
1
3
  json.array! @elements, partial: "elements/element", as: :element
@@ -2,4 +2,4 @@
2
2
 
3
3
  <%= render 'form', element: @element %>
4
4
 
5
- <%= link_to 'Back', elements_path %>
5
+ <%= link_to 'Back', admin_elements_path %>
@@ -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', edit_element_path, { class: 'btn btn-primary float-right' } %>
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", elements_path %></h3>
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', edit_element_path(@element) %> |
121
- <%= link_to 'Back', elements_path %>
120
+ <%= link_to 'Edit', edit_admin_element_path(@element) %> |
121
+ <%= link_to 'Back', admin_elements_path %>
@@ -1 +1,3 @@
1
+ # frozen_string_literal: true
2
+
1
3
  json.partial! "elements/element", element: @element
@@ -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
 
@@ -1,2 +1,4 @@
1
+ # frozen_string_literal: true
2
+
1
3
  json.extract! form_element, :id, :type, :heading, :element_solr_field, :created_at, :updated_at
2
4
  json.url form_element_url(form_element, format: :json)
@@ -2,5 +2,5 @@
2
2
 
3
3
  <%= render 'form', form_element: @form_element %>
4
4
 
5
- <%= link_to 'Show', @form_element %> |
6
- <%= link_to 'Back', form_elements_path %>
5
+ <%= link_to 'Show', admin_form_element_path(@form_element) %> |
6
+ <%= link_to 'Back', admin_form_elements_path %>
@@ -1,4 +1,4 @@
1
- <%- @page_title = "GEOMG - Form Elements" %>
1
+ <%- @page_title = "GBL♦Admin - Form Elements" %>
2
2
 
3
3
  <h1 style="width:100%;">
4
4
  Form Elements
@@ -42,7 +42,7 @@
42
42
  <%= link_to '+ New Form Element', new_admin_form_element_path, { class: 'btn btn-primary' } %>
43
43
 
44
44
  <script>
45
- GEOMG.SortElements(
45
+ GBLADMIN.SortElements(
46
46
  $("tbody"),
47
47
  "<%= sort_admin_form_elements_path %>"
48
48
  );
@@ -1 +1,3 @@
1
+ # frozen_string_literal: true
2
+
1
3
  json.array! @form_elements, partial: "form_elements/form_element", as: :form_element
@@ -2,4 +2,4 @@
2
2
 
3
3
  <%= render 'form', form_element: @form_element %>
4
4
 
5
- <%= link_to 'Back', form_elements_path %>
5
+ <%= link_to 'Back', admin_form_elements_path %>
@@ -15,5 +15,5 @@
15
15
  <%= @form_element.element_solr_field %>
16
16
  </p>
17
17
 
18
- <%= link_to 'Edit', edit_form_element_path(@form_element) %> |
19
- <%= link_to 'Back', form_elements_path %>
18
+ <%= link_to 'Edit', edit_admin_form_element_path(@form_element) %> |
19
+ <%= link_to 'Back', admin_form_elements_path %>
@@ -1 +1,3 @@
1
+ # frozen_string_literal: true
2
+
1
3
  json.partial! "form_elements/form_element", form_element: @form_element
@@ -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! 'field', field: field,
23
- field_name: field_name,
24
- document_url: document_url,
25
- doc_presenter: doc_presenter
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 'facet'
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 'search_field'
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 'sort'
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 'search_field'
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 'sort'
33
+ json.type "sort"
33
34
  json.id key
34
35
  json.attributes do
35
36
  json.label field.label
@@ -1,5 +1,5 @@
1
1
  %p
2
- = link_to('Return to Import', import_path(@import_document.import_id))
2
+ = link_to('Return to Import', admin_import_path(@import_document.import_id))
3
3
 
4
4
  %h1 ImportDocument
5
5
  %p Raw CSV mapped to GEOMG ImportDocument
@@ -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, :extension, :validity, :validation_result, :created_at, :updated_at
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, 'failed documents'.pluralize(@pagy_failed.count)) %>
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 import_import_document_path(@import, doc) do %>
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,6 +1,6 @@
1
1
  <h6>
2
2
  <span class='float-left mt-3'>
3
- <%== pagy_info(@pagy_success, 'successful documents'.pluralize(@pagy_success.count)) %>
3
+ <%== pagy_info(@pagy_success) %>
4
4
  </span>
5
5
  <span class='float-right'>
6
6
  <%== pagy_bootstrap_nav(@pagy_success) %>
@@ -1,8 +1,8 @@
1
1
  <h1>Editing Import</h1>
2
2
 
3
- <%= simple_form_for(@import, :url => import_path) do |f| %>
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', import_path(@import) %> |
8
- <%= link_to 'Back', imports_path %>
7
+ <%= link_to 'Show', admin_import_path(@import) %> |
8
+ <%= link_to 'Back', admin_imports_path %>
@@ -1,4 +1,4 @@
1
- <%- @page_title = "GEOMG - Imports" %>
1
+ <%- @page_title = "GBL♦Admin - Imports" %>
2
2
 
3
3
  <h1 style="width:100%;">
4
4
  Imports
@@ -7,7 +7,7 @@
7
7
 
8
8
  <h6>
9
9
  <span class='float-left mt-3'>
10
- <%== pagy_info(@pagy, 'imports'.pluralize(@pagy.count)) %>
10
+ <%== pagy_info(@pagy) %>
11
11
  </span>
12
12
  <span class='float-right'>
13
13
  <%== pagy_bootstrap_nav(@pagy) %>
@@ -46,7 +46,7 @@
46
46
 
47
47
  <h6>
48
48
  <span class='float-left mt-3'>
49
- <%== pagy_info(@pagy, 'imports'.pluralize(@pagy.count)) %>
49
+ <%== pagy_info(@pagy) %>
50
50
  </span>
51
51
  <span class='float-right'>
52
52
  <%== pagy_bootstrap_nav(@pagy) %>
@@ -1,13 +1,13 @@
1
1
  <!DOCTYPE html>
2
2
  <html>
3
3
  <head>
4
- <title><%= @page_title || 'GBL Admin' %></title>
4
+ <title><%= @page_title || 'GBLAdmin' %></title>
5
5
  <%= csrf_meta_tags %>
6
6
  <%= csp_meta_tag %>
7
7
 
8
- <%= stylesheet_link_tag 'application', media: 'all' %>
9
- <%= javascript_include_tag "geoblacklight_admin" %>
10
- <%= javascript_pack_tag 'application' %>
8
+ <%= stylesheet_link_tag "application", media: "all" %>
9
+ <%= javascript_include_tag "geoblacklight_admin", "data-turbolinks-track": "reload" %>
10
+ <%= javascript_pack_tag "application", "data-turbolinks-track": "reload" %>
11
11
 
12
12
  <script src="https://unpkg.com/@popperjs/core@2"></script>
13
13
  <script type="text/javascript" src="https://cdn.jsdelivr.net/momentjs/latest/moment.min.js"></script>
@@ -1,5 +1,5 @@
1
1
 
2
- <%= simple_form_for([@import.becomes(Import), @mapping]) do |f| %>
2
+ <%= simple_form_for([:admin, @import.becomes(Import), @mapping]) 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
 
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- json.extract! mapping, :id, :source_header, :destination_field, :delimited, :transformation_method, :import_id, :created_at, :updated_at
3
+ json.extract! mapping, :id, :source_header, :destination_field, :delimited, :transformation_method, :import_id,
4
+ :created_at, :updated_at
4
5
  json.url mapping_url(mapping, format: :json)
@@ -2,5 +2,5 @@
2
2
 
3
3
  <%= render 'form', mapping: @mapping %>
4
4
 
5
- <%= link_to 'Show', import_mapping_path(@import, @mapping) %> |
6
- <%= link_to 'Back', import_mappings_path(@import) %>
5
+ <%= link_to 'Show', admin_import_mapping_path(@import, @mapping) %> |
6
+ <%= link_to 'Back', admin_import_mappings_path(@import) %>
@@ -2,4 +2,4 @@
2
2
 
3
3
  <%= render 'form', mapping: @mapping %>
4
4
 
5
- <%= link_to 'Back', import_mappings_path(@import) %>
5
+ <%= link_to 'Back', admin_import_mappings_path(@import) %>
@@ -23,5 +23,5 @@
23
23
  <%= @mapping.import_id %>
24
24
  </p>
25
25
 
26
- <%= link_to 'Edit', edit_import_mapping_path(@import, @mapping) %> |
27
- <%= link_to 'Back', import_mappings_path(@import) %>
26
+ <%= link_to 'Edit', edit_admin_import_mapping_path(@import, @mapping) %> |
27
+ <%= link_to 'Back', admin_import_mappings_path(@import) %>
@@ -1,4 +1,4 @@
1
- <%- @page_title = "GEOMG - Notifications" %>
1
+ <%- @page_title = "GBL♦Admin - Notifications" %>
2
2
 
3
3
  <h1 style="width:100%;">
4
4
  <%= t('dictionary.notifications') %>
@@ -9,7 +9,7 @@
9
9
  <% if @pagy %>
10
10
  <h6>
11
11
  <span class='float-left mt-3'>
12
- <%== pagy_info(@pagy, 'downloads'.pluralize(@pagy.count)) %>
12
+ <%== pagy_info(@pagy) %>
13
13
  </span>
14
14
  <span class='float-right'>
15
15
  <%== pagy_bootstrap_nav(@pagy) %>
@@ -42,7 +42,7 @@
42
42
  <% if @pagy %>
43
43
  <h6>
44
44
  <span class='float-left mt-3'>
45
- <%== pagy_info(@pagy, 'downloads'.pluralize(@pagy.count)) %>
45
+ <%== pagy_info(@pagy) %>
46
46
  </span>
47
47
  <span class='float-right'>
48
48
  <%== pagy_bootstrap_nav(@pagy) %>
@@ -1,4 +1,4 @@
1
- <%- @page_title= "Search" %>
1
+ <%- @page_title= "GBL♦Admin - Search" %>
2
2
 
3
3
  <h1 style="width:100%; margin-bottom:2rem;">
4
4
  Advanced Search
@@ -6,7 +6,7 @@
6
6
 
7
7
  <div class="row">
8
8
  <div id="search-form" class="col-8">
9
- <%= form_tag(documents_path, { method: :get, class: "my-2 my-lg-0" }) do %>
9
+ <%= form_tag(admin_documents_path, { method: :get, class: "my-2 my-lg-0" }) do %>
10
10
  <input name="q" autofocus class="form-control mr-sm-8" type="search" placeholder="Search documents" aria-label="Search" value="<%= params[:q] ? params[:q] : ''%>">
11
11
 
12
12
  <div id="facet-limits" class="col-md-12 mt-4">
@@ -1,6 +1,6 @@
1
1
  <nav class="navbar fixed-top navbar-expand-lg navbar-light bg-light">
2
- <a class="navbar-brand" href="<%=root_url%>">
3
- <strong>G&middot;E&middot;O&middot;M&middot;G</strong>
2
+ <a class="navbar-brand gbl-admin" href="<%=admin_documents_url%>">
3
+ <strong>GBL♦Admin</strong>
4
4
  </a>
5
5
  <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
6
6
  <span class="navbar-toggler-icon"></span>
@@ -24,7 +24,7 @@
24
24
  <span class="sr-only">Toggle Dropdown</span>
25
25
  </button>
26
26
  <div class="dropdown-menu">
27
- <%= link_to "Advanced", admin_advanced_search_path, { class: 'dropdown-item' } %>
27
+ <%= link_to "Advanced", admin_search_path, { class: 'dropdown-item' } %>
28
28
  </div>
29
29
  </div>
30
30
  </div>
@@ -32,6 +32,11 @@
32
32
 
33
33
  <div class="collapse navbar-collapse" id="navbarSupportedContent">
34
34
  <ul class="navbar-nav flex-row ml-md-auto d-none d-md-flex">
35
+ <li class="nav-item">
36
+ <%= link_to root_url, { class: 'nav-link' } do %>
37
+ GeoBlacklight Home
38
+ <% end %>
39
+ </li>
35
40
  <% if user_signed_in? %>
36
41
  <li class="nav-item">
37
42
  <%= link_to admin_notifications_url, { class: 'nav-link' } do %>
@@ -63,12 +68,12 @@
63
68
  </li>
64
69
  <% if user_signed_in? %>
65
70
  <li class="nav-item">
66
- <%= link_to(current_user.email, edit_user_registration_path, {class: 'nav-link'}) %>
71
+ <%= link_to "Sign out", destroy_user_session_path, { :method => :delete, class: 'nav-link'} %>
67
72
  </li>
68
73
  <li class="nav-item">
69
- <%= link_to "Sign out", destroy_user_session_path, { :method => :delete, class: 'nav-link'} %>
74
+ <%= link_to(current_user.email, edit_user_registration_path, {class: 'nav-link'}) %>
70
75
  </li>
71
- <% else %>
76
+ <% else %>
72
77
  <li class="nav-item">
73
78
  <%= link_to('Sign in', new_user_session_path, {class: 'nav-link'}) %>
74
79
  </li>
@@ -1,7 +1,7 @@
1
1
  <!-- Toast -->
2
2
  <div class="toast" role="alert" aria-live="assertive" aria-atomic="true" style="position:relative; top:0; right:0;" data-delay="5000">
3
3
  <div class="toast-header">
4
- <strong class="mr-auto">GEOMG</strong>
4
+ <strong class="mr-auto">GBL ADMIN</strong>
5
5
  <small class="text-muted">just now</small>
6
6
  <button type="button" class="ml-2 mb-1 close" data-dismiss="toast" aria-label="Close">
7
7
  <span aria-hidden="true">&times;</span>
@@ -1,4 +1,4 @@
1
- <%- @page_title = "GEOMG - Users" %>
1
+ <%- @page_title= "GBL♦Admin - Users" %>
2
2
 
3
3
 
4
4
  <h1 style="width:100%; margin-bottom:2rem;">
@@ -0,0 +1,3 @@
1
+ <%- if current_user && current_user.admin? %>
2
+ <%= link_to "GBL♦Admin | Edit Record", edit_admin_document_path(@document), { class: "btn btn-warning btn-block" } %>
3
+ <%- end %>