diff --git a/app/views/users/edit.html.erb b/app/views/users/edit.html.erb index 381be9d1f..9953d4927 100644 --- a/app/views/users/edit.html.erb +++ b/app/views/users/edit.html.erb @@ -9,56 +9,58 @@ <% end %> -
-
- <%= form_with model: @user, method: :patch, class: "flex flex-column gap", data: { controller: "form upload-preview" } do |form| %> -
- +<%= turbo_frame_tag dom_id(@user) do %> +
+
+ <%= form_with model: @user, method: :patch, class: "flex flex-column gap", data: { controller: "form upload-preview" } do |form| %> +
+ - + - <% if @user.avatar.attached? %> - <%= tag.button type: :submit, form: "avatar-delete-form", class: "btn btn--negative txt-small", data: { turbo_confirm: "Are you sure you want to remove your avatar? This can't be undone." } do %> - <%= image_tag "minus.svg", aria: { hidden: "true" }, size: 20 %> - Delete avatar + <% if @user.avatar.attached? %> + <%= tag.button type: :submit, form: "avatar-delete-form", class: "btn btn--negative txt-small", data: { turbo_confirm: "Are you sure you want to remove your avatar? This can't be undone." } do %> + <%= image_tag "minus.svg", aria: { hidden: "true" }, size: 20 %> + Delete avatar + <% end %> <% end %> - <% end %> -
+
-
- <%= translation_button :user_name %> - -
-
- <%= translation_button :email_address %> - -
-
- <%= translation_button :password %> - -
- +
+ <%= translation_button :user_name %> + +
+
+ <%= translation_button :email_address %> + +
+
+ <%= translation_button :password %> + +
+ - <%= link_to "Cancel and go back", user_path(@user), data: { form_target: "cancel", turbo_frame: "_top" }, hidden: true %> - <% end %> + <%= link_to "Cancel and go back", user_path(@user), data: { form_target: "cancel", turbo_frame: "_top" }, hidden: true %> + <% end %> - <%= form_with url: user_avatar_url(@user), method: :delete, id: "avatar-delete-form" %> + <%= form_with url: user_avatar_url(@user), method: :delete, id: "avatar-delete-form" %> +
-
+<% end %> diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb index 5651acbd0..0e0c08647 100644 --- a/app/views/users/show.html.erb +++ b/app/views/users/show.html.erb @@ -8,7 +8,7 @@ <% end %> <% if Current.user == @user %> - <%= link_to edit_user_path(@user), class: "btn flex-item-justify-end" do %> + <%= link_to edit_user_path(@user), class: "btn flex-item-justify-end", data: { turbo_frame: dom_id(@user) } do %> <%= image_tag "pencil.svg", aria: { hidden: true }, size: 24 %> Edit <% end %> @@ -16,24 +16,26 @@ <% end %> -
-
-
- <%= image_tag user_avatar_path(@user), alt: "Profile avatar for #{@user.name}", class: "avatar", size: 128 %> -
+<%= turbo_frame_tag dom_id(@user) do %> +
+
+
+ <%= image_tag user_avatar_path(@user), alt: "Profile avatar for #{@user.name}", class: "avatar", size: 128 %> +
-
-

<%= @user.name %>

-
- <% if @user.active? %> - <%= mail_to @user.email_address %> - <% else %> - <%= @user.name %> is no longer on this account - <% end %> +
+

<%= @user.name %>

+
+ <% if @user.active? %> + <%= mail_to @user.email_address %> + <% else %> + <%= @user.name %> is no longer on this account + <% end %> +
-
+<% end %> <% if Current.user == @user %>