diff --git a/templates/repo/diff/compare.tmpl b/templates/repo/diff/compare.tmpl index d0472577d0abf..a3cd64e48ca38 100644 --- a/templates/repo/diff/compare.tmpl +++ b/templates/repo/diff/compare.tmpl @@ -171,10 +171,7 @@ {{if .IsNothingToCompare}} {{if and $.IsSigned $.AllowEmptyPr (not .Repository.IsArchived) .PageIsComparePull}}
{{ctx.Locale.Tr "repo.pulls.nothing_to_compare_and_allow_empty_pr"}}
-
- -
-
+
{{template "repo/issue/new_form" .}}
{{else if and .HeadIsBranch .BaseIsBranch}} @@ -185,29 +182,25 @@ {{else if and .PageIsComparePull (gt .CommitCount 0)}} {{if .HasPullRequest}}
-
+
{{ctx.Locale.Tr "repo.pulls.has_pull_request" (print $.RepoLink "/pulls/" .PullRequest.Issue.Index) $.RepoRelPath .PullRequest.Index}} -

- {{RenderIssueTitle $.Context .PullRequest.Issue.Title ($.Repository.ComposeMetas ctx)}} - #{{.PullRequest.Issue.Index}} +

+
+ {{RenderIssueTitle $.Context .PullRequest.Issue.Title ($.Repository.ComposeMetas ctx)}} + #{{.PullRequest.Issue.Index}} +
+ {{- if .PullRequest.HasMerged -}} + {{svg "octicon-git-merge" 16}} {{ctx.Locale.Tr "repo.pulls.view"}} + {{else if .Issue.IsClosed}} + {{svg "octicon-issue-closed" 16}} {{ctx.Locale.Tr "repo.pulls.view"}} + {{else}} + {{svg "octicon-git-pull-request" 16}} {{ctx.Locale.Tr "repo.pulls.view"}} + {{end}}

-
{{else}} - {{if and $.IsSigned (not .Repository.IsArchived)}} -
- -
- {{else if .Repository.IsArchived}} + {{if .Repository.IsArchived}}
{{if .Repository.ArchivedUnix.IsZero}} {{ctx.Locale.Tr "repo.archive.title"}} @@ -216,8 +209,8 @@ {{end}}
{{end}} - {{if $.IsSigned}} -
+ {{if and $.IsSigned (not .Repository.IsArchived)}} +
{{template "repo/issue/new_form" .}}
{{end}} diff --git a/web_src/css/repo.css b/web_src/css/repo.css index c579745238de6..baba4f58bcb1c 100644 --- a/web_src/css/repo.css +++ b/web_src/css/repo.css @@ -1130,10 +1130,6 @@ td .commit-summary { height: 10px; } -.repository.compare.pull .show-form-container { - text-align: left; -} - .repository .choose.branch { display: flex; align-items: center; diff --git a/web_src/js/features/repo-legacy.js b/web_src/js/features/repo-legacy.js index e83de27e4cf42..ab8e28fe53a43 100644 --- a/web_src/js/features/repo-legacy.js +++ b/web_src/js/features/repo-legacy.js @@ -399,18 +399,5 @@ export function initRepository() { initRepoPullRequestCommitStatus(); } - // Pull request - const $repoComparePull = $('.repository.compare.pull'); - if ($repoComparePull.length > 0) { - // show pull request form - $repoComparePull.find('button.show-form').on('click', function (e) { - e.preventDefault(); - hideElem($(this).parent()); - - const $form = $repoComparePull.find('.pullrequest-form'); - showElem($form); - }); - } - initUnicodeEscapeButton(); }