mirror of
https://github.com/go-gitea/gitea.git
synced 2025-12-08 22:11:40 +01:00
fix: Exclude code expansion arrows when DiffBlobExcerptData is not available. (#36060)
Resolves #35994 Do not render code expansion arrows when `DiffBlobExcerptData` is not available (code file preview, pull conversation diff comment). --------- Signed-off-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
parent
5fdc84841a
commit
6675ddc117
@ -1,5 +1,5 @@
|
||||
{{$file := .file}}
|
||||
{{/* this tmpl is also used by the PR Conversation page, so the "AfterCommitID" and "DiffBlobExcerptData" may not exist */}}
|
||||
{{/* this tmpl is also used by the PR Conversation page, so "DiffBlobExcerptData" may not exist */}}
|
||||
{{$diffBlobExcerptData := $.root.DiffBlobExcerptData}}
|
||||
<colgroup>
|
||||
<col width="50">
|
||||
@ -12,10 +12,10 @@
|
||||
{{range $k, $line := $section.Lines}}
|
||||
<tr class="{{.GetHTMLDiffLineType}}-code nl-{{$k}} ol-{{$k}}" data-line-type="{{.GetHTMLDiffLineType}}">
|
||||
{{if eq .GetType 4}}
|
||||
{{if $.root.AfterCommitID}}
|
||||
{{if $diffBlobExcerptData}}
|
||||
<td colspan="2" class="lines-num">{{$line.RenderBlobExcerptButtons $file.NameHash $diffBlobExcerptData}}</td>
|
||||
{{else}}
|
||||
{{/* for code file preview page or comment diffs on pull comment pages, do not show the expansion arrows */}}
|
||||
{{/* when DiffBlobExcerptData is not available (code file preview, pull conversation diff comment), do not show the expansion arrows */}}
|
||||
<td colspan="2" class="lines-num"></td>
|
||||
{{end}}
|
||||
{{else}}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user