From ba27d71abea437af2f0612a8960eea651ec2df59 Mon Sep 17 00:00:00 2001 From: Unknwon Date: Sun, 28 Aug 2016 04:31:42 -0700 Subject: Web editor: improve edit file --- templates/repo/editor/diff_preview.tmpl | 25 +++---------------------- templates/repo/editor/diff_preview_new.tmpl | 12 ------------ templates/repo/editor/edit.tmpl | 15 +++++++-------- 3 files changed, 10 insertions(+), 42 deletions(-) delete mode 100644 templates/repo/editor/diff_preview_new.tmpl (limited to 'templates/repo/editor') 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}} -
+
- {{range $j, $section := .File.Sections}} - {{range $k, $line := $section.Lines}} - - {{if eq .GetType 4}} - - {{else}} - - - {{end}} - - - {{end}} + {{with .File}} + {{template "repo/diff/section_unified" .}} {{end}}
- {{/* {{if gt $j 0}}{{end}} */}} - - {{if $line.LeftIdx}}{{$line.LeftIdx}}{{end}} - - {{if $line.RightIdx}}{{$line.RightIdx}}{{end}} - -
{{$section.GetComputedInlineDiffFor $line}}
-
diff --git a/templates/repo/editor/diff_preview_new.tmpl b/templates/repo/editor/diff_preview_new.tmpl deleted file mode 100644 index 34abfe18..00000000 --- a/templates/repo/editor/diff_preview_new.tmpl +++ /dev/null @@ -1,12 +0,0 @@ -
-
- - - - - - - -
    {{.FileContent}}
-
-
diff --git a/templates/repo/editor/edit.tmpl b/templates/repo/editor/edit.tmpl index 377c00bf..9de55c65 100644 --- a/templates/repo/editor/edit.tmpl +++ b/templates/repo/editor/edit.tmpl @@ -1,9 +1,9 @@ {{template "base/head" .}} -
+
{{template "repo/header" .}}
{{template "base/alert" .}} -
+ {{.CsrfTokenHtml}}