Merge pull request #17 from colkito/feature/addresspage_templates
Feature/addresspage templates -- Good!
This commit is contained in:
commit
b5e85d951f
|
@ -11,7 +11,7 @@ var mongoose = require('mongoose'),
|
||||||
Address = require('bitcore/Address').class(),
|
Address = require('bitcore/Address').class(),
|
||||||
networks = require('bitcore/networks'),
|
networks = require('bitcore/networks'),
|
||||||
util = require('bitcore/util/util'),
|
util = require('bitcore/util/util'),
|
||||||
bignum = require('BigNum'),
|
bignum = require('bignum'),
|
||||||
config = require('../../config/config');
|
config = require('../../config/config');
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -10,6 +10,8 @@ script(type='text/javascript', src='/lib/angular/angular.js')
|
||||||
script(type='text/javascript', src='/lib/angular-cookies/angular-cookies.js')
|
script(type='text/javascript', src='/lib/angular-cookies/angular-cookies.js')
|
||||||
script(type='text/javascript', src='/lib/angular-resource/angular-resource.js')
|
script(type='text/javascript', src='/lib/angular-resource/angular-resource.js')
|
||||||
script(type='text/javascript', src='/lib/angular-route/angular-route.js')
|
script(type='text/javascript', src='/lib/angular-route/angular-route.js')
|
||||||
|
script(type='text/javascript', src='/lib/qrcode-generator/js/qrcode.js')
|
||||||
|
script(type='text/javascript', src='/lib/angular-qrcode/qrcode.js')
|
||||||
|
|
||||||
//Angular UI
|
//Angular UI
|
||||||
script(type='text/javascript', src='/lib/angular-bootstrap/ui-bootstrap.js')
|
script(type='text/javascript', src='/lib/angular-bootstrap/ui-bootstrap.js')
|
||||||
|
@ -33,4 +35,5 @@ script(type='text/javascript', src='/js/controllers/index.js')
|
||||||
script(type='text/javascript', src='/js/controllers/header.js')
|
script(type='text/javascript', src='/js/controllers/header.js')
|
||||||
script(type='text/javascript', src='/js/controllers/blocks.js')
|
script(type='text/javascript', src='/js/controllers/blocks.js')
|
||||||
script(type='text/javascript', src='/js/controllers/transactions.js')
|
script(type='text/javascript', src='/js/controllers/transactions.js')
|
||||||
|
script(type='text/javascript', src='/js/controllers/address.js')
|
||||||
script(type='text/javascript', src='/js/init.js')
|
script(type='text/javascript', src='/js/init.js')
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
"angular-route": "latest",
|
"angular-route": "latest",
|
||||||
"bootstrap": "3.0.3",
|
"bootstrap": "3.0.3",
|
||||||
"angular-bootstrap": "0.9.0",
|
"angular-bootstrap": "0.9.0",
|
||||||
"angular-ui-utils": "0.1.0"
|
"angular-ui-utils": "0.1.0",
|
||||||
|
"angular-qrcode": "latest"
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,8 +1,9 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
angular.module('mystery', ['ngCookies', 'ngResource', 'ngRoute', 'ui.bootstrap', 'ui.route', 'mystery.system', 'mystery.index', 'mystery.blocks', 'mystery.transactions']);
|
angular.module('mystery', ['ngCookies', 'ngResource', 'ngRoute', 'ui.bootstrap', 'ui.route', 'mystery.system', 'mystery.index', 'mystery.blocks', 'mystery.transactions', 'monospaced.qrcode', 'mystery.address']);
|
||||||
|
|
||||||
angular.module('mystery.system', []);
|
angular.module('mystery.system', []);
|
||||||
angular.module('mystery.index', []);
|
angular.module('mystery.index', []);
|
||||||
angular.module('mystery.blocks', []);
|
angular.module('mystery.blocks', []);
|
||||||
angular.module('mystery.transactions', []);
|
angular.module('mystery.transactions', []);
|
||||||
|
angular.module('mystery.address', []);
|
||||||
|
|
|
@ -19,6 +19,9 @@ angular.module('mystery').config(['$routeProvider',
|
||||||
when('/blocks-date/:blockDate', {
|
when('/blocks-date/:blockDate', {
|
||||||
templateUrl: 'views/blocks/list.html'
|
templateUrl: 'views/blocks/list.html'
|
||||||
}).
|
}).
|
||||||
|
when('/address/:address', {
|
||||||
|
templateUrl: 'views/address.html'
|
||||||
|
}).
|
||||||
otherwise({
|
otherwise({
|
||||||
redirectTo: '/'
|
redirectTo: '/'
|
||||||
});
|
});
|
||||||
|
|
|
@ -0,0 +1,20 @@
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
angular.module('mystery.address').controller('AddressController', ['$scope', function ($scope) {
|
||||||
|
|
||||||
|
//example data
|
||||||
|
$scope.address = '1JmTTDcksW7A6GN7JnxuXkMAXsVN9zmgm1';
|
||||||
|
$scope.hash160 = '77ad7d08aaa9cf489ea4e468eaeb892b85f71e27';
|
||||||
|
$scope.transactions = [
|
||||||
|
{
|
||||||
|
hash: '49a1d01759690476dbeec4a8efd969c09c6d4269ea2d88f4d9d4f098f021413c',
|
||||||
|
time: 1234123445,
|
||||||
|
amount: 0.3
|
||||||
|
},
|
||||||
|
{
|
||||||
|
hash: 'cce948b422a4d485900fb82e64458720eb89f545af3f07ddf7d18660f9f881e9',
|
||||||
|
time: 1234123445,
|
||||||
|
amount: 0.1
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}]);
|
|
@ -0,0 +1,60 @@
|
||||||
|
<section data-ng-controller="AddressController">
|
||||||
|
<div class="page-header">
|
||||||
|
<h1>
|
||||||
|
Address
|
||||||
|
<small>{{address}}</small>
|
||||||
|
</h1>
|
||||||
|
</div>
|
||||||
|
<div class="col-lg-9">
|
||||||
|
<table class="table table-striped">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td>Address</td>
|
||||||
|
<td><a href="#!/address/{{address}}">{{address}}</a></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Hash160</td>
|
||||||
|
<td><a href="#!/address/{{hash160}}">{{hash160}}</a></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Total Output</td>
|
||||||
|
<td>1 BTC</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Total Input</td>
|
||||||
|
<td>0.2 BTC</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Current balance</td>
|
||||||
|
<td>10.2 BTC</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<div class="col-lg-3">
|
||||||
|
<qrcode size="200" data="{{address}}"></qrcode>
|
||||||
|
</div>
|
||||||
|
<div class="col-lg-12">
|
||||||
|
<h3>
|
||||||
|
Transactions
|
||||||
|
<small>transactions this address relates to</small>
|
||||||
|
</h3>
|
||||||
|
|
||||||
|
<table class="table table-striped">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Transaction Hash</th>
|
||||||
|
<th>Datetime</th>
|
||||||
|
<th>Transacted amount</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr data-ng-repeat="transaction in transactions">
|
||||||
|
<td><a href="#!/tx/{{transaction.hash}}">{{transaction.hash}}</a></td>
|
||||||
|
<td>{{transaction.time | date:'medium'}}</td>
|
||||||
|
<td>{{transaction.amount}} BTC</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</section>
|
|
@ -19,7 +19,7 @@
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr data-ng-repeat="block in blocks">
|
<tr data-ng-repeat="block in blocks">
|
||||||
<td><a href="#!/block/{{block.hash}}">{{block.hash}}</a></td>
|
<td><a href="#!/block/{{block.hash}}">{{block.hash}}</a></td>
|
||||||
<td>{{block.time}}</td>
|
<td>{{block.time * 1000 | date:'medium'}}</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
Loading…
Reference in New Issue