aboutsummaryrefslogtreecommitdiff
path: root/templates/repo
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2017-03-10 16:58:41 -0500
committerUnknwon <u@gogs.io>2017-03-10 16:58:41 -0500
commit8fa6d0d302f487552800ca0d8d60da19b8f99387 (patch)
tree69abff9584dd42d2970a89e4abdb19b9a009107c /templates/repo
parenta534f9f9b66c63aa08ba61587c3d19a9e952a491 (diff)
repo/pull: handle head repository of merged pull requests deleted
Diffstat (limited to 'templates/repo')
-rw-r--r--templates/repo/commits_table.tmpl7
-rw-r--r--templates/repo/diff/box.tmpl2
-rw-r--r--templates/repo/release/list.tmpl4
3 files changed, 9 insertions, 4 deletions
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 @@
</td>
<td class="message collapsing has-emoji">
- <a rel="nofollow" class="ui sha label" href="{{AppSubUrl}}/{{$.Username}}/{{$.Reponame}}/commit/{{.ID}}">{{ShortSha .ID.String}}</a>
+ {{/* Username or Reponame doesn't present we assume the source repository no longer exists */}}
+ {{if not (and $.Username $.Reponame)}}
+ <span class="ui sha label">{{ShortSha .ID.String}}</span>
+ {{else}}
+ <a rel="nofollow" class="ui sha label" href="{{AppSubUrl}}/{{$.Username}}/{{$.Reponame}}/commit/{{.ID}}">{{ShortSha .ID.String}}</a>
+ {{end}}
<span {{if gt .ParentCount 1}}class="grey text"{{end}}>{{RenderCommitMessage false .Summary $.RepoLink $.Repository.ComposeMetas}}</span>
</td>
<td class="grey text right aligned">{{TimeSince .Author.When $.Lang}}</td>
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 @@
<div class="ui right">
{{if $file.IsDeleted}}
<a class="ui basic grey tiny button" rel="nofollow" href="{{EscapePound $.BeforeSourcePath}}/{{EscapePound .Name}}">{{$.i18n.Tr "repo.diff.view_file"}}</a>
- {{else}}
+ {{else if $.SourcePath}} {{/* No SourcePath we assume the source repository no longer exists */}}
<a class="ui basic grey tiny button" rel="nofollow" href="{{EscapePound $.SourcePath}}/{{EscapePound .Name}}">{{$.i18n.Tr "repo.diff.view_file"}}</a>
{{end}}
</div>
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 @@
<a href="{{$.RepoLink}}/src/{{.TagName}}" rel="nofollow"><i class="tag icon"></i> {{.TagName}}</a>
</h4>
<div class="download">
- <a href="{{$.RepoLink}}/archive/{{.TagName}}.zip" rel="nofollow"><i class="octicon octicon-file-zip"></i> ZIP</a>
- <a href="{{$.RepoLink}}/archive/{{.TagName}}.tar.gz"><i class="octicon octicon-file-zip"></i> TAR.GZ</a>
+ <a href="{{$.RepoLink}}/archive/{{.TagName}}.zip" rel="nofollow"><i class="octicon octicon-file-zip"></i>ZIP</a>
+ <a href="{{$.RepoLink}}/archive/{{.TagName}}.tar.gz"><i class="octicon octicon-file-zip"></i>TAR.GZ</a>
</div>
{{end}}
<span class="dot">&nbsp;</span>