1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +00:00

Merge pull request #2335 from andreynering/highlight-diff

Highlight diff
This commit is contained in:
Unknwon
2016-01-09 13:39:18 +08:00
6 changed files with 192 additions and 14 deletions

View File

@@ -26,7 +26,7 @@
{{end}}
</div>
<!-- todo finish all file status, now modify, add, delete and rename -->
<span class="status {{DiffTypeToStr .Type}} poping up" data-content="{{DiffTypeToStr .Type}}" data-variation="inverted tiny" data-position="right center">&nbsp;</span>
<span class="status {{DiffTypeToStr .GetType}} poping up" data-content="{{DiffTypeToStr .GetType}}" data-variation="inverted tiny" data-position="right center">&nbsp;</span>
<a class="file" href="#diff-{{.Index}}">{{.Name}}</a>
</li>
{{end}}
@@ -71,18 +71,18 @@
{{if $.IsSplitStyle}}
{{range $j, $section := .Sections}}
{{range $k, $line := .Lines}}
<tr class="{{DiffLineTypeToStr .Type}}-code nl-{{$k}} ol-{{$k}}">
<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 class="wrap">{{if $line.LeftIdx}}{{$line.Content}}{{end}}</pre>
<pre class="wrap">{{if $line.LeftIdx}}{{$line.ParsedContent}}{{end}}</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 class="wrap">{{if $line.RightIdx}}{{$line.Content}}{{end}}</pre>
<pre class="wrap">{{if $line.RightIdx}}{{$line.ParsedContent}}{{end}}</pre>
</td>
</tr>
{{end}}
@@ -90,8 +90,8 @@
{{else}}
{{range $j, $section := .Sections}}
{{range $k, $line := .Lines}}
<tr class="{{DiffLineTypeToStr .Type}}-code nl-{{$k}} ol-{{$k}}">
{{if eq .Type 4}}
<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>
@@ -104,7 +104,7 @@
</td>
{{end}}
<td class="lines-code">
<pre>{{$line.Content}}</pre>
<pre>{{$line.ParsedContent}}</pre>
</td>
</tr>
{{end}}