Skip to content

Commit b6fc2cd

Browse files
authored
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.
1 parent 2ee72d0 commit b6fc2cd

File tree

3 files changed

+18
-15
lines changed

3 files changed

+18
-15
lines changed

templates/repo/diff/box.tmpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{{if .DiffNotAvailable}}
2-
<div class="diff-detail-box diff-box sticky">
3-
<div>
2+
<div>
3+
<div class="diff-detail-box diff-box sticky">
44
<div class="ui right">
55
{{template "repo/diff/whitespace_dropdown" .}}
66
{{template "repo/diff/options_dropdown" .}}

templates/repo/diff/compare.tmpl

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{{template "base/head" .}}
22
<div role="main" aria-label="{{.Title}}" class="page-content repository diff {{if .PageIsComparePull}}compare pull{{end}}">
33
{{template "repo/header" .}}
4-
<div class="ui container fluid padded">
5-
4+
{{$showDiffBox := false}}
5+
<div class="ui container">
66
<h2 class="ui header">
77
{{if and $.PageIsComparePull $.IsSigned (not .Repository.IsArchived)}}
88
{{.locale.Tr "repo.pulls.compare_changes"}}
@@ -34,11 +34,6 @@
3434
{{- if eq $.HeadRepo.OwnerName .RootRepo.OwnerName -}}
3535
{{- $HeadCompareName = printf "%s/%s" $.HeadRepo.OwnerName $.HeadRepo.Name -}}
3636
{{- end -}}
37-
{{- if .OwnForkRepo -}}
38-
{{- if eq $.OwnForkRepo.OwnerName .RootRepo.OwnerName -}}
39-
{{- $OwnForkRepoCompareName = printf "%s/%s" $.OwnForkRepo.OwnerName $.OwnForkRepo.Name -}}
40-
{{- end -}}
41-
{{- end -}}
4237
{{- end -}}
4338
<div class="ui segment choose branch">
4439
<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 @@
203198
<span class="index">#{{.PullRequest.Issue.Index}}</span>
204199
</h1>
205200
</div>
206-
<div class="four wide right middle aligned column">
201+
<div class="four wide column middle aligned text right">
207202
{{- if .PullRequest.HasMerged -}}
208203
<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>
209204
{{else if .Issue.IsClosed}}
210205
<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>
211206
{{else}}
212207
<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>
213-
{{end}}</div>
208+
{{end}}
209+
</div>
214210
</div>
215211
{{else}}
216212
{{if and $.IsSigned (not .Repository.IsArchived)}}
@@ -231,13 +227,20 @@
231227
{{template "repo/issue/new_form" .}}
232228
</div>
233229
{{end}}
234-
{{template "repo/commits_table" .}}
235-
{{template "repo/diff/box" .}}
230+
{{$showDiffBox = true}}
236231
{{end}}
237232
{{else}}
233+
{{$showDiffBox = true}}
234+
{{end}}
235+
</div>
236+
237+
{{if $showDiffBox}}
238+
<div class="ui container">
238239
{{template "repo/commits_table" .}}
240+
</div>
241+
<div class="ui container fluid padded">
239242
{{template "repo/diff/box" .}}
240-
{{end}}
241243
</div>
244+
{{end}}
242245
</div>
243246
{{template "base/footer" .}}

templates/repo/pulls/files.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
<div role="main" aria-label="{{.Title}}" class="page-content repository view issue pull files diff">
77
{{template "repo/header" .}}
8-
<div class="ui container">
8+
<div class="ui container fluid padded">
99
{{template "repo/issue/view_title" .}}
1010
{{template "repo/pulls/tab_menu" .}}
1111
{{template "repo/diff/box" .}}

0 commit comments

Comments
 (0)