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:** > ![image](https://user-images.githubusercontent.com/25511175/240148601-2420d77b-ba25-4718-9ccb-c5d0d95e3079.png) > > ### **For Other Tabs:** > ![image](https://user-images.githubusercontent.com/25511175/240148461-ce9636b3-fe11-4c46-a230-30d83eee5947.png) > ## Before ![image](https://github.com/go-gitea/gitea/assets/80308335/975ad038-07ca-4b10-b75d-ccf259be7b9d) ## After changes Project View image Packages View image ## Org view for projects page image ## Org view for packages page image --------- 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 .ContextUser.FullName}}{{.ContextUser.FullName}}{{end}} + {{.ContextUser.Name}} + {{if .EnableFeed}} + {{svg "octicon-rss" 18}} + {{end}} + +
+
+
    + {{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}} +
    • + {{.Description}} +
    • + {{end}} +
    +
  • + {{end}} + {{if and .IsSigned (ne .SignedUserID .ContextUser.ID)}} + + {{end}} +
+
+
-- cgit v1.2.3