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.
This commit is contained in:
wxiaoguang 2023-05-09 13:21:03 +08:00 committed by GitHub
parent 2ee72d011f
commit b6fc2cdf82
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 19 additions and 16 deletions

View File

@ -1,6 +1,6 @@
{{if .DiffNotAvailable}} {{if .DiffNotAvailable}}
<div class="diff-detail-box diff-box sticky">
<div> <div>
<div class="diff-detail-box diff-box sticky">
<div class="ui right"> <div class="ui right">
{{template "repo/diff/whitespace_dropdown" .}} {{template "repo/diff/whitespace_dropdown" .}}
{{template "repo/diff/options_dropdown" .}} {{template "repo/diff/options_dropdown" .}}

View File

@ -1,8 +1,8 @@
{{template "base/head" .}} {{template "base/head" .}}
<div role="main" aria-label="{{.Title}}" class="page-content repository diff {{if .PageIsComparePull}}compare pull{{end}}"> <div role="main" aria-label="{{.Title}}" class="page-content repository diff {{if .PageIsComparePull}}compare pull{{end}}">
{{template "repo/header" .}} {{template "repo/header" .}}
<div class="ui container fluid padded"> {{$showDiffBox := false}}
<div class="ui container">
<h2 class="ui header"> <h2 class="ui header">
{{if and $.PageIsComparePull $.IsSigned (not .Repository.IsArchived)}} {{if and $.PageIsComparePull $.IsSigned (not .Repository.IsArchived)}}
{{.locale.Tr "repo.pulls.compare_changes"}} {{.locale.Tr "repo.pulls.compare_changes"}}
@ -34,11 +34,6 @@
{{- if eq $.HeadRepo.OwnerName .RootRepo.OwnerName -}} {{- if eq $.HeadRepo.OwnerName .RootRepo.OwnerName -}}
{{- $HeadCompareName = printf "%s/%s" $.HeadRepo.OwnerName $.HeadRepo.Name -}} {{- $HeadCompareName = printf "%s/%s" $.HeadRepo.OwnerName $.HeadRepo.Name -}}
{{- end -}} {{- end -}}
{{- if .OwnForkRepo -}}
{{- if eq $.OwnForkRepo.OwnerName .RootRepo.OwnerName -}}
{{- $OwnForkRepoCompareName = printf "%s/%s" $.OwnForkRepo.OwnerName $.OwnForkRepo.Name -}}
{{- end -}}
{{- end -}}
{{- end -}} {{- end -}}
<div class="ui segment choose branch"> <div class="ui segment choose branch">
<a href="{{$.HeadRepo.Link}}/compare/{{PathEscapeSegments $.HeadBranch}}{{$.CompareSeparator}}{{if not $.PullRequestCtx.SameRepo}}{{PathEscape $.BaseName}}/{{PathEscape $.Repository.Name}}:{{end}}{{PathEscapeSegments $.BaseBranch}}" title="{{.locale.Tr "repo.pulls.switch_head_and_base"}}">{{svg "octicon-git-compare"}}</a> <a href="{{$.HeadRepo.Link}}/compare/{{PathEscapeSegments $.HeadBranch}}{{$.CompareSeparator}}{{if not $.PullRequestCtx.SameRepo}}{{PathEscape $.BaseName}}/{{PathEscape $.Repository.Name}}:{{end}}{{PathEscapeSegments $.BaseBranch}}" title="{{.locale.Tr "repo.pulls.switch_head_and_base"}}">{{svg "octicon-git-compare"}}</a>
@ -203,14 +198,15 @@
<span class="index">#{{.PullRequest.Issue.Index}}</span> <span class="index">#{{.PullRequest.Issue.Index}}</span>
</h1> </h1>
</div> </div>
<div class="four wide right middle aligned column"> <div class="four wide column middle aligned text right">
{{- if .PullRequest.HasMerged -}} {{- if .PullRequest.HasMerged -}}
<a href="{{Escape $.RepoLink}}/pulls/{{.PullRequest.Issue.Index}}" class="ui button purple show-form">{{svg "octicon-git-merge" 16}} {{.locale.Tr "repo.pulls.view"}}</a> <a href="{{Escape $.RepoLink}}/pulls/{{.PullRequest.Issue.Index}}" class="ui button purple show-form">{{svg "octicon-git-merge" 16}} {{.locale.Tr "repo.pulls.view"}}</a>
{{else if .Issue.IsClosed}} {{else if .Issue.IsClosed}}
<a href="{{Escape $.RepoLink}}/pulls/{{.PullRequest.Issue.Index}}" class="ui button red show-form">{{svg "octicon-issue-closed" 16}} {{.locale.Tr "repo.pulls.view"}}</a> <a href="{{Escape $.RepoLink}}/pulls/{{.PullRequest.Issue.Index}}" class="ui button red show-form">{{svg "octicon-issue-closed" 16}} {{.locale.Tr "repo.pulls.view"}}</a>
{{else}} {{else}}
<a href="{{Escape $.RepoLink}}/pulls/{{.PullRequest.Issue.Index}}" class="ui button green show-form">{{svg "octicon-git-pull-request" 16}} {{.locale.Tr "repo.pulls.view"}}</a> <a href="{{Escape $.RepoLink}}/pulls/{{.PullRequest.Issue.Index}}" class="ui button green show-form">{{svg "octicon-git-pull-request" 16}} {{.locale.Tr "repo.pulls.view"}}</a>
{{end}}</div> {{end}}
</div>
</div> </div>
{{else}} {{else}}
{{if and $.IsSigned (not .Repository.IsArchived)}} {{if and $.IsSigned (not .Repository.IsArchived)}}
@ -231,13 +227,20 @@
{{template "repo/issue/new_form" .}} {{template "repo/issue/new_form" .}}
</div> </div>
{{end}} {{end}}
{{template "repo/commits_table" .}} {{$showDiffBox = true}}
{{template "repo/diff/box" .}}
{{end}} {{end}}
{{else}} {{else}}
{{template "repo/commits_table" .}} {{$showDiffBox = true}}
{{template "repo/diff/box" .}}
{{end}} {{end}}
</div> </div>
{{if $showDiffBox}}
<div class="ui container">
{{template "repo/commits_table" .}}
</div>
<div class="ui container fluid padded">
{{template "repo/diff/box" .}}
</div>
{{end}}
</div> </div>
{{template "base/footer" .}} {{template "base/footer" .}}

View File

@ -5,7 +5,7 @@
<div role="main" aria-label="{{.Title}}" class="page-content repository view issue pull files diff"> <div role="main" aria-label="{{.Title}}" class="page-content repository view issue pull files diff">
{{template "repo/header" .}} {{template "repo/header" .}}
<div class="ui container"> <div class="ui container fluid padded">
{{template "repo/issue/view_title" .}} {{template "repo/issue/view_title" .}}
{{template "repo/pulls/tab_menu" .}} {{template "repo/pulls/tab_menu" .}}
{{template "repo/diff/box" .}} {{template "repo/diff/box" .}}