diff options
author | Unknwon <u@gogs.io> | 2016-08-28 04:31:42 -0700 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2016-08-28 04:31:42 -0700 |
commit | ba27d71abea437af2f0612a8960eea651ec2df59 (patch) | |
tree | 2e0d34def64d5eb4c91aebf5e9b6a8003138193b /templates/repo/diff/section_unified.tmpl | |
parent | 7115e3a4d578ec024f9acbc043e38326bff4117e (diff) | |
download | gitea-ba27d71abea437af2f0612a8960eea651ec2df59.tar.gz gitea-ba27d71abea437af2f0612a8960eea651ec2df59.zip |
Web editor: improve edit file
Diffstat (limited to 'templates/repo/diff/section_unified.tmpl')
-rw-r--r-- | templates/repo/diff/section_unified.tmpl | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/templates/repo/diff/section_unified.tmpl b/templates/repo/diff/section_unified.tmpl new file mode 100644 index 0000000000..ee66b6dc9a --- /dev/null +++ b/templates/repo/diff/section_unified.tmpl @@ -0,0 +1,23 @@ +{{$file := .}} +{{$highlightClass := $file.GetHighlightClass}} +{{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}} +{{end}}
\ No newline at end of file |