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:
parent
320cbf3f98
commit
dd76d934d2
|
@ -14,13 +14,9 @@ jQuery.fn.listCommits = function(username, repository, branch) {
|
||||||
$(commits).each(function(i) {
|
$(commits).each(function(i) {
|
||||||
var githubUrl = 'https://github.com/' + username + '/' + repository + '/commit/' + this.sha,
|
var githubUrl = 'https://github.com/' + username + '/' + repository + '/commit/' + this.sha,
|
||||||
shortMessage = cutLines(this.commit.message),
|
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>');
|
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>');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (i === 9) {
|
if (i === 9) {
|
||||||
return false;
|
return false;
|
||||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue