Merge pull request #231 from gabrielbazan7/feat/CreateTabHome

move new wallet creation to wallet card
This commit is contained in:
Gustavo Maximiliano Cortez 2016-09-30 17:17:57 -03:00 committed by GitHub
commit c6f73cb4c6
4 changed files with 22 additions and 17 deletions

View File

@ -6,7 +6,7 @@
<span translate>Addressbook</span>
</ion-nav-title>
<ion-nav-buttons side="secondary">
<button class="button button-back button-clear" ui-sref="tabs.addressbook.add">
<button class="button button-back button-clear" ng-show="!isEmptyList" ui-sref="tabs.addressbook.add">
<i class="icon ion-ios-plus-empty"></i>
</button>
</ion-nav-buttons>

View File

@ -47,11 +47,18 @@
</a>
</div>
<div class="list card" ng-hide="!wallets[0]">
<div class="list card">
<div class="item item-icon-right item-heading">
<span translate>Wallets</span>
<a ui-sref="tabs.add"><i class="icon ion-ios-plus-empty list-add-button"></i></a>
<a ui-sref="tabs.add" ng-if="wallets[0]"><i class="icon ion-ios-plus-empty list-add-button"></i></a>
</div>
<a ng-hide="wallets[0]" ui-sref="tabs.add" class="item item-icon-left item-big-icon-left item-icon-right next-step ng-hide">
<i class="icon big-icon-svg">
<div class="bg icon-create-wallet"></div>
</i>
<span translate>Create a bitcoin wallet</span>
<i class="icon nav-item-arrow-right"></i>
</a>
<a ng-repeat="wallet in wallets track by $index"
class="item item-icon-left item-big-icon-left item-icon-right wallet"
ng-click="openWallet(wallet)">
@ -78,7 +85,7 @@
<i class="icon nav-item-arrow-right"></i>
</a>
<a ui-sref="tabs.bitpayCard"
ng-if="externalServices.BitpayCard"
ng-if="wallets[0] && externalServices.BitpayCard && bitpayCardEnabled"
class="item item-icon-left item-big-icon-left item-icon-right">
<i class="icon big-icon-svg">
<div class="bg icon-bitpay-card"></div>
@ -90,7 +97,7 @@
</a>
</div>
<div class="list card" ng-if="externalServices.BuyAndSell && (glideraEnabled || coinbaseEnabled)">
<div class="list card" ng-if="wallets[0] && externalServices.BuyAndSell && (glideraEnabled || coinbaseEnabled)">
<div class="item item-icon-right item-heading" translate>
Buy &amp; Sell Bitcoin
<a ui-sref="tabs.buyandsell"><i class="icon ion-ios-plus-empty list-add-button"></i></a>
@ -105,7 +112,7 @@
</a> -->
</div>
<div class="list card" ng-if="externalServices.AmazonGiftCards">
<div class="list card" ng-if="wallets[0] && externalServices.AmazonGiftCards && amazonEnabled">
<a class="item item-icon-left item-icon-right item-big-icon-left" ui-sref="tabs.giftcards.amazon">
<i class="icon big-icon-svg">
<div class="bg icon-gift"></div>
@ -116,21 +123,13 @@
</div>
<div class="list card"
ng-show="(!externalServices.AmazonGiftCards || !externalServices.BitpayCard || !externalServices.BuyAndSell ||
!wallets[0]) && nextStepEnabled">
ng-show="nextStepEnabled && wallets[0]">
<div class="item item-icon-right item-heading" ng-click="shouldHideNextSteps()" translate>
Next steps
<i class="icon nav-item-arrow-down" ng-show="!hideNextSteps"></i>
<i class="icon nav-item-arrow-up" ng-show="hideNextSteps"></i>
</div>
<div ng-show="!hideNextSteps">
<a ng-show="!wallets[0]" ui-sref="tabs.add" class="item item-icon-left item-big-icon-left item-icon-right next-step">
<i class="icon big-icon-svg">
<div class="bg icon-create-wallet"></div>
</i>
<span translate>Create a bitcoin wallet</span>
<i class="icon nav-item-arrow-right"></i>
</a>
<a ui-sref="bitpayCard.main" ng-show="!externalServices.BitpayCard && bitpayCardEnabled" class="item item-icon-left item-big-icon-left item-icon-right next-step">
<i class="icon big-icon-svg">
<div class="bg icon-bitpay-card"></div>

View File

@ -56,7 +56,7 @@
<i class="icon nav-item-arrow-right"></i>
</a>
<div class="item item-divider" translate>Wallets Preferences</div>
<div class="item item-divider" ng-show="wallets[0]" translate>Wallets Preferences</div>
<a class="item item-icon-left item-icon-right" href
ui-sref="tabs.preferences({'walletId': item.id})"
ng-repeat="item in wallets track by $index">

View File

@ -218,11 +218,17 @@ angular.module('copayApp.controllers').controller('tabHomeController',
configService.whenAvailable(function() {
var config = configService.getSync();
var isWindowsPhoneApp = platformInfo.isWP && platformInfo.isCordova;
$scope.glideraEnabled = config.glidera.enabled && !isWindowsPhoneApp;
$scope.coinbaseEnabled = config.coinbase.enabled && !isWindowsPhoneApp;
$scope.amazonEnabled = config.amazon.enabled;
$scope.bitpayCardEnabled = config.bitpayCard.enabled;
$scope.nextStepEnabled = $scope.glideraEnabled || $scope.coinbaseEnabled || $scope.amazonEnabled || $scope.bitpayCardEnabled;
var buyAndSellEnabled = !$scope.externalServices.BuyAndSell && ($scope.glideraEnabled || $scope.coinbaseEnabled);
var amazonEnabled = !$scope.externalServices.AmazonGiftCards && $scope.amazonEnabled;
var bitpayCardEnabled = !$scope.externalServices.BitpayCard && $scope.bitpayCardEnabled;
$scope.nextStepEnabled = buyAndSellEnabled || amazonEnabled || bitpayCardEnabled;
$scope.recentTransactionsEnabled = config.recentTransactions.enabled;
if ($scope.bitpayCardEnabled) bitpayCardCache();