From 8fa6d0d302f487552800ca0d8d60da19b8f99387 Mon Sep 17 00:00:00 2001 From: Unknwon Date: Fri, 10 Mar 2017 16:58:41 -0500 Subject: repo/pull: handle head repository of merged pull requests deleted --- templates/repo/commits_table.tmpl | 7 ++++++- templates/repo/diff/box.tmpl | 2 +- templates/repo/release/list.tmpl | 4 ++-- 3 files changed, 9 insertions(+), 4 deletions(-) (limited to 'templates/repo') diff --git a/templates/repo/commits_table.tmpl b/templates/repo/commits_table.tmpl index 1b26572b..a95cb824 100644 --- a/templates/repo/commits_table.tmpl +++ b/templates/repo/commits_table.tmpl @@ -41,7 +41,12 @@ - {{ShortSha .ID.String}} + {{/* Username or Reponame doesn't present we assume the source repository no longer exists */}} + {{if not (and $.Username $.Reponame)}} + {{ShortSha .ID.String}} + {{else}} + {{ShortSha .ID.String}} + {{end}} {{RenderCommitMessage false .Summary $.RepoLink $.Repository.ComposeMetas}} {{TimeSince .Author.When $.Lang}} diff --git a/templates/repo/diff/box.tmpl b/templates/repo/diff/box.tmpl index 96fdc28b..89e46e80 100644 --- a/templates/repo/diff/box.tmpl +++ b/templates/repo/diff/box.tmpl @@ -71,7 +71,7 @@
{{if $file.IsDeleted}} {{$.i18n.Tr "repo.diff.view_file"}} - {{else}} + {{else if $.SourcePath}} {{/* No SourcePath we assume the source repository no longer exists */}} {{$.i18n.Tr "repo.diff.view_file"}} {{end}}
diff --git a/templates/repo/release/list.tmpl b/templates/repo/release/list.tmpl index 284035d1..f72dfe77 100644 --- a/templates/repo/release/list.tmpl +++ b/templates/repo/release/list.tmpl @@ -64,8 +64,8 @@ {{.TagName}}
- ZIP - TAR.GZ + ZIP + TAR.GZ
{{end}}   -- cgit v1.2.3