From 780cc2d11093e048e41f2d6da9d76f6c6ac4a5e2 Mon Sep 17 00:00:00 2001 From: Unknwon Date: Tue, 30 Aug 2016 02:08:38 -0700 Subject: router/repo: code refactoring --- templates/.VERSION | 2 +- templates/repo/home.tmpl | 6 +++--- templates/repo/view_file.tmpl | 12 ++++++------ templates/repo/view_list.tmpl | 16 ++++++++-------- 4 files changed, 18 insertions(+), 18 deletions(-) (limited to 'templates') diff --git a/templates/.VERSION b/templates/.VERSION index 8e1e3e9848..bbf71e4218 100644 --- a/templates/.VERSION +++ b/templates/.VERSION @@ -1 +1 @@ -0.9.94.0829 \ No newline at end of file +0.9.94.0830 \ No newline at end of file diff --git a/templates/repo/home.tmpl b/templates/repo/home.tmpl index 7ef75277e6..2b8c7e06e0 100644 --- a/templates/repo/home.tmpl +++ b/templates/repo/home.tmpl @@ -19,9 +19,9 @@
- {{if .IsFile}} + {{if .IsViewFile}} {{template "repo/view_file" .}} {{else}} {{template "repo/view_list" .}} diff --git a/templates/repo/view_file.tmpl b/templates/repo/view_file.tmpl index d0b793b0e7..68e8444768 100644 --- a/templates/repo/view_file.tmpl +++ b/templates/repo/view_file.tmpl @@ -18,7 +18,7 @@ {{.i18n.Tr "repo.file_permalink"}} {{end}} {{.i18n.Tr "repo.file_history"}} - {{.i18n.Tr "repo.file_raw"}} + {{.i18n.Tr "repo.file_raw"}} {{if .Repository.CanEnableEditor}} {{if .CanEditFile}} @@ -36,17 +36,17 @@ {{end}}
-
+
{{if .IsMarkdown}} {{if .FileContent}}{{.FileContent | Str2html}}{{end}} - {{else if not .IsFileText}} + {{else if not .IsTextFile}}
{{if .IsImageFile}} - + {{else if .IsPDFFile}} - + {{else}} - {{.i18n.Tr "repo.file_view_raw"}} + {{.i18n.Tr "repo.file_view_raw"}} {{end}}
{{else if .FileSize}} diff --git a/templates/repo/view_list.tmpl b/templates/repo/view_list.tmpl index a92123b865..19a18c1ca4 100644 --- a/templates/repo/view_list.tmpl +++ b/templates/repo/view_list.tmpl @@ -2,19 +2,19 @@ - {{if .LastCommitUser}} - - {{.LastCommit.Author.Name}} + {{if .LatestCommitUser}} + + {{.LatestCommit.Author.Name}} {{else}} - - {{.LastCommit.Author.Name}} + + {{.LatestCommit.Author.Name}} {{end}} - {{ShortSha .LastCommit.ID.String}} - {{RenderCommitMessage false .LastCommit.Summary .RepoLink $.Repository.ComposeMetas}} + {{ShortSha .LatestCommit.ID.String}} + {{RenderCommitMessage false .LatestCommit.Summary .RepoLink $.Repository.ComposeMetas}} - {{TimeSince .LastCommit.Author.When $.Lang}} + {{TimeSince .LatestCommit.Author.When $.Lang}} -- cgit v1.2.3