diff options
Diffstat (limited to 'templates/repo/editor/diff_preview.tmpl')
-rw-r--r-- | templates/repo/editor/diff_preview.tmpl | 25 |
1 files changed, 3 insertions, 22 deletions
diff --git a/templates/repo/editor/diff_preview.tmpl b/templates/repo/editor/diff_preview.tmpl index 1c4787a3..06b4a2e8 100644 --- a/templates/repo/editor/diff_preview.tmpl +++ b/templates/repo/editor/diff_preview.tmpl @@ -1,29 +1,10 @@ -{{$highlightClass := .File.GetHighlightClass}} -<div class="diff-file-box diff-box file-content" id="diff-{{.Index}}"> +<div class="diff-file-box"> <div class="ui attached table segment"> <div class="file-body file-code code-view code-diff"> <table> <tbody> - {{range $j, $section := .File.Sections}} - {{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 gt $j 0}}<span class="fold octicon octicon-fold"></span>{{end}} */}} - </td> - {{else}} - <td class="lines-num lines-num-old"> - <span rel="{{if $line.LeftIdx}}diff-{{Sha1 $.File.Name}}L{{$line.LeftIdx}}{{end}}">{{if $line.LeftIdx}}{{$line.LeftIdx}}{{end}}</span> - </td> - <td class="lines-num lines-num-new"> - <span rel="{{if $line.RightIdx}}diff-{{Sha1 $.File.Name}}R{{$line.RightIdx}}{{end}}">{{if $line.RightIdx}}{{$line.RightIdx}}{{end}}</span> - </td> - {{end}} - <td class="lines-code"> - <pre><code class="{{if $highlightClass}}language-{{$highlightClass}}{{else}}nohighlight{{end}}">{{$section.GetComputedInlineDiffFor $line}}</code></pre> - </td> - </tr> - {{end}} + {{with .File}} + {{template "repo/diff/section_unified" .}} {{end}} </tbody> </table> |