From 6dacd1b31e681263bff2ba2b2bc609345304ffe2 Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Fri, 11 Oct 2019 21:58:23 +0200 Subject: [PATCH 1/3] included message --- options/locale/locale_en-US.ini | 2 ++ 1 file changed, 2 insertions(+) diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index ca09b6120d717..b3e1f59ecc230 100644 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -1450,6 +1450,8 @@ branch.restore_failed = Failed to restore branch '%s'. branch.protected_deletion_failed = Branch '%s' is protected. It cannot be deleted. branch.restore = Restore Branch '%s' branch.download = Download Branch '%s' +branch.included_desc = This branch is part of the default branch +branch.included = Included topic.manage_topics = Manage Topics topic.done = Done From 35b7c99456f5b6003480c15b34da93326763c097 Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Fri, 11 Oct 2019 21:58:50 +0200 Subject: [PATCH 2/3] add property IsIncluded --- routers/repo/branch.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/routers/repo/branch.go b/routers/repo/branch.go index 5d78518491dfa..0c06de3ea6317 100644 --- a/routers/repo/branch.go +++ b/routers/repo/branch.go @@ -28,6 +28,7 @@ type Branch struct { Commit *git.Commit IsProtected bool IsDeleted bool + IsIncluded bool DeletedBranch *models.DeletedBranch CommitsAhead int CommitsBehind int @@ -203,10 +204,13 @@ func loadBranches(ctx *context.Context) []*Branch { } } + isIncluded := divergence.Ahead == 0 && ctx.Repo.Repository.DefaultBranch != branchName + branches[i] = &Branch{ Name: branchName, Commit: commit, IsProtected: isProtected, + IsIncluded: isIncluded, CommitsAhead: divergence.Ahead, CommitsBehind: divergence.Behind, LatestPullRequest: pr, From ac00c31c8728442f066c3984429e9ad28701769f Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Fri, 11 Oct 2019 21:59:09 +0200 Subject: [PATCH 3/3] Add Orange Lable --- templates/repo/branch/list.tmpl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/templates/repo/branch/list.tmpl b/templates/repo/branch/list.tmpl index 9c53f4e67a36d..26493298da4a3 100644 --- a/templates/repo/branch/list.tmpl +++ b/templates/repo/branch/list.tmpl @@ -75,7 +75,11 @@ {{if not .LatestPullRequest}} - {{if and (not .IsDeleted) $.AllowsPulls (gt .CommitsAhead 0)}} + {{if .IsIncluded}} + + {{$.i18n.Tr "repo.branch.included"}} + + {{else if and (not .IsDeleted) $.AllowsPulls (gt .CommitsAhead 0)}}