Add relative timestamps to PR and Issue refresh info (#41)

This commit is contained in:
Justin Potts 2016-06-14 05:13:01 -07:00 коммит произвёл Dave Hunt
Родитель 18f04e789f
Коммит a405b43ab4
4 изменённых файлов: 6 добавлений и 4 удалений

Просмотреть файл

@ -76,5 +76,7 @@
<script src="js/vendor/bootstrap.min.js"></script>
<script src="js/aggregator.js"></script>
<script src="js/main.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.9.0/moment.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular-moment/0.9.0/angular-moment.min.js"></script>
</body>
</html>

Просмотреть файл

@ -1,4 +1,4 @@
var dashboardApp = angular.module('dashboardApp', []);
var dashboardApp = angular.module('dashboardApp', ['angularMoment']);
$(function () {
$("ul.nav li").click(function () {
@ -52,7 +52,7 @@ dashboardApp.controller('IssuesController', function ($scope, $http, filterFilte
aggregator.processIssues(function (data) {
$scope.issues = data.issues;
$scope.last_updated = data.last_updated;
$scope.last_updated = new Date(data.last_updated);
// watch labels for changes
$scope.$watch('labels|filter:{selected:true}', function (nv) {

Просмотреть файл

@ -26,7 +26,7 @@
</div>
</div>
</div>
<div>Issues last refreshed from GitHub on {{last_updated}}.</div>
<div><i class="fa fa-clock-o"></i>&nbsp;Updated <span am-time-ago="last_updated"></span></div>
<div class="test-result" ng-repeat="repo in issues">
<h3 ng-click="toggleRepo(repo)" id="{{repo.repo}}" class="repo-title">
<span ng-if="repo.show">

Просмотреть файл

@ -1,7 +1,7 @@
<div class="row" xmlns="http://www.w3.org/1999/html">
<div class="span12">
<div id="dashboard" ng-init="init()">
<div>Pull Requests last refreshed from Github on {{last_updated}}.</div>
<div><i class="fa fa-clock-o"></i>&nbsp;Updated <span am-time-ago="last_updated"></span></div>
<div class="test-result" ng-repeat="repo in issues">
<h3 ng-click="toggleRepo(repo)" id="{{repo.repo}}" class="repo-title">
<span ng-if="repo.show">