diff options
author | Lauris BH <lauris@nix.lv> | 2017-10-26 10:45:14 +0300 |
---|---|---|
committer | Lunny Xiao <xiaolunwen@gmail.com> | 2017-10-26 15:45:14 +0800 |
commit | 6a107e57f6ded230b9e9f6861ac2101a34f260b1 (patch) | |
tree | 5536ed9ec4b0a847f3a0caa8a906c19cc9f7c983 /templates | |
parent | bc8411098979da5599d314e982da2985e0bb29c2 (diff) | |
download | gitea-6a107e57f6ded230b9e9f6861ac2101a34f260b1.tar.gz gitea-6a107e57f6ded230b9e9f6861ac2101a34f260b1.zip |
Add checks for commits with missing author and time (#2771)
* Add checks for commits with missing author and time
* Fix validate commits with emails if it has no Author
Diffstat (limited to 'templates')
-rw-r--r-- | templates/repo/view_list.tmpl | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/templates/repo/view_list.tmpl b/templates/repo/view_list.tmpl index 67164753e9..7be2183fa8 100644 --- a/templates/repo/view_list.tmpl +++ b/templates/repo/view_list.tmpl @@ -4,14 +4,16 @@ <th class="four wide"> {{if .LatestCommitUser}} <img class="ui avatar image img-12" src="{{.LatestCommitUser.RelAvatarLink}}" /> - {{if .LatestCommitUser.FullName}} - <a href="{{AppSubUrl}}/{{.LatestCommitUser.Name}}"><strong>{{.LatestCommitUser.FullName}}</strong></a> - {{else}} - <a href="{{AppSubUrl}}/{{.LatestCommitUser.Name}}"><strong>{{.LatestCommit.Author.Name}}</strong></a> - {{end}} + {{if .LatestCommitUser.FullName}} + <a href="{{AppSubUrl}}/{{.LatestCommitUser.Name}}"><strong>{{.LatestCommitUser.FullName}}</strong></a> + {{else}} + <a href="{{AppSubUrl}}/{{.LatestCommitUser.Name}}"><strong>{{if .LatestCommit.Author}}{{.LatestCommit.Author.Name}}{{else}}{{.LatestCommitUser.Name}}{{end}}</strong></a> + {{end}} {{else}} - <img class="ui avatar image img-12" src="{{AvatarLink .LatestCommit.Author.Email}}" /> - <strong>{{.LatestCommit.Author.Name}}</strong> + {{if .LatestCommit.Author}} + <img class="ui avatar image img-12" src="{{AvatarLink .LatestCommit.Author.Email}}" /> + <strong>{{.LatestCommit.Author.Name}}</strong> + {{end}} {{end}} <a rel="nofollow" class="ui sha label {{if .LatestCommit.Signature}} isSigned {{if .LatestCommitVerification.Verified }} isVerified {{end}}{{end}}" href="{{.RepoLink}}/commit/{{.LatestCommit.ID}}"> {{ShortSha .LatestCommit.ID.String}} @@ -30,7 +32,7 @@ </th> <th class="nine wide"> </th> - <th class="three wide text grey right age">{{TimeSince .LatestCommit.Author.When $.Lang}}</th> + <th class="three wide text grey right age">{{if .LatestCommit.Author}}{{TimeSince .LatestCommit.Author.When $.Lang}}{{end}}</th> </tr> </thead> <tbody> |