transaction history options in preferences advanced

This commit is contained in:
Gabriel Bazán 2015-12-02 15:34:34 -03:00
commit 00e0076a90
7 changed files with 62 additions and 32 deletions

View file

@ -30,6 +30,11 @@
<div>Wallet Service URL</div> <div>Wallet Service URL</div>
</li> </li>
<li ng-click="$root.go('preferencesHistory')">
<i class="icon-arrow-right3 size-24 right text-gray"></i>
<div translate>Transaction History</div>
</li>
<li ng-click="$root.go('delete')"> <li ng-click="$root.go('delete')">
<i class="icon-arrow-right3 size-24 right text-gray"></i> <i class="icon-arrow-right3 size-24 right text-gray"></i>
<div translate>Delete Wallet</div> <div translate>Delete Wallet</div>

View file

@ -0,0 +1,21 @@
<div
class="topbar-container"
ng-include="'views/includes/topbar.html'"
ng-init="titleSection='Transaction history'; goBackToState = 'preferencesAdvanced'">
</div>
<div class="content preferences" ng-controller="preferencesHistory as history">
<h4></h4>
<ul class="no-bullet m0 size-14">
<li class="line-b p20 oh">
<button class="black round small expand" ng-style="{'background-color':index.backgroundColor}" ng-click="history.clearTransactionHistory();">
<span translate>Clear history</span>
</button>
</li>
<li class="line-b p20 oh" ng-show="!index.isCordova">
<button class="black round small expand" id="export_file" type="file" nwsaveas="Copay-{{index.alias || index.walletName}}.csv" accept=".csv" ng-style="{'background-color':index.backgroundColor}" ng-click="index.csvHistory();">
<i class="fi-page-export-csv"></i>
<span >CSV</span>
</button>
</li>
</ul>
</div>

View file

@ -146,14 +146,6 @@
</div> </div>
</ul> </ul>
<ul class="no-bullet m0 size-14">
<h4 class="title m0" translate>Transaction history</h4>
<li class="line-b p20 oh">
<button class="black round small expand" ng-style="{'background-color':index.backgroundColor}" ng-click="info.clearTransactionHistory();">
<span translate>Clear history</span>
</button>
</li>
</ul>
<h4></h4> <h4></h4>

View file

@ -496,19 +496,11 @@
</div> </div>
<div class="row m20t"> <div class="row m20t">
<div class="large-6 medium-6 small-6 columns"> <button type="submit" class="outline round small expand m0" ng-show="index.historyShowShowAll" ng-click="index.showAllHistory()" ng-style="{'background-color':index.backgroundColor}" translate>
<button type="submit" class="button black round expand" ng-show="index.historyShowShowAll" ng-click="index.showAllHistory()" ng-style="{'background-color':index.backgroundColor}" translate> <i class="icon-arrow-down4 ng-scope"></i>
Show all Show all
</button> </button>
</div> </div>
<div class="large-6 medium-6 small-6 columns" ng-show="!index.isCordova">
<input id="export_file" type="file" nwsaveas="Copay-{{index.alias || index.walletName}}.csv" accept=".csv" style="display:none">
<a class="button outline dark-gray round" ng-click="index.csvHistory();">
<i class="fi-page-export-csv"></i>
<span translate>CSV</span>
</a>
</div>
</div>
</div> </div>
<div class="extra-margin-bottom"></div> <div class="extra-margin-bottom"></div>
</div> <!-- END History --> </div> <!-- END History -->

View file

@ -0,0 +1,21 @@
'use strict';
angular.module('copayApp.controllers').controller('preferencesHistory',
function($scope, $log, $timeout, storageService, go, profileService) {
var fc = profileService.focusedClient;
var c = fc.credentials;
this.clearTransactionHistory = function() {
storageService.removeTxHistory(c.walletId, function(err) {
if (err) {
$log.error(err);
return;
}
$scope.$emit('Local/ClearHistory');
$timeout(function() {
go.walletHome();
}, 100);
});
}
});

View file

@ -7,7 +7,7 @@ angular.module('copayApp.controllers').controller('preferencesInformation',
var c = fc.credentials; var c = fc.credentials;
this.init = function() { this.init = function() {
var basePath = c.getBaseAddressDerivationPath(); var basePath = c.getBaseAddressDerivationPath();
$scope.walletName = c.walletName; $scope.walletName = c.walletName;
$scope.walletId = c.walletId; $scope.walletId = c.walletId;
@ -94,17 +94,4 @@ angular.module('copayApp.controllers').controller('preferencesInformation',
}, 100); }, 100);
}; };
this.clearTransactionHistory = function() {
storageService.removeTxHistory(c.walletId, function(err) {
if (err) {
$log.error(err);
return;
}
$scope.$emit('Local/ClearHistory');
$timeout(function() {
go.walletHome();
}, 100);
});
}
}); });

View file

@ -342,6 +342,18 @@ angular
} }
}) })
.state('preferencesHistory', {
url: '/preferencesHistory',
templateUrl: 'views/preferencesHistory.html',
walletShouldBeComplete: true,
needProfile: true,
views: {
'main': {
templateUrl: 'views/preferencesHistory.html'
},
}
})
.state('deleteWords', { .state('deleteWords', {
url: '/deleteWords', url: '/deleteWords',
templateUrl: 'views/preferencesDeleteWords.html', templateUrl: 'views/preferencesDeleteWords.html',