From 128d77a3a05c3bde86d5e1f2ac299dbd9c434e2d Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Fri, 7 Jul 2023 23:27:12 +0800 Subject: [PATCH] Following up fixes for "Fix inconsistent user profile layout across tabs" (#25739) Follow https://github.com/go-gitea/gitea/pull/25625#issuecomment-1621577816 1. Fix the incorrect "project view" layout 2. Fix the "follow/unfollow" link on "packages" and "projects" tab Before: ![image](https://github.com/go-gitea/gitea/assets/2114189/3b071235-c186-4097-8a19-dd90dcb2a344) After: ![image](https://github.com/go-gitea/gitea/assets/2114189/d1d23cd7-28d8-43e3-9f68-03e8a34a9b97) --------- Co-authored-by: Giteabot --- routers/web/user/profile.go | 6 +++--- templates/org/home.tmpl | 17 +++++++---------- templates/org/projects/view.tmpl | 2 +- templates/projects/view.tmpl | 8 ++------ templates/shared/user/profile_big_avatar.tmpl | 14 ++++++-------- 5 files changed, 19 insertions(+), 28 deletions(-) diff --git a/routers/web/user/profile.go b/routers/web/user/profile.go index 442fd0433..07a2261c9 100644 --- a/routers/web/user/profile.go +++ b/routers/web/user/profile.go @@ -287,9 +287,9 @@ func Action(ctx *context.Context) { } if err != nil { - ctx.ServerError(fmt.Sprintf("Action (%s)", ctx.FormString("action")), err) + log.Error("Failed to apply action %q: %v", ctx.FormString("action"), err) + ctx.JSONError(fmt.Sprintf("Action %q failed", ctx.FormString("action"))) return } - // FIXME: We should check this URL and make sure that it's a valid Gitea URL - ctx.RedirectToFirst(ctx.FormString("redirect_to"), ctx.ContextUser.HomeLink()) + ctx.JSONOK() } diff --git a/templates/org/home.tmpl b/templates/org/home.tmpl index 7f52b8cc6..967b31e7a 100644 --- a/templates/org/home.tmpl +++ b/templates/org/home.tmpl @@ -20,16 +20,13 @@ diff --git a/templates/org/projects/view.tmpl b/templates/org/projects/view.tmpl index ef8ec2422..33346b615 100644 --- a/templates/org/projects/view.tmpl +++ b/templates/org/projects/view.tmpl @@ -1,5 +1,5 @@ {{template "base/head" .}} -
+
{{template "shared/user/org_profile_avatar" .}}
{{template "user/overview/header" .}} diff --git a/templates/projects/view.tmpl b/templates/projects/view.tmpl index 59fa1870f..2f0556856 100644 --- a/templates/projects/view.tmpl +++ b/templates/projects/view.tmpl @@ -1,5 +1,3 @@ -
-
@@ -70,8 +68,8 @@ {{end}}
-
-
+ +
{{range $board := .Boards}} @@ -253,8 +251,6 @@
-
- {{if .CanWriteProjects}}