Skip to content
Snippets Groups Projects
Commit a84f2079 authored by ArnaudCerisier's avatar ArnaudCerisier
Browse files

[enh] wot identity : dowload the account statement

parent ce0d6da2
Branches
Tags
1 merge request!486[enh] wot identity : Improved rendering and adding dowload the account statement
......@@ -902,34 +902,49 @@ function WotIdentityViewController($scope, $rootScope, $controller, $timeout, UI
/**
* Identity tx view controller
*/
function WotIdentityTxViewController($q, $scope, $filter, $translate, csTx, FileSaver, gpColor, BMA, UIUtils) {
function WotIdentityTxViewController($scope, $timeout, csSettings, $controller, csTx, csWallet, BMA, UIUtils) {
'ngInject';
// Initialize the super class and extend it.
angular.extend(this, $controller('WotIdentityAbstractCtrl', {$scope: $scope}));
$scope.formData= {};
$scope.loading = true;
$scope.motion = UIUtils.motion.fadeSlideInRight;
$scope.$on('$ionicView.enter', function(e, state) {
$scope.formData = {
name:state.stateParams.name,
uid:state.stateParams.uid,
pubkey:state.stateParams.pubkey
};
$scope.pubkey= state.stateParams.pubkey;
$scope.uid= state.stateParams.uid;
// Load account TX data
csTx.load($scope.formData.pubkey)
csTx.load($scope.pubkey)
.then(function(result) {
console.log(result); // Allow to discover data structure
if (result && result.tx && result.tx.history) {
$scope.items = result.tx.history;
$scope.tx = result.tx;
$scope.history = result.tx.history;
}
$scope.balance = result.balance;
$scope.load($scope.pubkey, true, $scope.uid)
.then(function(){
$scope.motion.show();
$scope.loading = false;
});
});
});
$scope.downloadHistoryFile = function(options) {
options = options || {};
options.fromTime = options.fromTime || -1; // default: full history
csTx.downloadHistoryFile($scope.pubkey, options);
};
//TODO :
};
/**
* Certifications controller - extend WotIdentityAbstractCtrl
*/
......
......@@ -169,6 +169,8 @@ angular.module('cesium.tx.services', ['ngApi', 'cesium.bma.services',
}
// get UD history
// FIXME issue#232
/*
if (csSettings.data.showUDHistory) {
jobs.push(
BMA.ud.history({pubkey: pubkey})
......@@ -186,6 +188,7 @@ angular.module('cesium.tx.services', ['ngApi', 'cesium.bma.services',
}, []);
}));
}
*/
// Execute jobs
$q.all(jobs)
......
......@@ -8,13 +8,24 @@
<ion-content>
<!-- buttons bar -->
<div class="center padding">
<div class="buttons">
<button class="button button-balanced icon-left icon ion-archive"
ng-click="onExportButtonClick()">{{'RML9.BTN_EXPORT' | translate}}
<div class="hidden-xs hidden-sm padding text-center" ng-if="!loading">
<button class="button button-stable button-small-padding icon ion-loop ink"
ng-click="doUpdate()"
title="{{'COMMON.BTN_REFRESH' | translate}}">
</button>
<button class="button button-stable button-small-padding icon ion-android-download ink"
ng-click="downloadHistoryFile()"
title="{{'COMMON.BTN_DOWNLOAD_ACCOUNT_STATEMENT' | translate}}">
</button>
<cs-extension-point name="buttons"></cs-extension-point>
</div>
<div class="center padding" ng-if="loading">
<ion-spinner icon="android"></ion-spinner>
</div>
<div class="list {{motion.ionListClass}}" ng-if="!loading">
......@@ -26,17 +37,31 @@
<div class="col">
<!-- the balance -->
<div class="item">
<div class="item item-divider item-tx">
{{'RML9.VIEW.BALANCE'|translate}}
<div class="badge badge-calm">
<div class="badge badge-balanced">
{{balance|formatAmount}} <span ng-bind-html="$root.currency.name|currencySymbol"></span>
</div>
</div>
<span class="item item-divider" ng-if="!loading">
{{:locale:'ACCOUNT.LAST_TX'|translate}}
<a id="helptip-wallet-tx" style="position: relative; bottom: 0; right: 0px;">&nbsp;</a>
</span>
<!-- iterate on each TX -->
<div class="item item-tx item-icon-left"
ng-repeat="tx in items"
ng-include="'templates/wallet/view_tx.html'">
ng-repeat="tx in history"
ng-include="'templates/wallet/item_tx.html'">
</div>
<div class="item item-text-wrap text-center" ng-if="tx.fromTime > 0">
<p>
<a ng-click="showMoreTx()">{{:locale:'ACCOUNT.SHOW_MORE_TX'|translate}}</a>
<span class="gray" translate="ACCOUNT.TX_FROM_DATE" translate-values="{fromTime: tx.fromTime}"></span>
<span class="gray">|</span>
<a ng-click="showMoreTx(-1)" translate>ACCOUNT.SHOW_ALL_TX</a>
</p>
</div>
</div>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment