diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-09-20 14:18:08 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-09-20 14:18:08 +0300 |
commit | 5afcbe03ead9ada87621888a31a62652b10a7e4f (patch) | |
tree | 9918b67a0d0f0bafa6542e839a8be37adf73102d /lib/sidebars/user_profile/menus/overview_menu.rb | |
parent | c97c0201564848c1f53226fe19d71fdcc472f7d0 (diff) |
Add latest changes from gitlab-org/gitlab@16-4-stable-eev16.4.0-rc42
Diffstat (limited to 'lib/sidebars/user_profile/menus/overview_menu.rb')
-rw-r--r-- | lib/sidebars/user_profile/menus/overview_menu.rb | 34 |
1 files changed, 29 insertions, 5 deletions
diff --git a/lib/sidebars/user_profile/menus/overview_menu.rb b/lib/sidebars/user_profile/menus/overview_menu.rb index e9fa515e9bc..598f8b2d052 100644 --- a/lib/sidebars/user_profile/menus/overview_menu.rb +++ b/lib/sidebars/user_profile/menus/overview_menu.rb @@ -4,25 +4,49 @@ module Sidebars module UserProfile module Menus class OverviewMenu < ::Sidebars::UserProfile::BaseMenu + include UsersHelper + override :link def link - user_path(context.container) + user_path(user) end override :title def title - s_('UserProfile|Overview') + user_name + end + + override :avatar + def avatar + user.avatar_url end - override :sprite_icon - def sprite_icon - 'overview' + override :avatar_shape + def avatar_shape + 'circle' + end + + override :entity_id + def entity_id + user.id end override :active_routes def active_routes { path: 'users#show' } end + + private + + def user + context.container + end + + def user_name + return user_display_name(user) if user.blocked? || !user.confirmed? + + user.name + end end end end |