Skip to content

Commit 0a3ba72

Browse files
committed
Merge pull request angular-ui#1394 from pcbulai/website
fixed latest commit section from footer
2 parents c2536ce + 9fd6b2a commit 0a3ba72

File tree

3 files changed

+21
-12
lines changed

3 files changed

+21
-12
lines changed

app/scripts/controllers/footer.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22

33
angular.module('angularGoogleMapsApp').controller('FooterCtrl', [
44
'$scope', '$log', '$q', '$github',
5-
function ($scope, $log, $q, $github) {
5+
function($scope, $log, $q, $github) {
66

77
var githubCalled = false;
88

99
if (!githubCalled) {
1010
// GitHub api calls
1111
$q.all([$github.getAllCommits(), $github.getContributors(), $github.getIssues(), $github.getEvents()])
12-
.then(function (results) {
12+
.then(function(results) {
1313

1414
var commits = results[0],
1515
contributors = results[1],
@@ -20,7 +20,7 @@ angular.module('angularGoogleMapsApp').controller('FooterCtrl', [
2020
github: {
2121
branch: $github.getBranch(),
2222
commits: {
23-
latest: commits.length ? commits[0] : {},
23+
latest: commits.length ? commits[commits.length - 1] : null,
2424
all: commits
2525
},
2626
issuesCount: issues.length,
@@ -29,7 +29,7 @@ angular.module('angularGoogleMapsApp').controller('FooterCtrl', [
2929
events: events
3030
}
3131
});
32-
}, function (err) {
32+
}, function(err) {
3333
$log.error(err);
3434
$scope.github = null;
3535
});
@@ -41,7 +41,7 @@ angular.module('angularGoogleMapsApp').controller('FooterCtrl', [
4141
return '<a href="' + actor.url + '" rel="external">' + actor.login + '</a>';
4242
}
4343

44-
$scope.eventLabel = function (event) {
44+
$scope.eventLabel = function(event) {
4545

4646
var pl = event.payload;
4747

@@ -88,4 +88,5 @@ angular.module('angularGoogleMapsApp').controller('FooterCtrl', [
8888

8989
return "TODO (" + event.type + ")";
9090
};
91-
}]);
91+
}
92+
]);

app/styles/main.css

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,10 @@ footer li.thumbnail img {
106106

107107
}
108108

109+
footer blockquote{
110+
font-size: 1.25em;
111+
}
112+
109113
footer li.thumbnail {
110114
margin-right: 5px;
111115
margin-bottom: 0;
@@ -166,7 +170,7 @@ article {
166170
h2 {
167171
border-bottom: 1px solid #ecf0f1;
168172
padding-bottom: 4px;
169-
/* font-weight: 900;*/
173+
/* font-weight: 900;*/
170174
}
171175

172176
h2:not(:first-child) {

app/views/footer.html

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,16 @@ <h3>Activity <small class="pull-right"><a href="https://github.com/angular-ui/an
4040

4141
<div class="col-md-2">
4242
<h3>Latest commit</h3>
43+
<div ng-if="github.commits.latest !== null">
44+
<p>{{ github.commits.latest.commit.committer.date | date:"MMM d, y hh:mm" }}<br>
45+
by <a href="#!/">{{ github.commits.latest.author.login }}</a></p>
4346

44-
<p>{{ github.commits.latest.commit.committer.date | date:"MMM d, y hh:mm" }}<br>
45-
by <a href="#!/">{{ github.commits.latest.author.login }}</a></p>
46-
47-
<blockquote class="muted"><i>{{ github.commits.latest.commit.message }}</i></blockquote>
48-
<a class="btn btn-sm btn-default" href="{{ github.commits.latest.html_url }}">More details</a>
47+
<blockquote class="muted"><i>{{ github.commits.latest.commit.message }}</i></blockquote>
48+
<a class="btn btn-sm btn-default" href="{{ github.commits.latest.html_url }}">More details</a>
49+
</div>
50+
<div ng-if="github.commits.latest === null">
51+
No data to display
52+
</div>
4953
</div>
5054
</div>
5155
</div>

0 commit comments

Comments
 (0)