diff --git a/app/assets/stylesheets/user.css b/app/assets/stylesheets/user.css new file mode 100644 index 000000000..7afc7fb77 --- /dev/null +++ b/app/assets/stylesheets/user.css @@ -0,0 +1,6 @@ +@layer components { + .user-edit-link { + inset: 0 0 auto auto; + position: absolute; + } +} diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 82b46b9a3..2a7756172 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -5,6 +5,10 @@ class UsersController < ApplicationController before_action :ensure_join_code_is_valid, only: %i[ new create ] before_action :ensure_permission_to_change_user, only: %i[ update destroy ] + include FilterScoped + + enable_collection_filtering only: [:edit, :show] + def new @user = User.new end diff --git a/app/views/users/edit.html.erb b/app/views/users/edit.html.erb index 839d00781..04c4482e9 100644 --- a/app/views/users/edit.html.erb +++ b/app/views/users/edit.html.erb @@ -1,10 +1,7 @@ <% @page_title = "Edit your profile" %> <% content_for :header do %> -
- <%= link_to_back fallback_path: user_path(@user) %> -
-
+ <%= render "filters/menu", user_filtering: @user_filtering %> <% end %>
diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb index 52a5c25c4..6ae8f520c 100644 --- a/app/views/users/show.html.erb +++ b/app/views/users/show.html.erb @@ -1,22 +1,18 @@ <% @page_title = @user.name %> <% content_for :header do %> -
- <%= link_to_back %> -
+ <%= render "filters/menu", user_filtering: @user_filtering %> +<% end %> -
+
+
<% if Current.user == @user %> - <%= link_to edit_user_path(@user), class: "btn" do %> + <%= link_to edit_user_path(@user), class: "user-edit-link btn" do %> <%= icon_tag "pencil" %> Edit <% end %> <% end %> -
-<% end %> -
-
<%= image_tag user_avatar_path(@user), alt: "Profile avatar for #{@user.name}", size: 128 %>