From 2af30f715e64dbb0a3900168e3768ffb36c06392 Mon Sep 17 00:00:00 2001 From: puni9869 <80308335+puni9869@users.noreply.github.com> Date: Fri, 7 Jul 2023 00:29:24 +0530 Subject: Fix inconsistent user profile layout across tabs (#25625) Fix ::User Profile Page Project Tab Have Inconsistent Layout and Style Added the big_avator for consistency in the all header_items tabs. Fixes: #24871 > ### Description > in the user profile page the `Packages` and `Projects` tab have small icons for user but other tabs have bigger profile picture with user info: > > ### Screenshots > ### **For Packages And Projects:** >  > > ### **For Other Tabs:** >  > ## Before  ## After changes Project View Packages View ## Org view for projects page ## Org view for packages page --------- Co-authored-by: wxiaoguang Co-authored-by: Giteabot Co-authored-by: silverwind --- templates/shared/user/org_profile_avatar.tmpl | 16 ++++ templates/shared/user/profile_big_avatar.tmpl | 116 ++++++++++++++++++++++++++ 2 files changed, 132 insertions(+) create mode 100644 templates/shared/user/org_profile_avatar.tmpl create mode 100644 templates/shared/user/profile_big_avatar.tmpl (limited to 'templates/shared') diff --git a/templates/shared/user/org_profile_avatar.tmpl b/templates/shared/user/org_profile_avatar.tmpl new file mode 100644 index 0000000000..a56763e288 --- /dev/null +++ b/templates/shared/user/org_profile_avatar.tmpl @@ -0,0 +1,16 @@ +{{with .ContextUser}} + + + + + {{avatar $.Context . 100}} + {{.DisplayName}} + + {{if .Visibility.IsLimited}}{{$.locale.Tr "org.settings.visibility.limited_shortname"}}{{end}} + {{if .Visibility.IsPrivate}}{{$.locale.Tr "org.settings.visibility.private_shortname"}}{{end}} + + + + + +{{end}} diff --git a/templates/shared/user/profile_big_avatar.tmpl b/templates/shared/user/profile_big_avatar.tmpl new file mode 100644 index 0000000000..408877e481 --- /dev/null +++ b/templates/shared/user/profile_big_avatar.tmpl @@ -0,0 +1,116 @@ + + + {{if eq .SignedUserID .ContextUser.ID}} + + {{/* the size doesn't take affect (and no need to take affect), image size(width) should be controlled by the parent container since this is not a flex layout*/}} + {{avatar $.Context .ContextUser 256}} + + {{else}} + + {{avatar $.Context .ContextUser 256}} + + {{end}} + + + {{if .ContextUser.FullName}}{{.ContextUser.FullName}}{{end}} + {{.ContextUser.Name}} + {{if .EnableFeed}} + {{svg "octicon-rss" 18}} + {{end}} + + {{svg "octicon-person" 18 "gt-mr-2"}}{{.NumFollowers}} {{.locale.Tr "user.followers"}} ยท {{.NumFollowing}} {{.locale.Tr "user.following"}} + + + + + {{if .ContextUser.Location}} + {{svg "octicon-location"}} {{.ContextUser.Location}} + {{end}} + {{if (eq .SignedUserID .ContextUser.ID)}} + + {{svg "octicon-mail"}} + {{.ContextUser.Email}} + + {{if .ShowUserEmail}} + + {{svg "octicon-unlock"}} + + {{else}} + + {{svg "octicon-lock"}} + + {{end}} + + + {{else}} + {{if .ShowUserEmail}} + + {{svg "octicon-mail"}} + {{.ContextUser.Email}} + + {{end}} + {{end}} + {{if .ContextUser.Website}} + + {{svg "octicon-link"}} + {{.ContextUser.Website}} + + {{end}} + {{if $.RenderedDescription}} + + {{$.RenderedDescription|Str2html}} + + {{end}} + {{range .OpenIDs}} + {{if .Show}} + + {{svg "fontawesome-openid"}} + {{.URI}} + + {{end}} + {{end}} + {{svg "octicon-clock"}} {{.locale.Tr "user.joined_on" (DateTime "short" .ContextUser.CreatedUnix) | Safe}} + {{if and .Orgs .HasOrgsVisible}} + + + {{range .Orgs}} + {{if (or .Visibility.IsPublic (and ($.SignedUser) (or .Visibility.IsLimited (and (.HasMemberWithUserID $.SignedUserID) .Visibility.IsPrivate) ($.IsAdmin))))}} + + + {{avatar $.Context .}} + + + {{end}} + {{end}} + + + {{end}} + {{if .Badges}} + + + {{range .Badges}} + + + + {{end}} + + + {{end}} + {{if and .IsSigned (ne .SignedUserID .ContextUser.ID)}} + + {{if $.IsFollowing}} + + {{$.CsrfTokenHtml}} + {{svg "octicon-person"}} {{.locale.Tr "user.unfollow"}} + + {{else}} + + {{$.CsrfTokenHtml}} + {{svg "octicon-person"}} {{.locale.Tr "user.follow"}} + + {{end}} + + {{end}} + + + -- cgit v1.2.3