From 4033bff8144e798ea6ee9918e6ccb8ce651c54dd Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Tue, 9 May 2023 10:58:49 +0800 Subject: [PATCH] fix --- templates/repo/diff/box.tmpl | 4 ++-- templates/repo/diff/compare.tmpl | 27 +++++++++++++++------------ templates/repo/pulls/files.tmpl | 2 +- 3 files changed, 18 insertions(+), 15 deletions(-) diff --git a/templates/repo/diff/box.tmpl b/templates/repo/diff/box.tmpl index 21ea63cc0a466..26b863aceae5c 100644 --- a/templates/repo/diff/box.tmpl +++ b/templates/repo/diff/box.tmpl @@ -1,6 +1,6 @@ {{if .DiffNotAvailable}} -
-
+
+
{{template "repo/diff/whitespace_dropdown" .}} {{template "repo/diff/options_dropdown" .}} diff --git a/templates/repo/diff/compare.tmpl b/templates/repo/diff/compare.tmpl index 3ec08b00ac3d2..cb6dca441e568 100644 --- a/templates/repo/diff/compare.tmpl +++ b/templates/repo/diff/compare.tmpl @@ -1,8 +1,8 @@ {{template "base/head" .}}
{{template "repo/header" .}} -
- + {{$showDiffBox := false}} +

{{if and $.PageIsComparePull $.IsSigned (not .Repository.IsArchived)}} {{.locale.Tr "repo.pulls.compare_changes"}} @@ -34,11 +34,6 @@ {{- if eq $.HeadRepo.OwnerName .RootRepo.OwnerName -}} {{- $HeadCompareName = printf "%s/%s" $.HeadRepo.OwnerName $.HeadRepo.Name -}} {{- end -}} - {{- if .OwnForkRepo -}} - {{- if eq $.OwnForkRepo.OwnerName .RootRepo.OwnerName -}} - {{- $OwnForkRepoCompareName = printf "%s/%s" $.OwnForkRepo.OwnerName $.OwnForkRepo.Name -}} - {{- end -}} - {{- end -}} {{- end -}}
{{svg "octicon-git-compare"}} @@ -203,14 +198,15 @@ #{{.PullRequest.Issue.Index}}

-
{{else}} {{if and $.IsSigned (not .Repository.IsArchived)}} @@ -231,13 +227,20 @@ {{template "repo/issue/new_form" .}}
{{end}} - {{template "repo/commits_table" .}} - {{template "repo/diff/box" .}} + {{$showDiffBox = true}} {{end}} {{else}} + {{$showDiffBox = true}} + {{end}} +
+ + {{if $showDiffBox}} +
{{template "repo/commits_table" .}} +
+
{{template "repo/diff/box" .}} - {{end}}
+ {{end}}
{{template "base/footer" .}} diff --git a/templates/repo/pulls/files.tmpl b/templates/repo/pulls/files.tmpl index feec6eae743b4..402bec800b258 100644 --- a/templates/repo/pulls/files.tmpl +++ b/templates/repo/pulls/files.tmpl @@ -5,7 +5,7 @@
{{template "repo/header" .}} -
+
{{template "repo/issue/view_title" .}} {{template "repo/pulls/tab_menu" .}} {{template "repo/diff/box" .}}