diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 51f8055..db979f6 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -13,7 +13,6 @@ jobs:
fail-fast: false
matrix:
alchemy_branch:
- - "8.1-stable"
- "8.2-stable"
ruby:
- "3.3"
@@ -27,9 +26,6 @@ jobs:
- mysql
- postgresql
- sqlite
- exclude:
- - alchemy_branch: "8.0-stable"
- rails: "8.1"
env:
DB: ${{ matrix.database }}
diff --git a/alchemy-devise.gemspec b/alchemy-devise.gemspec
index 1d64943..6a06fb3 100644
--- a/alchemy-devise.gemspec
+++ b/alchemy-devise.gemspec
@@ -15,7 +15,7 @@ Gem::Specification.new do |s|
s.files = Dir["{app,config,db,lib}/**/*", "LICENSE", "CHANGELOG.md", "README.md"]
- s.add_dependency "alchemy_cms", [">= 8.1.0.a", "< 9.0"]
+ s.add_dependency "alchemy_cms", [">= 8.2.0", "< 9.0"]
s.add_dependency "devise", ">= 4.9", "< 6.0"
s.add_dependency "flickwerk", ["~> 0.3.6"]
diff --git a/app/views/alchemy/admin/users/_fields.html.erb b/app/views/alchemy/admin/users/_fields.html.erb
index c447c22..60ee16f 100644
--- a/app/views/alchemy/admin/users/_fields.html.erb
+++ b/app/views/alchemy/admin/users/_fields.html.erb
@@ -1,7 +1,7 @@
<%= f.input :firstname, input_html: {autocomplete: "given-name"} %>
<%= f.input :lastname, input_html: {autocomplete: "family-name"} %>
-<%= f.input :login, autofocus: true, required: @user.login_required?, input_html: {autocomplete: "username"} %>
-<%= f.input :email, required: @user.email_required?, input_html: {autocomplete: "email"} %>
+<%= f.input :login, autofocus: true, required: f.object.login_required?, input_html: {autocomplete: "username"} %>
+<%= f.input :email, required: f.object.email_required?, input_html: {autocomplete: "email"} %>
<% if Alchemy::I18n.available_locales.many? %>
<%= f.label(:language) %>
@@ -16,9 +16,9 @@
is: "alchemy-select",
data: {allow_clear: true}
} %>
-<% if can_update_role? %>
+<% if local_assigns[:user_roles] && can_update_role? %>
<%= f.input :alchemy_roles,
- collection: @user_roles,
+ collection: user_roles,
input_html: {
multiple: true,
is: 'alchemy-select',
@@ -32,7 +32,7 @@
<%= f.label :tag_list %>
<%= render 'alchemy/admin/partials/autocomplete_tag_list',
f: f,
- object: @user %>
+ object: f.object %>
<% end %>
<%= f.input :send_credentials, as: 'boolean' %>
diff --git a/app/views/alchemy/admin/users/edit.html.erb b/app/views/alchemy/admin/users/edit.html.erb
index 2f45902..75341dd 100644
--- a/app/views/alchemy/admin/users/edit.html.erb
+++ b/app/views/alchemy/admin/users/edit.html.erb
@@ -1,3 +1,22 @@
-<%= alchemy_form_for [:admin, @user] do |f| %>
- <%= render 'fields', f: f %>
+<% if request.xhr? || turbo_frame_request? %>
+ <%= alchemy_form_for [:admin, @user] do |f| %>
+ <%= render "fields", f: f, user_roles: @user_roles %>
+ <% end %>
+<% else %>
+ <%= content_for :toolbar do %>
+
+ <%= link_to request.referer || alchemy.admin_dashboard_path, class: "icon_button" do %>
+
+ <% end %>
+
+ <% end %>
+
+
+
+ <%= Alchemy.t(:edit_user) %>
+
+ <%= alchemy_form_for [:admin, @user] do |f| %>
+ <%= render "fields", f: f, user_roles: @user_roles %>
+ <% end %>
+
<% end %>
diff --git a/app/views/alchemy/admin/users/new.html.erb b/app/views/alchemy/admin/users/new.html.erb
index 2f45902..6e97652 100644
--- a/app/views/alchemy/admin/users/new.html.erb
+++ b/app/views/alchemy/admin/users/new.html.erb
@@ -1,3 +1,3 @@
<%= alchemy_form_for [:admin, @user] do |f| %>
- <%= render 'fields', f: f %>
+ <%= render 'fields', f: f, user_roles: @user_roles %>
<% end %>
diff --git a/config/initializers/alchemy.rb b/config/initializers/alchemy.rb
index 5fa82dc..138beaf 100644
--- a/config/initializers/alchemy.rb
+++ b/config/initializers/alchemy.rb
@@ -19,4 +19,5 @@
Alchemy.config.login_path = "/admin/login"
Alchemy.config.logout_path = "/admin/logout"
Alchemy.config.logout_method = Devise.sign_out_via.to_s
+ Alchemy.config.edit_user_path = "/admin/users/:id/edit"
end