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);
|
||||
};
|
||||
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
|
|
|
@ -14,8 +14,6 @@ module.exports = function(app) {
|
|||
app.get('/api/block/:blockHash', blocks.show);
|
||||
app.param('blockHash', blocks.block);
|
||||
|
||||
app.get('/last_blocks', blocks.last_blocks);
|
||||
|
||||
var transactions = require('../app/controllers/transactions');
|
||||
app.get('/api/tx/:txid', transactions.show);
|
||||
|
||||
|
|
|
@ -2,9 +2,5 @@
|
|||
|
||||
angular.module('mystery.system').controller('IndexController', ['$scope', 'Global', 'Index', function ($scope, Global, Index) {
|
||||
$scope.global = Global;
|
||||
$scope.last_blocks = function() {
|
||||
Index.query(function(blocks) {
|
||||
$scope.blocks = blocks;
|
||||
});
|
||||
};
|
||||
$scope.index = Index;
|
||||
}]);
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
'use strict';
|
||||
|
||||
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()">
|
||||
<div class="page-header">
|
||||
<h1>Hello BitPay!</h1>
|
||||
<div class="jumbotron">
|
||||
<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>
|
||||
<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>
|
||||
|
||||
|
|
Loading…
Reference in New Issue