From 00a864e693434bce687f3f5145d8369583197b78 Mon Sep 17 00:00:00 2001 From: Christopher Brickley Date: Tue, 26 Aug 2014 08:20:18 -0400 Subject: add commit compare functionality --- templates/repo/commits.tmpl | 43 +-------------------------------------- templates/repo/commits_table.tmpl | 42 ++++++++++++++++++++++++++++++++++++++ templates/repo/diff.tmpl | 15 ++++++++++++-- 3 files changed, 56 insertions(+), 44 deletions(-) create mode 100644 templates/repo/commits_table.tmpl (limited to 'templates') diff --git a/templates/repo/commits.tmpl b/templates/repo/commits.tmpl index 420e973a..e7518e98 100644 --- a/templates/repo/commits.tmpl +++ b/templates/repo/commits.tmpl @@ -3,47 +3,6 @@ {{template "repo/nav" .}} {{template "repo/toolbar" .}}
-
-
-
- -

{{.CommitCount}} Commits

-
- - - - - - - - - - - {{ $username := .Username}} - {{ $reponame := .Reponame}} - {{$r := List .Commits}} - {{range $r}} - - - - - - - {{end}} - - -
- {{if not .IsSearchPage}}{{end}} -
+ {{template "repo/commits_table" .}}
{{template "base/footer" .}} diff --git a/templates/repo/commits_table.tmpl b/templates/repo/commits_table.tmpl new file mode 100644 index 00000000..4612398a --- /dev/null +++ b/templates/repo/commits_table.tmpl @@ -0,0 +1,42 @@ +
+
+
+ +

{{.CommitCount}} Commits

+
+ + + + + + + + + + + {{ $username := .Username}} + {{ $reponame := .Reponame}} + {{$r := List .Commits}} + {{range $r}} + + + + + + + {{end}} + + +
+ {{if not .IsSearchPage}}{{end}} +
diff --git a/templates/repo/diff.tmpl b/templates/repo/diff.tmpl index 6adea045..78733450 100644 --- a/templates/repo/diff.tmpl +++ b/templates/repo/diff.tmpl @@ -3,7 +3,18 @@ {{template "repo/nav" .}}
+ {{if .IsDiffCompare }}
+ +
+ {{template "repo/commits_table" .}} +
+
+ {{else}} +
Browse Source

{{.Commit.Message}}

@@ -22,9 +33,9 @@ {{.Commit.Author.Name}} {{TimeSince .Commit.Author.When $.Lang}}

-
+
- + {{end}} {{if .DiffNotAvailable}}

Diff Data Not Available.

{{else}} -- cgit v1.2.3