Cleaning homepage for now. It does not get any values from API, only shows a link to blocks list.
This commit is contained in:
parent
9c7239e740
commit
67857abcc7
|
@ -29,21 +29,6 @@ exports.show = function(req, res) {
|
||||||
res.jsonp(req.block);
|
res.jsonp(req.block);
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
|
||||||
* List of blocks at HomePage
|
|
||||||
*/
|
|
||||||
exports.last_blocks = function(req, res) {
|
|
||||||
Block.find().sort({time:-1}).limit(7).exec(function(err, blocks) {
|
|
||||||
if (err) {
|
|
||||||
res.render('error', {
|
|
||||||
status: 500
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
res.jsonp(blocks);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* List of blocks by date
|
* List of blocks by date
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -14,8 +14,6 @@ module.exports = function(app) {
|
||||||
app.get('/api/block/:blockHash', blocks.show);
|
app.get('/api/block/:blockHash', blocks.show);
|
||||||
app.param('blockHash', blocks.block);
|
app.param('blockHash', blocks.block);
|
||||||
|
|
||||||
app.get('/last_blocks', blocks.last_blocks);
|
|
||||||
|
|
||||||
var transactions = require('../app/controllers/transactions');
|
var transactions = require('../app/controllers/transactions');
|
||||||
app.get('/api/tx/:txid', transactions.show);
|
app.get('/api/tx/:txid', transactions.show);
|
||||||
|
|
||||||
|
|
|
@ -2,9 +2,5 @@
|
||||||
|
|
||||||
angular.module('mystery.system').controller('IndexController', ['$scope', 'Global', 'Index', function ($scope, Global, Index) {
|
angular.module('mystery.system').controller('IndexController', ['$scope', 'Global', 'Index', function ($scope, Global, Index) {
|
||||||
$scope.global = Global;
|
$scope.global = Global;
|
||||||
$scope.last_blocks = function() {
|
$scope.index = Index;
|
||||||
Index.query(function(blocks) {
|
|
||||||
$scope.blocks = blocks;
|
|
||||||
});
|
|
||||||
};
|
|
||||||
}]);
|
}]);
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
angular.module('mystery.index').factory('Index', ['$resource', function($resource) {
|
angular.module('mystery.index').factory('Index', ['$resource', function($resource) {
|
||||||
return $resource('/last_blocks');
|
return $resource;
|
||||||
}]);
|
}]);
|
||||||
|
|
|
@ -1,17 +1,8 @@
|
||||||
<section data-ng-controller="IndexController" data-ng-init="last_blocks()">
|
<section data-ng-controller="IndexController" data-ng-init="last_blocks()">
|
||||||
<div class="page-header">
|
<div class="jumbotron">
|
||||||
<h1>Hello BitPay!</h1>
|
<h1>Hello, BitPay!</h1>
|
||||||
|
<p>Start here for blocks information</p>
|
||||||
|
<p><a href="/#!/blocks" class="btn btn-primary btn-lg">List all blocks</a></p>
|
||||||
</div>
|
</div>
|
||||||
<table class="table table-striped">
|
|
||||||
<thead>
|
|
||||||
<th>Hash</th>
|
|
||||||
<th>Time</th>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
<tr data-ng-repeat="block in blocks">
|
|
||||||
<td><a href="#!/block/{{block.hash}}">{{block.hash}}</a></td>
|
|
||||||
<td>{{block.time | date:'short'}}</td>
|
|
||||||
</tr>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue