separate views

This commit is contained in:
Javier 2016-09-05 14:34:32 -03:00
commit 25990e23fe
6 changed files with 306 additions and 348 deletions

View file

@ -10,7 +10,7 @@
<ion-content> <ion-content>
<ion-list> <ion-list>
<a class="item item-remove-animate item-icon-right" type="item-text-wrap" ui-sref="tabs.create.personal"> <a class="item item-remove-animate item-icon-right" type="item-text-wrap" ui-sref="tabs.create">
<h2 translate>Create new wallet</h2> <h2 translate>Create new wallet</h2>
<i class="icon ion-ios-arrow-right nav-item-arrow-right"></i> <i class="icon ion-ios-arrow-right nav-item-arrow-right"></i>
</a> </a>

View file

@ -1,13 +1,22 @@
<ion-view> <ion-view>
<ion-tabs class="tabs-striped tabs-color-positive tabs-color-active-positive tabs-top"> <ion-nav-bar class="bar-royal">
<ion-nav-title>{{'Create new wallet' | translate}}</ion-nav-title>
<ion-nav-back-button>
<i class="icon ion-ios-arrow-thin-left"></i>
</ion-nav-back-button>
</ion-nav-bar>
<ion-tab title="Personal Wallet" ui-sref="tabs.create.personal"> <ion-content ng-controller="createController" ng-init="personal = true">
<ion-nav-view name="tab-create-personal"></ion-nav-view> <div class="row text-center">
</ion-tab> <div class="col" ng-click="personal = true" ng-style="personal && {'border-bottom': '2px solid'}">
<span class="" translate>Personal Wallet</span>
</div>
<div class="col" ng-click="personal = false" ng-style="!personal && {'border-bottom': '2px solid'}">
<span class="" translate>Shared Wallet</span>
</div>
</div>
<ion-tab title="Shared Wallet" ui-sref="tabs.create.shared"> <div ng-include="'views/tab-create-personal.html'" ng-if="personal"></div>
<ion-nav-view name="tab-create-shared"></ion-nav-view> <div ng-include="'views/tab-create-shared.html'" ng-if="!personal"></div>
</ion-tab> </ion-content>
</ion-tabs>
</ion-view> </ion-view>

View file

@ -1,23 +1,10 @@
<ion-view>
<ion-nav-bar class="bar-royal">
<ion-nav-buttons side="primary">
<button class="button back-button" ui-sref="tabs.add">
<i class="icon ion-ios-arrow-thin-left"></i>
</button>
</ion-nav-buttons>
<ion-nav-title>{{'Create new wallet' | translate}}</ion-nav-title>
</ion-nav-bar>
<ion-content ng-controller="createController as create" ng-init="create.setTotalCopayers(1)">
<form name="setupForm" ng-submit="create.create(setupForm)" novalidate> <form name="setupForm" ng-submit="create.create(setupForm)" novalidate>
<div class="card list"> <div class="card list">
<label ng-hide="create.hideWalletName" class="item item-input item-stacked-label"> <label class="item item-input item-stacked-label">
<span class="input-label" translate>Wallet name</span> <span class="input-label" translate>Wallet name</span>
<input type="text" <input type="text"
placeholder="{{'Family vacation funds'|translate}}" placeholder="{{'Family vacation funds'|translate}}"
name="walletName"
ng-model="walletName" ng-model="walletName"
ng-required="true" ng-required="true"
ng-focus="create.formFocus('wallet-name')" ng-focus="create.formFocus('wallet-name')"
@ -30,10 +17,9 @@
</ion-toggle> </ion-toggle>
<div ng-show="showAdv"> <div ng-show="showAdv">
<label class="item item-input item-stacked-label"> <label class="item item-input item-stacked-label">
<span class="input-label">Wallet Service URL</span> <span class="input-label">Wallet Service URL</span>
<input type="text" id="bwsurl" name="bwsurl" ng-model="bwsurl"> <input type="text" ng-model="bwsurl" placeholder="https://bws.bitpay.com/bws/api">
</label> </label>
<label class="item item-input item-select"> <label class="item item-input item-select">
@ -47,8 +33,7 @@
</select> </select>
</label> </label>
<label class="item item-input item-stacked-label" <label class="item item-input item-stacked-label" ng-show="create.seedSourceId == 'trezor' || create.seedSourceId == 'ledger'">
ng-show="create.seedSourceId == 'trezor' || create.seedSourceId == 'ledger'">
<span class="input-label" translate>Account Number</span> <span class="input-label" translate>Account Number</span>
<input type="number" id="account" ng-model="account" ignore-mouse-wheel> <input type="number" id="account" ng-model="account" ignore-mouse-wheel>
</label> </label>
@ -96,7 +81,8 @@
ng-model="derivationPath"> ng-model="derivationPath">
</label> </label>
<ion-toggle ng-show="create.seedSourceId == 'new'" ng-model="testnetEnabled" toggle-class="toggle-positive"> <!-- <ion-toggle ng-show="create.seedSourceId == 'new'" ng-model="testnetEnabled" toggle-class="toggle-positive"> -->
<ion-toggle ng-model="testnetEnabled" toggle-class="toggle-positive">
Testnet Testnet
</ion-toggle> </ion-toggle>
@ -121,5 +107,3 @@
</button> </button>
</form> </form>
</ion-content>
</ion-view>

View file

@ -1,15 +1,3 @@
<ion-view>
<ion-nav-bar class="bar-royal">
<ion-nav-buttons side="primary">
<button class="button back-button" ui-sref="tabs.add">
<i class="icon ion-ios-arrow-thin-left"></i>
</button>
</ion-nav-buttons>
<ion-nav-title>{{'Create new wallet' | translate}}</ion-nav-title>
</ion-nav-bar>
<ion-content ng-controller="createController as create" ng-init="create.setTotalCopayers(3)">
<form name="setupForm" ng-submit="create.create(setupForm)" novalidate> <form name="setupForm" ng-submit="create.create(setupForm)" novalidate>
<div class="card list"> <div class="card list">
@ -155,5 +143,3 @@
</button> </button>
</form> </form>
</ion-content>
</ion-view>

View file

@ -190,27 +190,6 @@ angular.module('copayApp.controllers').controller('createController',
}, 100); }, 100);
} }
this.formFocus = function(what) {
if (!this.isWindowsPhoneApp) return
if (what && what == 'my-name') {
this.hideWalletName = true;
this.hideTabs = true;
} else if (what && what == 'wallet-name') {
this.hideTabs = true;
} else {
this.hideWalletName = false;
this.hideTabs = false;
}
$timeout(function() {
$rootScope.$digest();
}, 1);
};
$scope.$on("$destroy", function() {
$rootScope.hideWalletNavigation = false;
});
updateSeedSourceSelect(1); updateSeedSourceSelect(1);
self.setSeedSource(); self.setSeedSource();
}); });

View file

@ -301,7 +301,7 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
}) })
.state('tabs.create', { .state('tabs.create', {
url: '/create', url: '/create',
abstract: true, // abstract: true,
templateUrl: 'views/create.html', templateUrl: 'views/create.html',
views: { views: {
'tab-home': { 'tab-home': {
@ -309,22 +309,22 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
}, },
} }
}) })
.state('tabs.create.personal', { // .state('tabs.create.personal', {
url: '/tab-create-personal', // url: '/tab-create-personal',
views: { // views: {
'tab-create-personal': { // 'tab-create-personal': {
templateUrl: 'views/tab-create-personal.html', // templateUrl: 'views/tab-create-personal.html',
}, // },
} // }
}) // })
.state('tabs.create.shared', { // .state('tabs.create.shared', {
url: '/tab-create-shared', // url: '/tab-create-shared',
views: { // views: {
'tab-create-shared': { // 'tab-create-shared': {
templateUrl: 'views/tab-create-shared.html', // templateUrl: 'views/tab-create-shared.html',
}, // },
} // }
}) // })
/* /*
* *