From cd89f6c5021ef129ecc4652aa620a3562ae30979 Mon Sep 17 00:00:00 2001 From: Unknwon Date: Sun, 14 Aug 2016 23:02:14 -0700 Subject: Web editor: improve edit file and diff preview --- templates/repo/editor/diff_preview.tmpl | 32 ++++++++++ templates/repo/editor/diff_preview_new.tmpl | 12 ++++ templates/repo/editor/edit.tmpl | 96 +++++++++++++++++++++++++++++ 3 files changed, 140 insertions(+) create mode 100644 templates/repo/editor/diff_preview.tmpl create mode 100644 templates/repo/editor/diff_preview_new.tmpl create mode 100644 templates/repo/editor/edit.tmpl (limited to 'templates/repo/editor') diff --git a/templates/repo/editor/diff_preview.tmpl b/templates/repo/editor/diff_preview.tmpl new file mode 100644 index 00000000..1c4787a3 --- /dev/null +++ b/templates/repo/editor/diff_preview.tmpl @@ -0,0 +1,32 @@ +{{$highlightClass := .File.GetHighlightClass}} +
+
+
+ + + {{range $j, $section := .File.Sections}} + {{range $k, $line := $section.Lines}} + + {{if eq .GetType 4}} + + {{else}} + + + {{end}} + + + {{end}} + {{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 new file mode 100644 index 00000000..34abfe18 --- /dev/null +++ b/templates/repo/editor/diff_preview_new.tmpl @@ -0,0 +1,12 @@ +
+
+ + + + + + + +
    {{.FileContent}}
+
+
diff --git a/templates/repo/editor/edit.tmpl b/templates/repo/editor/edit.tmpl new file mode 100644 index 00000000..5e3349ea --- /dev/null +++ b/templates/repo/editor/edit.tmpl @@ -0,0 +1,96 @@ +{{template "base/head" .}} +
+ {{template "repo/header" .}} +
+ {{template "base/alert" .}} +
+ {{.CsrfTokenHtml}} + + +
+ +
+ +
+
+ {{.i18n.Tr "repo.release.loading"}} +
+
+ {{.i18n.Tr "repo.release.loading"}} +
+
+
+ +
+

{{.i18n.Tr "repo.commit_changes"}}

+
+ '{{else}}{{.i18n.Tr "repo.update"}} '{{.TreeName}}'{{end}}" value="{{.commit_summary}}"> +
+
+ +
+
+
+
+
+ +
+
+ +
+
+
+
+
+ + + +
+
+
+
+ + {{.i18n.Tr "repo.cancel"}} +
+
+
+
+{{template "base/footer" .}} -- cgit v1.2.3