diff --git a/Gemfile b/Gemfile index 21687522..5fc55a17 100644 --- a/Gemfile +++ b/Gemfile @@ -6,7 +6,7 @@ git_source(:github) do |repo_name| "https://github.com/#{repo_name}.git" end -gem 'administrate', '~> 0.20.0' +gem 'administrate', '~> 1.0.0' gem 'aws-sdk-rails' gem 'aws-sdk-s3' gem 'aws-sdk-sqs' @@ -17,6 +17,7 @@ gem 'csv' gem 'delayed_job_active_record' gem 'devise' gem 'flipflop' +gem 'jquery-rails' gem 'json' gem 'kaminari' gem 'lograge' diff --git a/Gemfile.lock b/Gemfile.lock index aab0c451..24b3cd78 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -85,14 +85,11 @@ GEM tzinfo (~> 2.0, >= 2.0.5) addressable (2.8.8) public_suffix (>= 2.0.2, < 8.0) - administrate (0.20.1) - actionpack (>= 6.0, < 8.0) - actionview (>= 6.0, < 8.0) - activerecord (>= 6.0, < 8.0) - jquery-rails (~> 4.6.0) + administrate (1.0.0) + actionpack (>= 6.0, < 9.0) + actionview (>= 6.0, < 9.0) + activerecord (>= 6.0, < 9.0) kaminari (~> 1.2.2) - sassc-rails (~> 2.1) - selectize-rails (~> 0.6) annotate (3.2.0) activerecord (>= 3.2, < 8.0) rake (>= 10.4, < 14.0) @@ -178,7 +175,7 @@ GEM erb (6.0.1) erubi (1.13.1) execjs (2.10.0) - ffi (1.17.1) + ffi (1.17.3) flipflop (2.8.0) activesupport (>= 4.0) terminal-table (>= 1.8) @@ -195,7 +192,7 @@ GEM rdoc (>= 4.0.0) reline (>= 0.4.2) jmespath (1.6.2) - jquery-rails (4.6.0) + jquery-rails (4.6.1) rails-dom-testing (>= 1, < 3) railties (>= 4.2.0) thor (>= 0.14, < 2.0) @@ -397,7 +394,6 @@ GEM scout_apm (6.0.2) parser securerandom (0.4.1) - selectize-rails (0.12.6) selenium-webdriver (4.39.0) base64 (~> 0.2) logger (~> 1.4) @@ -422,8 +418,9 @@ GEM simplecov_json_formatter (0.1.4) skylight (7.0.0) activesupport (>= 7.1.0) - sprockets (4.2.1) + sprockets (4.2.2) concurrent-ruby (~> 1.0) + logger rack (>= 2.2.4, < 4) sprockets-rails (3.5.2) actionpack (>= 6.1) @@ -437,7 +434,7 @@ GEM terser (1.2.6) execjs (>= 0.3.0, < 3) thor (1.5.0) - tilt (2.6.0) + tilt (2.7.0) timecop (0.9.10) timeout (0.6.0) tsort (0.2.0) @@ -473,7 +470,7 @@ PLATFORMS ruby DEPENDENCIES - administrate (~> 0.20.0) + administrate (~> 1.0.0) annotate aws-sdk-rails aws-sdk-s3 @@ -491,6 +488,7 @@ DEPENDENCIES devise dotenv-rails flipflop + jquery-rails json kaminari letter_opener diff --git a/app/views/admin/holds/_form.html.erb b/app/views/admin/holds/_form.html.erb index 1be23840..571f6ec0 100644 --- a/app/views/admin/holds/_form.html.erb +++ b/app/views/admin/holds/_form.html.erb @@ -14,7 +14,7 @@ and renders all form fields for a resource's editable attributes. [1]: http://www.rubydoc.info/gems/administrate/Administrate/Page/Form %> -<%= form_for([namespace, page.resource], html: { class: "form" }) do |f| %> +<%= form_with(model: page.resource, url: [namespace, page.resource], scope: page.resource, local: true, class: "form") do |f| %> <% if page.resource.errors.any? %>

diff --git a/app/views/admin/theses/show.html.erb b/app/views/admin/theses/show.html.erb index 01f35a2c..726528ec 100644 --- a/app/views/admin/theses/show.html.erb +++ b/app/views/admin/theses/show.html.erb @@ -16,7 +16,7 @@ as well as a link to its edit page. [1]: http://www.rubydoc.info/gems/administrate/Administrate/Page/Show %> -<% content_for(:title) { t("administrate.actions.show_resource", name: page.resource.title) } %> +<% content_for(:title) { t("administrate.actions.show_resource", name: page.page_title) } %> <% content_for(:custom_stylesheets) { stylesheet_link_tag "administrate" } %>
@@ -24,18 +24,21 @@ as well as a link to its edit page. <%= content_for(:title) %>

+ <%= content_for(:header_middle) %> +
<%= link_to( - t("administrate.actions.edit_resource", name: page.resource.title), + t("administrate.actions.edit_resource", name: page.page_title), [:edit, namespace, page.resource], class: "button", ) if accessible_action?(page.resource, :edit) %> - <%= link_to( + + <%= button_to( t("administrate.actions.destroy"), [namespace, page.resource], class: "button button--danger", method: :delete, - data: { confirm: t("administrate.actions.confirm") } + data: { turbo_confirm: t("administrate.actions.confirm") } ) if accessible_action?(page.resource, :destroy) %> <%= link_to( t("administrate.actions.new_resource", name: 'hold'), @@ -43,28 +46,39 @@ as well as a link to its edit page. class: "button", ) if accessible_action?('hold', :new) %>
+ + <%= content_for(:header_last) %> -
-
- <% page.attributes.each do |title, attributes| %> -
"> - <% if title.present? %> - <%= t "helpers.label.#{page.resource_name}.#{title}", default: title %> - <% end %> +<%= content_for(:before_main) %> + +<% if content_for?(:main) %> + <%= content_for(:main) %> +<% else %> +
+
+ <% page.attributes.each do |title, attributes| %> +
"> + <% if title.present? %> + <%= t "helpers.label.#{page.resource_name}.#{title}", default: title %> + <% end %> + + <% attributes.each do |attribute| %> +
+ <%= t( + "helpers.label.#{resource_name}.#{attribute.name}", + default: page.resource.class.human_attribute_name(attribute.name), + ) %> +
- <% attributes.each do |attribute| %> -
- <%= t( - "helpers.label.#{resource_name}.#{attribute.name}", - default: page.resource.class.human_attribute_name(attribute.name), - ) %> -
+
+ <%= render_field attribute, page: page %> +
+ <% end %> +
+ <% end %> +
+
+<% end %> -
<%= render_field attribute, page: page %>
- <% end %> -
- <% end %> -
-
+<%= content_for(:after_main) %> diff --git a/app/views/layouts/admin/application.html.erb b/app/views/layouts/admin/application.html.erb index 4d4527ce..b524ffdd 100644 --- a/app/views/layouts/admin/application.html.erb +++ b/app/views/layouts/admin/application.html.erb @@ -22,7 +22,7 @@ By default, it renders: <%= content_for(:title) %> - <%= application_title %> <%= render "stylesheet" %> - <%= stylesheet_link_tag "administrate" %> + <%= stylesheet_link_tag "administrate", data: { turbo_track: "reload" } %> <%= csrf_meta_tags %> <%= csp_meta_tag if defined?(csp_meta_tag) %>