From 3ff95cef606fad166527b092cb063081e3b3b84e Mon Sep 17 00:00:00 2001
From: James Lakin
Date: Mon, 3 Feb 2020 22:14:38 +0000
Subject: [PATCH] Show if a PR has conflicting files on the PR lists (#10130)
Co-authored-by: Lauris BH
---
options/locale/locale_en-US.ini | 1 +
templates/repo/issue/list.tmpl | 11 ++++++++---
templates/user/dashboard/issues.tmpl | 15 ++++++++++-----
web_src/less/_repository.less | 4 ++++
4 files changed, 23 insertions(+), 8 deletions(-)
diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini
index cecf942a42..88fbce598f 100644
--- a/options/locale/locale_en-US.ini
+++ b/options/locale/locale_en-US.ini
@@ -1066,6 +1066,7 @@ pulls.blocked_by_rejection = "This Pull Request has changes requested by an offi
pulls.can_auto_merge_desc = This pull request can be merged automatically.
pulls.cannot_auto_merge_desc = This pull request cannot be merged automatically due to conflicts.
pulls.cannot_auto_merge_helper = Merge manually to resolve the conflicts.
+pulls.num_conflicting_files = "%d conflicting files"
pulls.no_merge_desc = This pull request cannot be merged because all repository merge options are disabled.
pulls.no_merge_helper = Enable merge options in the repository settings or merge the pull request manually.
pulls.no_merge_wip = This pull request can not be merged because it is marked as being a work in progress.
diff --git a/templates/repo/issue/list.tmpl b/templates/repo/issue/list.tmpl
index d280878f2e..16cee8619d 100644
--- a/templates/repo/issue/list.tmpl
+++ b/templates/repo/issue/list.tmpl
@@ -212,9 +212,9 @@
#{{.Index}}
{{.Title}}
- {{if .IsPull }}
- {{if (index $.CommitStatus .PullRequest.ID)}}
- {{template "repo/commit_status" (index $.CommitStatus .PullRequest.ID)}}
+ {{if .IsPull }}
+ {{if (index $.CommitStatus .PullRequest.ID)}}
+ {{template "repo/commit_status" (index $.CommitStatus .PullRequest.ID)}}
{{end}}
{{end}}
@@ -267,6 +267,11 @@
{{end}}
+ {{if .IsPull}}
+ {{if (len .PullRequest.ConflictedFiles) gt 0}}
+ {{$.i18n.Tr "repo.pulls.num_conflicting_files" (len .PullRequest.ConflictedFiles)}}
+ {{end}}
+ {{end}}
{{end}}
diff --git a/templates/user/dashboard/issues.tmpl b/templates/user/dashboard/issues.tmpl
index 26020ca0ce..3a8d16f6cc 100644
--- a/templates/user/dashboard/issues.tmpl
+++ b/templates/user/dashboard/issues.tmpl
@@ -91,11 +91,11 @@
{{.Repo.FullName}}#{{.Index}}
{{.Title}}
- {{if .IsPull }}
- {{if (index $.CommitStatus .PullRequest.ID)}}
- {{template "repo/commit_status" (index $.CommitStatus .PullRequest.ID)}}
- {{end}}
- {{end}}
+ {{if .IsPull}}
+ {{if (index $.CommitStatus .PullRequest.ID)}}
+ {{template "repo/commit_status" (index $.CommitStatus .PullRequest.ID)}}
+ {{end}}
+ {{end}}
{{with .Labels}}
{{/* If we have any labels, we should show them
@@ -151,6 +151,11 @@
{{.DeadlineUnix.FormatShort}}
{{end}}
+ {{if .IsPull}}
+ {{if (len .PullRequest.ConflictedFiles) gt 0}}
+ {{$.i18n.Tr "repo.pulls.num_conflicting_files" (len .PullRequest.ConflictedFiles)}}
+ {{end}}
+ {{end}}
{{end}}
diff --git a/web_src/less/_repository.less b/web_src/less/_repository.less
index a5037276a7..32449abfaf 100644
--- a/web_src/less/_repository.less
+++ b/web_src/less/_repository.less
@@ -2129,6 +2129,10 @@
}
}
+ .conflicting {
+ padding-left: 5px;
+ }
+
.due-date {
padding-left: 5px;
}