diff --git a/public/commits-widget/javascripts/commits-widget.js b/public/commits-widget/javascripts/commits-widget.js index 9964328b1..80d55c570 100644 --- a/public/commits-widget/javascripts/commits-widget.js +++ b/public/commits-widget/javascripts/commits-widget.js @@ -39,11 +39,23 @@ $(function(){ var data = response.data; $.each(data, function(i, commit){ var $li = $('
  • ').appendTo( $commitsList ); - $('
    ').appendTo( $li ); - $right = $('
    ').appendTo( $li ); - $('' + commit.commit.message + '
    ').appendTo( $right ); - $('by ' + commit.committer.login + ' - ' + $.timeago(commit.commit.committer.date) + '').appendTo( $right ); - $('
    ').appendTo( $li ); + if( commit.sha && commit.commit && commit.commit.message && commit.commit.author && commit.commit.committer && commit.commit.committer.date ) { + if( commit.author && commit.author.gravatar_id ) { + $('
    ').appendTo( $li ); + } else { + $('
    ').appendTo( $li ); + } + $right = $('
    ').appendTo( $li ); + $('' + commit.commit.message + '
    ').appendTo( $right ); + $('by ' + commit.commit.author.name + ' - ' + $.timeago(commit.commit.committer.date) + '').appendTo( $right ); + $('
    ').appendTo( $li ); + } else { + // Render nothing. Or render a message: + // $('
     
    ').appendTo( $li ); + // $right = $('
    ').appendTo( $li ); + // $('this commit cannot be rendered').appendTo( $right ); + // $('
    ').appendTo( $li ); + } }); } });