Skip to content

Commit 366c11d

Browse files
authored
Merge pull request #282 from AlchemyCMS/alchemy-8.3
Update Alchemy to 8.3
2 parents f6ac1c6 + 663f9c6 commit 366c11d

15 files changed

Lines changed: 168 additions & 130 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
fail-fast: false
1414
matrix:
1515
alchemy_branch:
16-
- "8.2-stable"
16+
- "8.3-stable"
1717
ruby:
1818
- "3.3"
1919
- "3.4"

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
source "https://rubygems.org"
22

3-
alchemy_branch = ENV.fetch("ALCHEMY_BRANCH", "8.2-stable")
3+
alchemy_branch = ENV.fetch("ALCHEMY_BRANCH", "8.3-stable")
44
gem "alchemy_cms", github: "AlchemyCMS/alchemy_cms", branch: alchemy_branch
55

66
rails_version = ENV.fetch("RAILS_VERSION", "8.0")

alchemy-devise.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Gem::Specification.new do |s|
1515

1616
s.files = Dir["{app,config,db,lib}/**/*", "LICENSE", "CHANGELOG.md", "README.md"]
1717

18-
s.add_dependency "alchemy_cms", [">= 8.2.0", "< 9.0"]
18+
s.add_dependency "alchemy_cms", [">= 8.3.0", "< 9.0"]
1919
s.add_dependency "devise", ">= 4.9", "< 6.0"
2020
s.add_dependency "flickwerk", ["~> 0.3.6"]
2121

app/assets/builds/alchemy-devise.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
@import "alchemy-devise/login";
1+
@use "alchemy-devise/login";

app/assets/stylesheets/alchemy-devise/login.scss

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,11 @@ body.passwords {
2525
top: 50%;
2626
left: 50%;
2727
transform: translate(-50%, -50%);
28+
--form-right-column-width: 1.65fr;
2829

2930
alchemy-message {
30-
width: 300px;
31-
margin-left: var(--form-left-column-width);
31+
width: 281px;
32+
margin-left: auto;
3233
}
3334

3435
.no-js & {
@@ -40,17 +41,6 @@ body.passwords {
4041
}
4142

4243
.submit {
43-
display: flex;
44-
align-items: center;
45-
justify-content: space-between;
46-
gap: var(--spacing-4);
47-
margin-left: var(--form-left-column-width);
48-
padding-left: var(--spacing-0);
49-
50-
&.align-right {
51-
justify-content: end;
52-
}
53-
5444
> label {
5545
text-align: start;
5646

@@ -63,6 +53,8 @@ body.passwords {
6353
display: inline-flex;
6454
align-items: center;
6555
gap: var(--spacing-0);
56+
grid-column: 2;
57+
grid-row: 1;
6658

6759
&:hover {
6860
alchemy-icon {

app/controllers/alchemy/admin/users_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ def secure_attributes
8787
end
8888

8989
def while_signup?
90-
User.count == 0
90+
@_while_signup ||= User.count == 0
9191
end
9292

9393
def signup_admin_or_redirect

app/views/alchemy/admin/users/_fields.html.erb

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,22 @@
1-
<%= f.input :firstname, input_html: {autocomplete: "given-name"} %>
2-
<%= f.input :lastname, input_html: {autocomplete: "family-name"} %>
3-
<%= f.input :login, autofocus: true, required: f.object.login_required?, input_html: {autocomplete: "username"} %>
4-
<%= f.input :email, required: f.object.email_required?, input_html: {autocomplete: "email"} %>
1+
<%= f.input :firstname, input_html: {autocomplete: while_signup? ? "given-name" : "off"} %>
2+
<%= f.input :lastname, input_html: {autocomplete: while_signup? ? "family-name" : "off"} %>
3+
<%= f.input :login, autofocus: true, required: f.object.login_required?, input_html: {autocomplete: while_signup? ? "username" : "off"} %>
4+
<%= f.input :email, required: f.object.email_required?, input_html: {autocomplete: while_signup? ? "email" : "off"} %>
55
<% if Alchemy::I18n.available_locales.many? %>
66
<div class="input select">
77
<%= f.label(:language) %>
88
<%= render Alchemy::Admin::LocaleSelect.new(f.field_name(:language), auto_submit: false) %>
99
</div>
1010
<% end %>
11-
<%= f.input :password, required: while_signup?, input_html: {autocomplete: "new-password"} %>
12-
<%= f.input :password_confirmation, required: while_signup?, input_html: {autocomplete: "new-password"} %>
11+
<%= f.input :password, required: while_signup?, input_html: {autocomplete: while_signup? ? "new-password" : "off"} %>
12+
<%= f.input :password_confirmation, required: while_signup?, input_html: {autocomplete: while_signup? ? "new-password" : "off"} %>
1313
<%= f.input :timezone,
1414
collection: ActiveSupport::TimeZone.all, label_method: :to_s, value_method: :name,
15+
include_blank: Alchemy.t("Default"),
1516
input_html: {
1617
is: "alchemy-select",
1718
data: {allow_clear: true}
18-
} %>
19+
}, hint: Alchemy.t("admin.users.preferred_timezone", server_timezone: Time.zone) %>
1920
<% if local_assigns[:user_roles] && can_update_role? %>
2021
<%= f.input :alchemy_roles,
2122
collection: user_roles,
@@ -35,8 +36,11 @@
3536
object: f.object %>
3637
</div>
3738
<% end %>
38-
<%= f.input :send_credentials, as: 'boolean' %>
39-
<div class="submit align-right">
39+
<div class="submit">
40+
<label class="checkbox">
41+
<%= f.check_box :send_credentials %>
42+
<%= Alchemy.config.user_class.human_attribute_name :send_credentials %>
43+
</label>
4044
<button type="submit">
4145
<%= Alchemy.t(:save) %>
4246
</button>

app/views/alchemy/admin/users/_resource_table.html.erb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
alchemy.edit_admin_user_path(user), {
99
title: Alchemy.t(:edit_user),
1010
overflow: true,
11-
size: "430x530"
11+
size: "460x530"
1212
},
1313
title: Alchemy.t(:edit_user) %>
1414
<% else %>
@@ -28,5 +28,5 @@
2828
<%= user.human_roles_string %>
2929
<% end %>
3030
<% table.delete_button tooltip: Alchemy.t(:delete_user), confirm_message: Alchemy.t(:confirm_to_delete_user) %>
31-
<% table.edit_button tooltip: Alchemy.t(:edit_user), dialog_size: "430x530" %>
31+
<% table.edit_button tooltip: Alchemy.t(:edit_user), dialog_size: "460x530" %>
3232
<% end %>

app/views/alchemy/admin/users/index.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
tooltip_placement: "top-start",
1313
dialog_options: {
1414
title: Alchemy.t(:create_user),
15-
size: "430x530"
15+
size: "460x530"
1616
},
1717
if_permitted_to: [:create, Alchemy::User]
1818
) %>

0 commit comments

Comments
 (0)