|
118 | 118 | {{template "repo/diff/image_diff" dict "file" . "root" $}}
|
119 | 119 | {{else}}
|
120 | 120 | {{if $.IsSplitStyle}}
|
121 |
| - {{range $j, $section := $file.Sections}} |
122 |
| - {{range $k, $line := $section.Lines}} |
123 |
| - <tr class="{{DiffLineTypeToStr .GetType}}-code nl-{{$k}} ol-{{$k}}"> |
124 |
| - {{if eq .GetType 4}} |
125 |
| - <td class="lines-num lines-num-old"> |
126 |
| - {{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 5) }} |
127 |
| - <a role="button" class="blob-excerpt" data-url="{{$.RepoLink}}/blob_excerpt/{{$.AfterCommitID}}" data-query="{{$line.GetBlobExcerptQuery}}&style=split&direction=down" data-anchor="diff-{{Sha1 $file.Name}}K{{$line.SectionInfo.RightIdx}}"> |
128 |
| - {{svg "octicon-fold-down"}} |
129 |
| - </a> |
130 |
| - {{end}} |
131 |
| - {{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 4) }} |
132 |
| - <a role="button" class="blob-excerpt" data-url="{{$.RepoLink}}/blob_excerpt/{{$.AfterCommitID}}" data-query="{{$line.GetBlobExcerptQuery}}&style=split&direction=up" data-anchor="diff-{{Sha1 $file.Name}}K{{$line.SectionInfo.RightIdx}}"> |
133 |
| - {{svg "octicon-fold-up"}} |
134 |
| - </a> |
135 |
| - {{end}} |
136 |
| - {{if eq $line.GetExpandDirection 2}} |
137 |
| - <a role="button" class="blob-excerpt" data-url="{{$.RepoLink}}/blob_excerpt/{{$.AfterCommitID}}" data-query="{{$line.GetBlobExcerptQuery}}&style=split&direction=" data-anchor="diff-{{Sha1 $file.Name}}K{{$line.SectionInfo.RightIdx}}"> |
138 |
| - {{svg "octicon-fold"}} |
139 |
| - </a> |
140 |
| - {{end}} |
141 |
| - </td> |
142 |
| - <td colspan="5" class="lines-code lines-code-old "><code class="code-inner">{{$section.GetComputedInlineDiffFor $line}}</span></td> |
143 |
| - {{else}} |
144 |
| - <td class="lines-num lines-num-old" data-line-num="{{if $line.LeftIdx}}{{$line.LeftIdx}}{{end}}"><span rel="{{if $line.LeftIdx}}diff-{{Sha1 $file.Name}}L{{$line.LeftIdx}}{{end}}"></span></td> |
145 |
| - <td class="lines-type-marker lines-type-marker-old">{{if $line.LeftIdx}}<span class="mono" data-type-marker="{{$line.GetLineTypeMarker}}"></span>{{end}}</td> |
146 |
| - <td class="lines-code lines-code-old halfwidth">{{if and $.SignedUserID $line.CanComment $.PageIsPullFiles (not (eq .GetType 2))}}<a class="ui primary button add-code-comment add-code-comment-left" data-path="{{$file.Name}}" data-side="left" data-idx="{{$line.LeftIdx}}">{{svg "octicon-plus"}}</a>{{end}}<code class="code-inner">{{if $line.LeftIdx}}{{$section.GetComputedInlineDiffFor $line}}{{end}}</code></td> |
147 |
| - <td class="lines-num lines-num-new" data-line-num="{{if $line.RightIdx}}{{$line.RightIdx}}{{end}}"><span rel="{{if $line.RightIdx}}diff-{{Sha1 $file.Name}}R{{$line.RightIdx}}{{end}}"></span></td> |
148 |
| - <td class="lines-type-marker lines-type-marker-new">{{if $line.RightIdx}}<span class="mono" data-type-marker="{{$line.GetLineTypeMarker}}"></span>{{end}}</td> |
149 |
| - <td class="lines-code lines-code-new halfwidth">{{if and $.SignedUserID $line.CanComment $.PageIsPullFiles (not (eq .GetType 3))}}<a class="ui primary button add-code-comment add-code-comment-right" data-path="{{$file.Name}}" data-side="right" data-idx="{{$line.RightIdx}}">{{svg "octicon-plus"}}</a>{{end}}<code class="code-inner">{{if $line.RightIdx}}{{$section.GetComputedInlineDiffFor $line}}{{end}}</code></td> |
150 |
| - {{end}} |
151 |
| - </tr> |
152 |
| - {{if gt (len $line.Comments) 0}} |
153 |
| - <tr class="add-code-comment"> |
154 |
| - <td class="lines-num"></td> |
155 |
| - <td class="lines-type-marker"></td> |
156 |
| - <td class="add-comment-left"> |
157 |
| - {{if eq $line.GetCommentSide "previous"}} |
158 |
| - {{template "repo/diff/conversation" mergeinto $ "comments" $line.Comments}} |
159 |
| - {{end}} |
160 |
| - </td> |
161 |
| - <td class="lines-num"></td> |
162 |
| - <td class="lines-type-marker"></td> |
163 |
| - <td class="add-comment-right"> |
164 |
| - {{if eq $line.GetCommentSide "proposed"}} |
165 |
| - {{template "repo/diff/conversation" mergeinto $ "comments" $line.Comments}} |
166 |
| - {{end}} |
167 |
| - </td> |
168 |
| - </tr> |
169 |
| - {{end}} |
170 |
| - {{end}} |
171 |
| - {{end}} |
| 121 | + {{template "repo/diff/section_split" dict "file" . "root" $}} |
172 | 122 | {{else}}
|
173 | 123 | {{template "repo/diff/section_unified" dict "file" . "root" $}}
|
174 | 124 | {{end}}
|
|
0 commit comments