2019-11-15 10:52:59 +08:00
|
|
|
{{if $.IsSplitStyle}}
|
2020-07-13 21:21:19 +08:00
|
|
|
{{range $k, $line := $.section.Lines}}
|
|
|
|
<tr class="{{DiffLineTypeToStr .GetType}}-code nl-{{$k}} ol-{{$k}}">
|
|
|
|
{{if eq .GetType 4}}
|
|
|
|
<td class="lines-num lines-num-old" data-line-num="{{if $line.LeftIdx}}{{$line.LeftIdx}}{{end}}">
|
|
|
|
{{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 5) }}
|
2021-11-17 02:18:25 +08:00
|
|
|
<a role="button" class="blob-excerpt" data-url="{{$.RepoLink}}/blob_excerpt/{{PathEscape $.AfterCommitID}}" data-query="{{$line.GetBlobExcerptQuery}}&style=split&direction=down" data-anchor="{{$.Anchor}}">
|
2020-09-12 04:19:00 +08:00
|
|
|
{{svg "octicon-fold-down"}}
|
2020-07-13 21:21:19 +08:00
|
|
|
</a>
|
|
|
|
{{end}}
|
|
|
|
{{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 4) }}
|
2021-11-17 02:18:25 +08:00
|
|
|
<a role="button" class="blob-excerpt" data-url="{{$.RepoLink}}/blob_excerpt/{{PathEscape $.AfterCommitID}}" data-query="{{$line.GetBlobExcerptQuery}}&style=split&direction=up" data-anchor="{{$.Anchor}}">
|
2020-09-12 04:19:00 +08:00
|
|
|
{{svg "octicon-fold-up"}}
|
2020-07-13 21:21:19 +08:00
|
|
|
</a>
|
|
|
|
{{end}}
|
|
|
|
{{if eq $line.GetExpandDirection 2}}
|
2021-11-17 02:18:25 +08:00
|
|
|
<a role="button" class="blob-excerpt" data-url="{{$.RepoLink}}/blob_excerpt/{{PathEscape $.AfterCommitID}}" data-query="{{$line.GetBlobExcerptQuery}}&style=split&direction=" data-anchor="{{$.Anchor}}">
|
2020-09-12 04:19:00 +08:00
|
|
|
{{svg "octicon-fold"}}
|
2020-07-13 21:21:19 +08:00
|
|
|
</a>
|
|
|
|
{{end}}
|
|
|
|
</td>
|
2020-11-04 15:14:07 +08:00
|
|
|
<td colspan="5" class="lines-code lines-code-old "><code class="code-inner">{{$.section.GetComputedInlineDiffFor $line}}</code></td>
|
2020-07-13 21:21:19 +08:00
|
|
|
{{else}}
|
|
|
|
<td class="lines-num lines-num-old" data-line-num="{{if $line.LeftIdx}}{{$line.LeftIdx}}{{end}}"><span rel="{{if $line.LeftIdx}}diff-{{Sha1 $.fileName}}L{{$line.LeftIdx}}{{end}}"></span></td>
|
|
|
|
<td class="blob-excerpt lines-type-marker lines-type-marker-old">{{if $line.LeftIdx}}<span class="mono" data-type-marker=""></span>{{end}}</td>
|
2020-11-04 15:14:07 +08:00
|
|
|
<td class="blob-excerpt lines-code lines-code-old halfwidth"><code class="code-inner">{{if $line.LeftIdx}}{{$.section.GetComputedInlineDiffFor $line}}{{end}}</code></td>
|
2020-07-13 21:21:19 +08:00
|
|
|
<td class="lines-num lines-num-new" data-line-num="{{if $line.RightIdx}}{{$line.RightIdx}}{{end}}"><span rel="{{if $line.RightIdx}}diff-{{Sha1 $.fileName}}R{{$line.RightIdx}}{{end}}"></span></td>
|
|
|
|
<td class="blob-excerpt lines-type-marker lines-type-marker-new">{{if $line.RightIdx}}<span class="mono" data-type-marker=""></span>{{end}}</td>
|
2020-11-04 15:14:07 +08:00
|
|
|
<td class="blob-excerpt lines-code lines-code-new halfwidth"><code class="code-inner">{{if $line.RightIdx}}{{$.section.GetComputedInlineDiffFor $line}}{{end}}</code></td>
|
2020-07-13 21:21:19 +08:00
|
|
|
{{end}}
|
|
|
|
</tr>
|
|
|
|
{{end}}
|
2019-11-15 10:52:59 +08:00
|
|
|
{{else}}
|
2020-07-13 21:21:19 +08:00
|
|
|
{{range $k, $line := $.section.Lines}}
|
|
|
|
<tr class="{{DiffLineTypeToStr .GetType}}-code nl-{{$k}} ol-{{$k}}">
|
|
|
|
{{if eq .GetType 4}}
|
|
|
|
<td colspan="2" class="lines-num">
|
|
|
|
{{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 5) }}
|
2021-11-17 02:18:25 +08:00
|
|
|
<a role="button" class="blob-excerpt" data-url="{{$.RepoLink}}/blob_excerpt/{{PathEscape $.AfterCommitID}}" data-query="{{$line.GetBlobExcerptQuery}}&style=unified&direction=down" data-anchor="{{$.Anchor}}">
|
2020-09-12 04:19:00 +08:00
|
|
|
{{svg "octicon-fold-down"}}
|
2020-07-13 21:21:19 +08:00
|
|
|
</a>
|
|
|
|
{{end}}
|
|
|
|
{{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 4) }}
|
2021-11-17 02:18:25 +08:00
|
|
|
<a role="button" class="blob-excerpt" data-url="{{$.RepoLink}}/blob_excerpt/{{PathEscape $.AfterCommitID}}" data-query="{{$line.GetBlobExcerptQuery}}&style=unified&direction=up" data-anchor="{{$.Anchor}}">
|
2020-09-12 04:19:00 +08:00
|
|
|
{{svg "octicon-fold-up"}}
|
2020-07-13 21:21:19 +08:00
|
|
|
</a>
|
|
|
|
{{end}}
|
|
|
|
{{if eq $line.GetExpandDirection 2}}
|
2021-11-17 02:18:25 +08:00
|
|
|
<a role="button" class="blob-excerpt" data-url="{{$.RepoLink}}/blob_excerpt/{{PathEscape $.AfterCommitID}}" data-query="{{$line.GetBlobExcerptQuery}}&style=unified&direction=" data-anchor="{{$.Anchor}}">
|
2020-09-12 04:19:00 +08:00
|
|
|
{{svg "octicon-fold"}}
|
2020-07-13 21:21:19 +08:00
|
|
|
</a>
|
|
|
|
{{end}}
|
|
|
|
</td>
|
|
|
|
{{else}}
|
|
|
|
<td class="lines-num lines-num-old" data-line-num="{{if $line.LeftIdx}}{{$line.LeftIdx}}{{end}}"><span rel="{{if $line.LeftIdx}}diff-{{Sha1 $.fileName}}L{{$line.LeftIdx}}{{end}}"></span></td>
|
|
|
|
<td class="lines-num lines-num-new" data-line-num="{{if $line.RightIdx}}{{$line.RightIdx}}{{end}}"><span rel="{{if $line.RightIdx}}diff-{{Sha1 $.fileName}}R{{$line.RightIdx}}{{end}}"></span></td>
|
|
|
|
{{end}}
|
|
|
|
<td class="blob-excerpt lines-type-marker"><span class="mono" data-type-marker="{{$line.GetLineTypeMarker}}"></span></td>
|
2020-11-04 15:14:07 +08:00
|
|
|
<td class="blob-excerpt lines-code{{if (not $line.RightIdx)}} lines-code-old{{end}}"><code class="code-inner">{{$.section.GetComputedInlineDiffFor $line}}</code></td>
|
2020-07-13 21:21:19 +08:00
|
|
|
</tr>
|
|
|
|
{{end}}
|
2020-02-12 01:02:41 +08:00
|
|
|
{{end}}
|