From 06d293a84e73dfbd871c9fa6325cd352e016466c Mon Sep 17 00:00:00 2001 From: Angus Gibson <angus.gibson@anu.edu.au> Date: Wed, 9 Dec 2015 14:36:39 +1100 Subject: Only show comparison link for >2 commits #1110 We can look at the PushCommits object to see how many commits were included in a commit, and add some template logic to only show the comparison link when there are at least 2 commits in a push. We also correct the link to display the number of commits. --- templates/user/dashboard/feeds.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'templates') diff --git a/templates/user/dashboard/feeds.tmpl b/templates/user/dashboard/feeds.tmpl index e45fb4cfea..1f4e7d0aad 100644 --- a/templates/user/dashboard/feeds.tmpl +++ b/templates/user/dashboard/feeds.tmpl @@ -43,7 +43,7 @@ <li><img class="img-8" src="{{$push.AvatarLink .AuthorEmail}}"> <a href="{{$repoLink}}/commit/{{.Sha1}}">{{ShortSha .Sha1}}</a> <span class="text truncate light grey">{{.Message}}</span></li> {{end}} {{end}} - {{if $push.CompareUrl}}<li><a href="{{AppSubUrl}}/{{$push.CompareUrl}}">{{$.i18n.Tr "action.compare_2_commits"}} »</a></li>{{end}} + {{if and (gt $push.Len 1) $push.CompareUrl}}<li><a href="{{AppSubUrl}}/{{$push.CompareUrl}}">{{$.i18n.Tr "action.compare_commits" $push.Len}} »</a></li>{{end}} </ul> </div> {{else if eq .GetOpType 6}} -- cgit v1.2.3