From 430439bb472c8604d41fafb1a0fd5704117b1d42 Mon Sep 17 00:00:00 2001 From: Gusted Date: Sat, 9 Jul 2022 19:09:26 +0200 Subject: [PATCH 1/2] Use dedicated draft PR icon when possible - Currently the generic pull-request icon is used for draft PR's. This patch changes that by using the dedicated icon for this. - Resolves #20296 --- templates/repo/issue/view_title.tmpl | 6 +++++- templates/shared/issuelist.tmpl | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/templates/repo/issue/view_title.tmpl b/templates/repo/issue/view_title.tmpl index 774505a628396..9fe9c48df3536 100644 --- a/templates/repo/issue/view_title.tmpl +++ b/templates/repo/issue/view_title.tmpl @@ -24,7 +24,11 @@ {{else if .Issue.IsClosed}}
{{if .Issue.IsPull}}{{svg "octicon-git-pull-request"}}{{else}}{{svg "octicon-issue-closed"}}{{end}} {{.locale.Tr "repo.issues.closed_title"}}
{{else if .Issue.IsPull}} -
{{svg "octicon-git-pull-request"}} {{.locale.Tr "repo.issues.open_title"}}
+ {{if .IsPullWorkInProgress}} +
{{svg "octicon-git-pull-request-draft"}} {{.locale.Tr "repo.issues.open_title"}}
+ {{else}} +
{{svg "octicon-git-pull-request"}} {{.locale.Tr "repo.issues.open_title"}}
+ {{end}} {{else}}
{{svg "octicon-issue-opened"}} {{.locale.Tr "repo.issues.open_title"}}
{{end}} diff --git a/templates/shared/issuelist.tmpl b/templates/shared/issuelist.tmpl index 0adcc34671213..7d0abb689bc27 100644 --- a/templates/shared/issuelist.tmpl +++ b/templates/shared/issuelist.tmpl @@ -17,7 +17,11 @@ {{if .IsClosed}} {{svg "octicon-git-pull-request" 16 "text red"}} {{else}} - {{svg "octicon-git-pull-request" 16 "text green"}} + {{if .PullRequest.IsWorkInProgress}} + {{svg "octicon-git-pull-request-draft" 16 "text grey"}} + {{else}} + {{svg "octicon-git-pull-request" 16 "text green"}} + {{end}} {{end}} {{end}} {{else}} From 7faa552c9fd25dcd86678176d9dfbfee924ac04e Mon Sep 17 00:00:00 2001 From: Gusted Date: Sat, 9 Jul 2022 19:12:28 +0200 Subject: [PATCH 2/2] Use draft title --- options/locale/locale_en-US.ini | 1 + templates/repo/issue/view_title.tmpl | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index 464a7d396c0aa..36e2ae677becb 100644 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -1303,6 +1303,7 @@ issues.previous = Previous issues.next = Next issues.open_title = Open issues.closed_title = Closed +issues.draft_title = Draft issues.num_comments = %d comments issues.commented_at = `commented %s` issues.delete_comment_confirm = Are you sure you want to delete this comment? diff --git a/templates/repo/issue/view_title.tmpl b/templates/repo/issue/view_title.tmpl index 9fe9c48df3536..456515af33100 100644 --- a/templates/repo/issue/view_title.tmpl +++ b/templates/repo/issue/view_title.tmpl @@ -25,7 +25,7 @@
{{if .Issue.IsPull}}{{svg "octicon-git-pull-request"}}{{else}}{{svg "octicon-issue-closed"}}{{end}} {{.locale.Tr "repo.issues.closed_title"}}
{{else if .Issue.IsPull}} {{if .IsPullWorkInProgress}} -
{{svg "octicon-git-pull-request-draft"}} {{.locale.Tr "repo.issues.open_title"}}
+
{{svg "octicon-git-pull-request-draft"}} {{.locale.Tr "repo.issues.draft_title"}}
{{else}}
{{svg "octicon-git-pull-request"}} {{.locale.Tr "repo.issues.open_title"}}
{{end}}