From c9480c5f606e1e83f8f9c373052c0ba758bf300b Mon Sep 17 00:00:00 2001 From: Jimmy Praet Date: Thu, 27 May 2021 22:02:04 +0200 Subject: Add links to toggle WIP status (#14677) * Add links to toggle PR WIP status * Allow PR author to toggle WIP status * refactors and restyling, remove links from translations Co-authored-by: Norwin Co-authored-by: silverwind --- templates/repo/issue/view_content/pull.tmpl | 53 ++++++++++++++++++----------- 1 file changed, 33 insertions(+), 20 deletions(-) (limited to 'templates/repo/issue/view_content/pull.tmpl') diff --git a/templates/repo/issue/view_content/pull.tmpl b/templates/repo/issue/view_content/pull.tmpl index 69462797a2..3bdec4becb 100644 --- a/templates/repo/issue/view_content/pull.tmpl +++ b/templates/repo/issue/view_content/pull.tmpl @@ -13,7 +13,7 @@ {{avatar .User}} {{end}} - + {{if .User}} {{.User.GetDisplayName}} {{else if .Team}} @@ -39,7 +39,7 @@ {{end}} {{if (and $.Permission.IsAdmin (or (eq .Review.Type 1) (eq .Review.Type 3)) (not $.Issue.IsClosed))}} - + {{svg "octicon-x" 16}} {{else if .IsPullWorkInProgress}} -
- {{svg "octicon-x"}} - {{$.i18n.Tr "repo.pulls.cannot_merge_work_in_progress" (.WorkInProgressPrefix|Escape) | Str2html}} +
+
+ {{svg "octicon-x"}} + {{$.i18n.Tr "repo.pulls.cannot_merge_work_in_progress" }} +
+
+ {{if or .HasIssuesOrPullsWritePermission .IsIssuePoster}} + + {{end}} +
{{else if .Issue.PullRequest.IsChecking}}
@@ -182,7 +191,7 @@ {{$.i18n.Tr "repo.pulls.is_checking"}}
{{else if .Issue.PullRequest.IsEmpty}} -
+
{{svg "octicon-alert" 16}} {{$.i18n.Tr "repo.pulls.is_empty"}}
@@ -443,14 +452,14 @@ {{svg "octicon-x"}} {{$.i18n.Tr "repo.pulls.no_merge_desc"}}
-
+
{{svg "octicon-info"}} {{$.i18n.Tr "repo.pulls.no_merge_helper"}}
{{end}} {{else}}
-
+
{{svg "octicon-info"}} {{$.i18n.Tr "repo.pulls.no_merge_access"}}
@@ -503,7 +512,7 @@ {{svg "octicon-x"}} {{$.i18n.Tr "repo.pulls.cannot_auto_merge_desc"}}
-
+
{{svg "octicon-info"}} {{$.i18n.Tr "repo.pulls.cannot_auto_merge_helper"}}
@@ -511,17 +520,21 @@ {{end}} {{if and (gt .Issue.PullRequest.CommitsBehind 0) (not .Issue.IsClosed) (not .Issue.PullRequest.IsChecking) (not .IsPullFilesConflicted) (not .IsPullRequestBroken) (not $canAutoMerge)}} -
- {{svg "octicon-alert"}} - {{$.i18n.Tr "repo.pulls.outdated_with_base_branch"}} - {{if .UpdateAllowed}} -
- {{.CsrfTokenHtml}} - -
- {{end}} +
+
+ {{svg "octicon-alert"}} + {{$.i18n.Tr "repo.pulls.outdated_with_base_branch"}} +
+
+ {{if .UpdateAllowed}} +
+ {{.CsrfTokenHtml}} + +
+ {{end}} +
{{end}} -- cgit v1.2.3