aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2017-02-23 13:24:59 -0500
committerUnknwon <u@gogs.io>2017-02-23 13:24:59 -0500
commit48cf9edcf5652217e986445d83f9f29624e4f377 (patch)
treefa99f4d35a8e16811fd2f1c5756c82cfc535fc16
parent0c8c1ee96ffb5479cd42c3e458a5bd59244bbd88 (diff)
templates/repo/diff: fix tag-code doesn't display in split view
-rw-r--r--templates/repo/diff/box.tmpl31
-rw-r--r--templates/repo/diff/section_unified.tmpl2
2 files changed, 20 insertions, 13 deletions
diff --git a/templates/repo/diff/box.tmpl b/templates/repo/diff/box.tmpl
index 4f6c70a3..96fdc28b 100644
--- a/templates/repo/diff/box.tmpl
+++ b/templates/repo/diff/box.tmpl
@@ -93,18 +93,25 @@
{{range $j, $section := $file.Sections}}
{{range $k, $line := $section.Lines}}
<tr class="{{DiffLineTypeToStr .GetType}}-code nl-{{$k}} ol-{{$k}}">
- <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-code halfwidth">
- <pre><code class="wrap {{if $highlightClass}}language-{{$highlightClass}}{{else}}nohighlight{{end}}">{{if $line.LeftIdx}}{{$section.GetComputedInlineDiffFor $line}}{{end}}</code></pre>
- </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>
- <td class="lines-code halfwidth">
- <pre><code class="wrap {{if $highlightClass}}language-{{$highlightClass}}{{else}}nohighlight{{end}}">{{if $line.RightIdx}}{{$section.GetComputedInlineDiffFor $line}}{{end}}</code></pre>
- </td>
+ {{if eq .GetType 4}}
+ <td class="lines-num"></td>
+ <td colspan="3" class="lines-code">
+ <pre><code class="{{if $highlightClass}}language-{{$highlightClass}}{{else}}nohighlight{{end}}">{{$section.GetComputedInlineDiffFor $line}}</code></pre>
+ </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-code halfwidth">
+ <pre><code class="wrap {{if $highlightClass}}language-{{$highlightClass}}{{else}}nohighlight{{end}}">{{if $line.LeftIdx}}{{$section.GetComputedInlineDiffFor $line}}{{end}}</code></pre>
+ </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>
+ <td class="lines-code halfwidth">
+ <pre><code class="wrap {{if $highlightClass}}language-{{$highlightClass}}{{else}}nohighlight{{end}}">{{if $line.RightIdx}}{{$section.GetComputedInlineDiffFor $line}}{{end}}</code></pre>
+ </td>
+ {{end}}
</tr>
{{end}}
{{end}}
diff --git a/templates/repo/diff/section_unified.tmpl b/templates/repo/diff/section_unified.tmpl
index f5ea81f1..619f97cf 100644
--- a/templates/repo/diff/section_unified.tmpl
+++ b/templates/repo/diff/section_unified.tmpl
@@ -19,7 +19,7 @@
{{end}}
</td>
{{end}}
- <td class="lines-code" rel="">
+ <td class="lines-code">
<pre><code class="{{if $highlightClass}}language-{{$highlightClass}}{{else}}nohighlight{{end}}">{{$section.GetComputedInlineDiffFor $line}}</code></pre>
</td>
</tr>