From b520797cec3d7906f64a10d5a0d67b9eab90f934 Mon Sep 17 00:00:00 2001 From: CodeDoctorDE Date: Tue, 9 Aug 2022 13:41:04 +0200 Subject: [PATCH] Improve single repo action for issue and pull requests --- routers/web/user/home.go | 2 ++ templates/user/dashboard/issues.tmpl | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/routers/web/user/home.go b/routers/web/user/home.go index f338c525b4d3e..88e44477ba5c8 100644 --- a/routers/web/user/home.go +++ b/routers/web/user/home.go @@ -334,6 +334,7 @@ func Pulls(ctx *context.Context) { ctx.Data["Title"] = ctx.Tr("pull_requests") ctx.Data["PageIsPulls"] = true + ctx.Data["SingleRepoAction"] = "pull" buildIssueOverview(ctx, unit.TypePullRequests) } @@ -347,6 +348,7 @@ func Issues(ctx *context.Context) { ctx.Data["Title"] = ctx.Tr("issues") ctx.Data["PageIsIssues"] = true + ctx.Data["SingleRepoAction"] = "issue" buildIssueOverview(ctx, unit.TypeIssues) } diff --git a/templates/user/dashboard/issues.tmpl b/templates/user/dashboard/issues.tmpl index b6dc002154b67..666a7bdb2a1b1 100644 --- a/templates/user/dashboard/issues.tmpl +++ b/templates/user/dashboard/issues.tmpl @@ -100,7 +100,11 @@ {{if .SingleRepoLink}} - {{.locale.Tr "repo.issues.new"}} + {{if eq .SingleRepoAction "issue"}} + {{.locale.Tr "repo.issues.new"}} + {{else if eq .SingleRepoAction "pull"}} + {{.locale.Tr "repo.pulls.new"}} + {{end}} {{end}}