|
| 1 | +{{$blobExcerptLink := print $.RepoLink (Iif $.PageIsWiki "/wiki" "") "/blob_excerpt/" (PathEscape $.AfterCommitID) (QueryBuild "?" "anchor" $.Anchor)}} |
1 | 2 | {{if $.IsSplitStyle}} |
2 | 3 | {{range $k, $line := $.section.Lines}} |
3 | 4 | <tr class="{{.GetHTMLDiffLineType}}-code nl-{{$k}} ol-{{$k}} line-expanded"> |
|
6 | 7 | <td class="lines-num lines-num-old" data-line-num="{{if $line.LeftIdx}}{{$line.LeftIdx}}{{end}}"> |
7 | 8 | <div class="code-expander-buttons" data-expand-direction="{{$expandDirection}}"> |
8 | 9 | {{if or (eq $expandDirection 3) (eq $expandDirection 5)}} |
9 | | - <button class="code-expander-button" hx-target="closest tr" hx-get="{{$.RepoLink}}/blob_excerpt/{{PathEscape $.AfterCommitID}}?{{$line.GetBlobExcerptQuery}}&style=split&direction=down&wiki={{$.PageIsWiki}}&anchor={{$.Anchor}}"> |
| 10 | + <button class="code-expander-button" hx-target="closest tr" hx-get="{{$blobExcerptLink}}&{{$line.GetBlobExcerptQuery}}&style=split&direction=down"> |
10 | 11 | {{svg "octicon-fold-down"}} |
11 | 12 | </button> |
12 | 13 | {{end}} |
13 | 14 | {{if or (eq $expandDirection 3) (eq $expandDirection 4)}} |
14 | | - <button class="code-expander-button" hx-target="closest tr" hx-get="{{$.RepoLink}}/blob_excerpt/{{PathEscape $.AfterCommitID}}?{{$line.GetBlobExcerptQuery}}&style=split&direction=up&wiki={{$.PageIsWiki}}&anchor={{$.Anchor}}"> |
| 15 | + <button class="code-expander-button" hx-target="closest tr" hx-get="{{$blobExcerptLink}}&{{$line.GetBlobExcerptQuery}}&style=split&direction=up"> |
15 | 16 | {{svg "octicon-fold-up"}} |
16 | 17 | </button> |
17 | 18 | {{end}} |
18 | 19 | {{if eq $expandDirection 2}} |
19 | | - <button class="code-expander-button" hx-target="closest tr" hx-get="{{$.RepoLink}}/blob_excerpt/{{PathEscape $.AfterCommitID}}?{{$line.GetBlobExcerptQuery}}&style=split&direction=&wiki={{$.PageIsWiki}}&anchor={{$.Anchor}}"> |
| 20 | + <button class="code-expander-button" hx-target="closest tr" hx-get="{{$blobExcerptLink}}&{{$line.GetBlobExcerptQuery}}&style=split"> |
20 | 21 | {{svg "octicon-fold"}} |
21 | 22 | </button> |
22 | 23 | {{end}} |
23 | 24 | </div> |
24 | 25 | </td> |
25 | | - <td colspan="7" class="lines-code lines-code-old ">{{$inlineDiff := $.section.GetComputedInlineDiffFor $line ctx.Locale}}{{/* |
26 | | - */}}{{template "repo/diff/section_code" dict "diff" $inlineDiff}}</td> |
| 26 | + <td colspan="7" class="lines-code lines-code-old"> |
| 27 | + {{- $inlineDiff := $.section.GetComputedInlineDiffFor $line ctx.Locale -}} |
| 28 | + {{- template "repo/diff/section_code" dict "diff" $inlineDiff -}} |
| 29 | + </td> |
27 | 30 | {{else}} |
28 | 31 | {{$inlineDiff := $.section.GetComputedInlineDiffFor $line ctx.Locale}} |
29 | 32 | <td class="lines-num lines-num-old" data-line-num="{{if $line.LeftIdx}}{{$line.LeftIdx}}{{end}}"><span rel="{{if $line.LeftIdx}}diff-{{$.FileNameHash}}L{{$line.LeftIdx}}{{end}}"></span></td> |
30 | 33 | <td class="lines-escape lines-escape-old">{{if and $line.LeftIdx $inlineDiff.EscapeStatus.Escaped}}<button class="toggle-escape-button btn interact-bg" title="{{template "repo/diff/escape_title" dict "diff" $inlineDiff}}"></button>{{end}}</td> |
31 | 34 | <td class="lines-type-marker lines-type-marker-old">{{if $line.LeftIdx}}<span class="tw-font-mono" data-type-marker=""></span>{{end}}</td> |
32 | | - <td class="lines-code lines-code-old">{{/* |
33 | | - */}}{{if $line.LeftIdx}}{{template "repo/diff/section_code" dict "diff" $inlineDiff}}{{else}}{{/* |
34 | | - */}}<code class="code-inner"></code>{{/* |
35 | | - */}}{{end}}{{/* |
36 | | - */}}</td> |
| 35 | + <td class="lines-code lines-code-old"> |
| 36 | + {{- if $line.LeftIdx -}} |
| 37 | + {{- template "repo/diff/section_code" dict "diff" $inlineDiff -}} |
| 38 | + {{- else -}} |
| 39 | + <code class="code-inner"></code> |
| 40 | + {{- end -}} |
| 41 | + </td> |
37 | 42 | <td class="lines-num lines-num-new" data-line-num="{{if $line.RightIdx}}{{$line.RightIdx}}{{end}}"><span rel="{{if $line.RightIdx}}diff-{{$.FileNameHash}}R{{$line.RightIdx}}{{end}}"></span></td> |
38 | 43 | <td class="lines-escape lines-escape-new">{{if and $line.RightIdx $inlineDiff.EscapeStatus.Escaped}}<button class="toggle-escape-button btn interact-bg" title="{{template "repo/diff/escape_title" dict "diff" $inlineDiff}}"></button>{{end}}</td> |
39 | 44 | <td class="lines-type-marker lines-type-marker-new">{{if $line.RightIdx}}<span class="tw-font-mono" data-type-marker=""></span>{{end}}</td> |
40 | | - <td class="lines-code lines-code-new">{{/* |
41 | | - */}}{{if $line.RightIdx}}{{template "repo/diff/section_code" dict "diff" $inlineDiff}}{{else}}{{/* |
42 | | - */}}<code class="code-inner"></code>{{/* |
43 | | - */}}{{end}}{{/* |
44 | | - */}}</td> |
| 45 | + <td class="lines-code lines-code-new"> |
| 46 | + {{- if $line.RightIdx -}} |
| 47 | + {{- template "repo/diff/section_code" dict "diff" $inlineDiff -}} |
| 48 | + {{- else -}} |
| 49 | + <code class="code-inner"></code> |
| 50 | + {{- end -}} |
| 51 | + </td> |
45 | 52 | {{end}} |
46 | 53 | </tr> |
47 | 54 | {{end}} |
|
53 | 60 | <td colspan="2" class="lines-num"> |
54 | 61 | <div class="code-expander-buttons" data-expand-direction="{{$expandDirection}}"> |
55 | 62 | {{if or (eq $expandDirection 3) (eq $expandDirection 5)}} |
56 | | - <button class="code-expander-button" hx-target="closest tr" hx-get="{{$.RepoLink}}/blob_excerpt/{{PathEscape $.AfterCommitID}}?{{$line.GetBlobExcerptQuery}}&style=unified&direction=down&wiki={{$.PageIsWiki}}&anchor={{$.Anchor}}"> |
| 63 | + <button class="code-expander-button" hx-target="closest tr" hx-get="{{$blobExcerptLink}}&{{$line.GetBlobExcerptQuery}}&style=unified&direction=down"> |
57 | 64 | {{svg "octicon-fold-down"}} |
58 | 65 | </button> |
59 | 66 | {{end}} |
60 | 67 | {{if or (eq $expandDirection 3) (eq $expandDirection 4)}} |
61 | | - <button class="code-expander-button" hx-target="closest tr" hx-get="{{$.RepoLink}}/blob_excerpt/{{PathEscape $.AfterCommitID}}?{{$line.GetBlobExcerptQuery}}&style=unified&direction=up&wiki={{$.PageIsWiki}}&anchor={{$.Anchor}}"> |
| 68 | + <button class="code-expander-button" hx-target="closest tr" hx-get="{{$blobExcerptLink}}&{{$line.GetBlobExcerptQuery}}&style=unified&direction=up"> |
62 | 69 | {{svg "octicon-fold-up"}} |
63 | 70 | </button> |
64 | 71 | {{end}} |
65 | 72 | {{if eq $expandDirection 2}} |
66 | | - <button class="code-expander-button" hx-target="closest tr" hx-get="{{$.RepoLink}}/blob_excerpt/{{PathEscape $.AfterCommitID}}?{{$line.GetBlobExcerptQuery}}&style=unified&direction=&wiki={{$.PageIsWiki}}&anchor={{$.Anchor}}"> |
| 73 | + <button class="code-expander-button" hx-target="closest tr" hx-get="{{$blobExcerptLink}}&{{$line.GetBlobExcerptQuery}}&style=unified"> |
67 | 74 | {{svg "octicon-fold"}} |
68 | 75 | </button> |
69 | 76 | {{end}} |
|
0 commit comments