github.js: fix author.

When there is no github user just use commit.author.name otherwise the github login name.
This commit is contained in:
XhmikosR 2013-03-02 09:31:24 +02:00 committed by Daniel Marjamäki
parent 320cbf3f98
commit dd76d934d2
2 changed files with 3 additions and 7 deletions

View File

@ -14,13 +14,9 @@ jQuery.fn.listCommits = function(username, repository, branch) {
$(commits).each(function(i) {
var githubUrl = 'https://github.com/' + username + '/' + repository + '/commit/' + this.sha,
shortMessage = cutLines(this.commit.message),
commitAuthor = (this.author !== null) ? this.author.login : '';
commitAuthor = (this.author !== null) ? this.author.login : this.commit.author.name;
if (commitAuthor) {
list.append('<li><a href="' + githubUrl + '">' + shortMessage + '</a> <em>by <strong>' + commitAuthor + '</strong></em></li>');
} else {
list.append('<li><a href="' + githubUrl + '">' + shortMessage + '</a></li>');
}
list.append('<li><a href="' + githubUrl + '">' + shortMessage + '</a> <em>by <strong>' + commitAuthor + '</strong></em></li>');
if (i === 9) {
return false;

File diff suppressed because one or more lines are too long