From b6fc2cdf82acc9792a3607dc4afba93f03fff9d7 Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Tue, 9 May 2023 13:21:03 +0800 Subject: [PATCH] Make diff view full width again (#24598) Regression of #24459 , [the related line](https://github.com/go-gitea/gitea/pull/24459/files#diff-f255004de8d715ff40852710390429bf2a06e7e33a4e3f8ad568af636557ac71L8) The PR file diff view needs to be full-screen width. --- templates/repo/diff/box.tmpl | 4 ++-- templates/repo/diff/compare.tmpl | 29 ++++++++++++++++------------- templates/repo/pulls/files.tmpl | 2 +- 3 files changed, 19 insertions(+), 16 deletions(-) diff --git a/templates/repo/diff/box.tmpl b/templates/repo/diff/box.tmpl index 21ea63cc0..26b863ace 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 3ec08b00a..cb6dca441 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}} - {{template "repo/commits_table" .}} - {{template "repo/diff/box" .}} + {{$showDiffBox = true}} {{end}}
+ + {{if $showDiffBox}} +
+ {{template "repo/commits_table" .}} +
+
+ {{template "repo/diff/box" .}} +
+ {{end}}
{{template "base/footer" .}} diff --git a/templates/repo/pulls/files.tmpl b/templates/repo/pulls/files.tmpl index feec6eae7..402bec800 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" .}}