Merge pull request #186 from gabrielbazan7/ref/designSettings

refactor settings tab
This commit is contained in:
Matias Alejo Garcia 2016-08-15 17:50:46 -03:00 committed by GitHub
commit 1b8492f0dd
21 changed files with 462 additions and 252 deletions

View file

@ -20,7 +20,6 @@
<!-- <ion&#45;nav&#45;back&#45;button class="button&#45;icon ion&#45;arrow&#45;left&#45;c"> --> <!-- <ion&#45;nav&#45;back&#45;button class="button&#45;icon ion&#45;arrow&#45;left&#45;c"> -->
<!-- </ion&#45;nav&#45;back&#45;button> --> <!-- </ion&#45;nav&#45;back&#45;button> -->
<!-- </ion&#45;nav&#45;bar> --> <!-- </ion&#45;nav&#45;bar> -->
<ion-nav-bar class="bar-stable"></ion-nav-bar>
<ion-nav-view name="main"></ion-nav-view> <ion-nav-view name="main"></ion-nav-view>
<script src="lib/ionic.bundle.min.js"></script> <script src="lib/ionic.bundle.min.js"></script>

View file

@ -0,0 +1,12 @@
<ion-view cache-view="false">
<ion-nav-bar class="bar-stable">
<ion-nav-title>feedback</ion-nav-title>
<ion-nav-buttons side="primary">
 <button class="button" href ui-sref="tabs.settings">
     <i class="ion-arrow-left-c"></i> Back
   </button>
 </ion-nav-buttons>
</ion-nav-bar>
<ion-content>
</ion-content>
</ion-view>

View file

@ -1,42 +1,43 @@
<div <ion-view ng-controller="preferencesAbout" cache-view="false">
class="topbar-container" <ion-nav-bar class="bar-stable">
ng-include="'views/includes/topbar.html'" <ion-nav-title>About Copay</ion-nav-title>
ng-init="titleSection='About Copay'; goBackToState = 'preferencesGlobal'; noColor = true"> <ion-nav-buttons side="primary">
 <button class="button" href ui-sref="tabs.settings">
     <i class="ion-arrow-left-c"></i> Back
   </button>
  </ion-nav-buttons>
</ion-nav-bar>
<ion-content>
<div class="item item-divider">
Release information
</div> </div>
<div class="item item-icon-left">
<div class="content preferences" ng-controller="preferencesAbout as about"> <i class="icon ion-ios-film-outline"></i>
<h4 translate>Release Information</h4>
<div ng-controller="versionController as v">
<ul class="no-bullet m0">
<li ng-conf>
<span translate>Version</span> <span translate>Version</span>
<span class="right text-gray"> <span class="item-note">
v{{v.version}} v{{v.version}}
</span> </span>
</li> </div>
<li ng-conf ng-click="$root.openExternalLink('https://github.com/bitpay/copay/tree/'+v.commitHash)"> <div class="item item-icon-left" ng-click="$root.openExternalLink('https://github.com/bitpay/copay/tree/'+v.commitHash)">
<i class="icon ion-ios-film-outline"></i>
<span translate>Commit hash</span> <span translate>Commit hash</span>
<span class="right text-gray"> <span class="item-note">
#{{v.commitHash}} #{{v.commitHash}}
</span> </span>
</li>
</ul>
</div> </div>
<div class="item item-divider">
<h4></h4> </div>
<ul class="no-bullet m0"> <div class="item item-icon-left" href ui-sref="termOfUse">
<li href ui-sref="termOfUse"> <i class="icon ion-ios-bell-outline"></i>
<i class="icon-arrow-right3 size-24 right text-gray"></i>
<span translate>Terms of Use</span> <span translate>Terms of Use</span>
</li>
<li href ui-sref="translators">
<i class="icon-arrow-right3 size-24 right text-gray"></i>
<span translate>Translators</span>
</li>
<li ng-conf href ui-sref="logs">
<i class="icon-arrow-right3 size-24 right text-gray"></i>
<span translate>Session log</span>
</li>
</ul>
</div> </div>
<div class="item item-icon-left" href ui-sref="translators">
<i class="icon ion-ios-bell-outline"></i>
<span translate>Translators</span>
</div>
<div class="item item-icon-left" href ui-sref="logs">
<i class="icon ion-ios-bell-outline"></i>
<span translate>Session log</span>
</div>
</ion-content>
</ion-view>

View file

@ -1,12 +1,14 @@
<div class="topbar-container" ng-include="'views/includes/topbar.html'" <ion-view ng-controller="preferencesAltCurrencyController" cache-view="false" ng-init="init()">
ng-init="titleSection='Alternative Currency'; goBackToState = 'preferencesGlobal'; noColor = true"> <ion-nav-bar class="bar-stable">
</div> <ion-nav-title>Alternative Currency</ion-nav-title>
<ion-nav-buttons side="primary">
<div class="content preferences" ng-controller="preferencesAltCurrencyController" ng-init="init()">  <button class="button" href ui-sref="tabs.settings">
<h4></h4>      <i class="ion-arrow-left-c"></i> Back
   </button>
 </ion-nav-buttons>
</ion-nav-bar>
<ion-content> <ion-content>
<ion-radio class="line-b size-12 radio-label" ng-repeat="altCurrency in altCurrencyList" ng-value="altCurrency.isoCode" ng-model="currentCurrency" <ion-radio ng-repeat="altCurrency in altCurrencyList" ng-value="altCurrency.isoCode" ng-model="currentCurrency"
ng-click="save(altCurrency)">{{altCurrency.name}} ng-click="save(altCurrency)">{{altCurrency.name}}
</ion-radio> </ion-radio>
<ion-infinite-scroll <ion-infinite-scroll
@ -15,5 +17,4 @@
distance="1%"> distance="1%">
</ion-infinite-scroll> </ion-infinite-scroll>
</ion-content> </ion-content>
</div> </ion-view>

View file

@ -1,39 +1,27 @@
<div <ion-view ng-controller="preferencesFeeController" cache-view="false" ng-init="init()">
class="topbar-container" <ion-nav-bar class="bar-stable">
ng-include="'views/includes/topbar.html'" <ion-nav-title>Preferences fee</ion-nav-title>
ng-init="titleSection='Bitcoin Network Fee Policy'; goBackToState = 'preferencesGlobal'; noColor = true"> <ion-nav-buttons side="primary">
</div>  <button class="button" href ui-sref="tabs.settings">
<div class="content preferences" ng-controller="preferencesFeeController">      <i class="ion-arrow-left-c"></i> Back
<h4></h4>    </button>
<div class="preferences-fee" ng-show="loading">  </ion-nav-buttons>
<div class="row p20 text-center"> </ion-nav-bar>
<div class="columns large-12 medium-12 small-12 m10b">
<ion-spinner class="spinner-dark" icon="lines"></ion-spinner>
</div>
<div class="size-12 text-gray m20t" translate>
Loading...
</div>
</div>
</div>
<ion-radio class="libe-b size-12 radio-label" ng-repeat="fee in feeLevels.livenet" ng-value="fee.level" ng-model="currentFeeLevel" <ion-content>
ng-click="save(fee)">{{feeOpts[fee.level]|translate}} <div ng-show="loading">
<ion-spinner class="spinner-dark" icon="lines">Loading...</ion-spinner>
</div>
<ion-radio ng-repeat="fee in feeLevels.livenet" ng-value="fee.level" ng-model="currentFeeLevel" ng-click="save(fee)">{{feeOpts[fee.level]|translate}}
</ion-radio> </ion-radio>
<div ng-repeat="fee in feeLevels.livenet" ng-if="fee.level == currentFeeLevel">
<div class="row m20t">
<div class="text-gray size-12 text-center" ng-repeat="fee in feeLevels.livenet" ng-if="fee.level == currentFeeLevel">
<div ng-show="fee.nbBlocks"> <div ng-show="fee.nbBlocks">
<span class="text-bold" translate>Average confirmation time: {{fee.nbBlocks * 10}} minutes</span>. <span translate>Average confirmation time: {{fee.nbBlocks * 10}} minutes</span>.
</div> </div>
<span class="text-bold" translate>Current fee rate for this policy: {{fee.feePerKBUnit}}/kiB</span> <span translate>Current fee rate for this policy: {{fee.feePerKBUnit}}/kiB</span>
</div> </div>
</div> <div translate>
<div class="m15">
<div class="text-gray size-12 text-center" translate>
Bitcoin transactions may include a fee collected by miners on the network. The higher the fee, the greater the incentive a miner has to include that transaction in a block. Current fees are determined based on network load and the selected policy. Bitcoin transactions may include a fee collected by miners on the network. The higher the fee, the greater the incentive a miner has to include that transaction in a block. Current fees are determined based on network load and the selected policy.
</div> </div>
</div> </ion-content>
</div> </ion-view>
<div class="extra-margin-bottom"></div>

View file

@ -1,24 +1,20 @@
<div class="topbar-container" ng-include="'views/includes/topbar.html'" <ion-view ng-controller="preferencesLanguageController" ng-init="init()" cache-view="false">
ng-init="titleSection='Language'; goBackToState = 'preferencesGlobal'; noColor = true"> <ion-nav-bar class="bar-stable">
</div> <ion-nav-title>Languages</ion-nav-title>
<ion-nav-buttons side="primary">
<div class="content preferences" ng-controller="preferencesLanguageController">  <button class="button" href ui-sref="tabs.settings">
<h4></h4>      <i class="ion-arrow-left-c"></i> Back
   </button>
<ion-radio class="line-b size-12 radio-label" ng-repeat="lang in availableLanguages" ng-value="lang.isoCode" ng-model="currentLanguage"   </ion-nav-buttons>
</ion-nav-bar>
<ion-content>
<ion-radio ng-repeat="lang in availableLanguages" ng-value="lang.isoCode" ng-model="currentLanguage"
ng-click="save(lang.isoCode)">{{lang.name}} ng-click="save(lang.isoCode)">{{lang.name}}
</ion-radio> </ion-radio>
<div class="row m20v">
<div class="columns text-center">
<p class="size-12 text-black">
<span translate>All contributions to Copay's translation are welcome. Sign up at crowdin.com and join the Copay project at</span> <span translate>All contributions to Copay's translation are welcome. Sign up at crowdin.com and join the Copay project at</span>
<a ng-click="$root.openExternalLink('https://crowdin.com/project/copay', '_system')">https://crowdin.com/project/copay</a>. <a ng-click="$root.openExternalLink('https://crowdin.com/project/copay', '_system')">https://crowdin.com/project/copay</a>.
</p> <span translate>
<span class="size-12 text-gray" translate>
Don't see your language on Crowdin? Contact the Owner on Crowdin! We'd love to support your language. Don't see your language on Crowdin? Contact the Owner on Crowdin! We'd love to support your language.
</span> </span>
</div> </ion-content>
</div> </ion-view>
</div>

View file

@ -1,27 +1,22 @@
<div <ion-view ng-controller="preferencesLogs" ng-init="init()" cache-view="false">
class="topbar-container" <ion-nav-bar class="bar-stable">
ng-include="'views/includes/topbar.html'" <ion-nav-title>Session log</ion-nav-title>
ng-init="titleSection='Session log'; goBackToState = 'about'; noColor = true"> <ion-nav-buttons side="primary">
</div>  <button class="button" href ui-sref="about">
     <i class="ion-arrow-left-c"></i> Back
   </button>
  </ion-nav-buttons>
<div class="content preferences" ng-controller="preferencesLogs as logs"> </ion-nav-bar>
<h4></h4> <ion-content>
<button ng-show="isCordova" ng-click="logs.sendLogs()"><i class="fi-mail"></i>
<div class="row columns large-centered medium-centered">
<button class="black round small expand" ng-show="index.isCordova" ng-style="{'background-color':index.backgroundColor}" ng-click="logs.sendLogs()"><i class="fi-mail"></i>
<span translate>Send by email</span> <span translate>Send by email</span>
</button> </button>
<ul>
<ul class="no-bullet size-14 oh" style="word-wrap: break-word;"> <li ng-repeat="l in logs">
<li class="line-b enable_text_select" ng-repeat="l in logs.logs">
<span ng-class="{'text-warning': l.level=='warn', 'text-secondary': l.level=='debug', 'text-primary': l.level=='info', 'text-alert': l.level=='error' }"> <span ng-class="{'text-warning': l.level=='warn', 'text-secondary': l.level=='debug', 'text-primary': l.level=='info', 'text-alert': l.level=='error' }">
{{l.msg}} {{l.msg}}
</span> </span>
</li> </li>
</ul> </ul>
</div> </ion-content>
</div> </ion-view>

View file

@ -1,11 +1,15 @@
<div class="topbar-container" ng-include="'views/includes/topbar.html'" <ion-view ng-controller="preferencesUnitController" ng-init="init()" cache-view="false">
ng-init="titleSection='Unit'; goBackToState = 'preferencesGlobal'; noColor = true"> <ion-nav-bar class="bar-stable">
</div> <ion-nav-title>Unit</ion-nav-title>
<ion-nav-buttons side="primary">
<div class="content preferences" ng-controller="preferencesUnitController">  <button class="button" href ui-sref="tabs.settings">
<h4></h4>      <i class="ion-arrow-left-c"></i> Back
   </button>
<ion-radio class="line-b size-12 radio-label" ng-repeat="unit in unitList" ng-value="unit.code" ng-model="currentUnit"   </ion-nav-buttons>
</ion-nav-bar class="bar-stable">
<ion-content>
<ion-radio ng-repeat="unit in unitList" ng-value="unit.code" ng-model="currentUnit"
ng-click="save(unit)">{{unit.shortName}} ng-click="save(unit)">{{unit.shortName}}
</ion-radio> </ion-radio>
</div> </ion-content>
</ion-view>

View file

@ -1,6 +1,89 @@
<ion-view ng-controller="tabSettingsController" cache-view="false" ng-init="init()">
<ion-nav-bar class="bar-stable">
<ion-nav-title>Global Settings</ion-nav-title>
</ion-nav-bar>
<ion-content class="has-header">
<div class="item item-divider">
</div>
<div class="list">
<div class="item item-icon-left" ng-click="openAddressbookModal()">
<i class="icon ion-ios-book-outline"></i>
<span translate>Address Book</span>
</div>
<div class="item item-icon-left" href ui-sref="feedback">
<i class="icon ion-ios-heart-outline"></i>
<span translate>Feedback</span>
</div>
</div>
<div class="item item-divider">
Preferences
</div>
<div class="list">
<div class="item item-icon-left" href ui-sref="preferencesLanguage">
<i class="icon ion-ios-chatbubble-outline"></i>
<span translate>Language</span>
<span class="item-note">
{{currentLanguageName|translate}}
</span>
</div>
<div class="item item-icon-left" href ui-sref="preferencesUnit">
<i class="icon ion-ios-calculator-outline"></i>
<span translate>Unit</span>
<span class="item-note">
{{unitName}}
</span>
</div>
<div class="item item-icon-left" href ui-sref="preferencesAltCurrency">
<i class="icon ion-social-usd-outline"></i>
<span translate>Alternative Currency</span>
<span class="item-note">
{{selectedAlternative.name}}
</span>
</div>
<div class="item item-icon-left" href ui-sref="preferencesFee">
<i class="icon ion-ios-film-outline"></i>
<span translate>Bitcoin Network Fee Policy</span>
<span class="item-note">
{{feeOpts[currentFeeLevel]|translate}}
</span>
</div>
</div>
<div class="list" ng-show="usePushNotifications && PNEnabledByUser">
<div class="item item-divider">
Notifications
</div>
<ion-toggle ng-model="pushNotifications" toggle-class="toggle-balanced" ng-change="pushNotificationsChange()">
<span class="toggle-label" translate>Enable push notifications</span>
</ion-toggle>
<div ng-show="usePushNotifications && !PNEnabledByUser && isIOSApp">
<div translate>Push notifications for Copay are currently disabled. Enable them in the Settings app.</div>
<ul ng-click="openSettings()">
<li ng-style="{'color':index.backgroundColor}" translate>Open Settings app</li>
</ul>
</div>
</div>
<div class="item item-divider">
Exchanges
</div>
<ion-toggle ng-show="!isWP" ng-model="glideraEnabled" toggle-class="toggle-balanced" ng-change="glideraChange()">
<span class="toggle-label" translate>Enable Glidera Service</span>
</ion-toggle>
<ion-view view-title="Home"> <ion-toggle ng-show="!isWP" ng-model="coinbaseEnabled" toggle-class="toggle-balanced" ng-change="coinbaseChange()">
<ion-content class="Settings"> <span class="toggle-label" translate>Enable Coinbase Service</span>
<h2>Welcome to Settings</h2> </ion-toggle>
</div>
<div class="item item-divider">
Others
</div>
<div class="list">
<ion-toggle ng-model="spendUnconfirmed" toggle-class="toggle-balanced" ng-change="spendUnconfirmedChange()">
<span class="toggle-label" translate>Use Unconfirmed Funds</span>
</ion-toggle>
<div class="item item-icon-left" href ui-sref="about">
<i class="icon ion-ios-film-outline"></i>
<span translate>About Copay</span>
</div>
</div>
</ion-content> </ion-content>
</ion-view> </ion-view>

View file

@ -1,16 +1,20 @@
<div <ion-view ng-controller="termOfUseController" cache-view="false">
class="topbar-container" <ion-nav-bar class="bar-stable">
ng-include="'views/includes/topbar.html'" <ion-nav-title>Terms of Use</ion-nav-title>
ng-init="titleSection='Terms of Use'; goBackToState = 'about'; noColor = true"> <ion-nav-buttons side="primary">
</div>  <button class="button" href ui-sref="about">
<div ng-controller="termOfUseController" class="content">      <i class="ion-arrow-left-c"></i> Back
<p class="enable_text_select m0">    </button>
<div class="terms" ng-include="'views/includes/terms.html'"></div>   </ion-nav-buttons>
</ion-nav-bar>
<ion-content>
<p>
<div ng-include="'views/includes/terms.html'"></div>
</p> </p>
<div class="row text-center"> <div class="row">
<p ng-show="lang != 'en'"> <p ng-show="lang != 'en'">
<a class="center" ng-click="$root.openExternalLink('https://copay.io/disclaimer')" translate>Official English Disclaimer</a> <a ng-click="$root.openExternalLink('https://copay.io/disclaimer')" translate>Official English Disclaimer</a>
</p> </p>
</div> </div>
</div> </ion-content>
<div class="extra-margin-bottom"></div> </ion-view>

View file

@ -1,32 +1,35 @@
<div <ion-view cache-view="false">
class="topbar-container" <ion-nav-bar class="bar-stable">
ng-include="'views/includes/topbar.html'" <ion-nav-title>Translators</ion-nav-title>
ng-init="titleSection='Translators'; goBackToState = 'about'; noColor = true"> <ion-nav-buttons side="primary">
</div>  <button class="button" href ui-sref="about">
     <i class="ion-arrow-left-c"></i> Back
<div class="content preferences">    </button>
<h4 class="title m0" translate>Translation Credits</h4>   </ion-nav-buttons>
<ul class="no-bullet m0 size-14"> </ion-nav-bar>
<li class="line-b p10">kinoshitajona<span class="right text-gray size-12" translate>Japanese</span></li> <ion-content>
<li class="line-b p10">Kirvx<span class="right text-gray size-12" translate>French</span></li> <h4 translate>Translation Credits</h4>
<li class="line-b p10">saschad<span class="right text-gray size-12" translate>German</span></li> <ul>
<li class="line-b p10">cmgustavo83<span class="right text-gray size-12" translate>Spanish</span></li> <li >kinoshitajona<span translate>Japanese</span></li>
<li class="line-b p10">RussianNeuroMancer<span class="right text-gray size-12" translate>Russian</span></li> <li >Kirvx<span translate>French</span></li>
<li class="line-b p10">HostFat<span class="right text-gray size-12" translate>Italian</span></li> <li >saschad<span translate>German</span></li>
<li class="line-b p10">xm2hi<span class="right text-gray size-12" translate>Chinese</span></li> <li >cmgustavo83<span translate>Spanish</span></li>
<li class="line-b p10">Pirx1618<span class="right text-gray size-12" translate>Polish</span></li> <li >RussianNeuroMancer<span translate>Russian</span></li>
<li class="line-b p10">mareksip<span class="right text-gray size-12" translate>Czech</span></li> <li >HostFat<span translate>Italian</span></li>
<li >xm2hi<span translate>Chinese</span></li>
<li >Pirx1618<span translate>Polish</span></li>
<li >mareksip<span translate>Czech</span></li>
</ul> </ul>
<div class="row m20t"> <div class="row">
<div class="columns text-center"> <div class="columns">
<p class="size-12 text-black"> <p>
<span translate>All contributions to Copay's translation are welcome. Sign up at crowdin.com and join the Copay project at</span> <span translate>All contributions to Copay's translation are welcome. Sign up at crowdin.com and join the Copay project at</span>
<a ng-click="$root.openExternalLink('https://crowdin.com/project/copay', '_system')">https://crowdin.com/project/copay</a>. <a ng-click="$root.openExternalLink('https://crowdin.com/project/copay', '_system')">https://crowdin.com/project/copay</a>.
</p> </p>
<span class="size-12 text-gray" translate> <spantranslate>
Don't see your language on Crowdin? Contact the Owner on Crowdin! We'd love to support your language. Don't see your language on Crowdin? Contact the Owner on Crowdin! We'd love to support your language.
</span> </span>
</div> </div>
</div> </div>
<div class="extra-margin-bottom"></div> </ion-content>
</div> </ion-view>

View file

@ -3,13 +3,15 @@
angular.module('copayApp.controllers').controller('preferencesAltCurrencyController', angular.module('copayApp.controllers').controller('preferencesAltCurrencyController',
function($scope, $log, $timeout, configService, rateService, lodash, go, profileService, walletService) { function($scope, $log, $timeout, configService, rateService, lodash, go, profileService, walletService) {
var config = configService.getSync();
var next = 10; var next = 10;
var completeAlternativeList; var completeAlternativeList;
$scope.init = function() {
var config = configService.getSync();
$scope.currentCurrency = config.wallet.settings.alternativeIsoCode; $scope.currentCurrency = config.wallet.settings.alternativeIsoCode;
$scope.listComplete = false; $scope.listComplete = false;
$scope.init = function() {
rateService.whenAvailable(function() { rateService.whenAvailable(function() {
completeAlternativeList = rateService.listAlternatives(); completeAlternativeList = rateService.listAlternatives();
lodash.remove(completeAlternativeList, function(c) { lodash.remove(completeAlternativeList, function(c) {

View file

@ -2,6 +2,7 @@
angular.module('copayApp.controllers').controller('preferencesFeeController', function($scope, $timeout, configService, feeService) { angular.module('copayApp.controllers').controller('preferencesFeeController', function($scope, $timeout, configService, feeService) {
$scope.init = function() {
$scope.loading = true; $scope.loading = true;
feeService.getFeeLevels(function(levels) { feeService.getFeeLevels(function(levels) {
$scope.loading = false; $scope.loading = false;
@ -10,6 +11,7 @@ angular.module('copayApp.controllers').controller('preferencesFeeController', fu
$scope.feeLevels = levels; $scope.feeLevels = levels;
$scope.$apply(); $scope.$apply();
}); });
}
$scope.save = function(newFee) { $scope.save = function(newFee) {
var opts = { var opts = {

View file

@ -3,14 +3,14 @@
angular.module('copayApp.controllers').controller('preferencesGlobalController', angular.module('copayApp.controllers').controller('preferencesGlobalController',
function($scope, $rootScope, $log, configService, uxLanguage, platformInfo, pushNotificationsService, profileService, feeService) { function($scope, $rootScope, $log, configService, uxLanguage, platformInfo, pushNotificationsService, profileService, feeService) {
$scope.init = function() {
var config = configService.getSync();
var isCordova = platformInfo.isCordova; var isCordova = platformInfo.isCordova;
if (isCordova && StatusBar.isVisible) { if (isCordova && StatusBar.isVisible) {
StatusBar.backgroundColorByHexString("#4B6178"); StatusBar.backgroundColorByHexString("#4B6178");
} }
$scope.init = function() {
var config = configService.getSync();
$scope.unitName = config.wallet.settings.unitName; $scope.unitName = config.wallet.settings.unitName;
$scope.currentLanguageName = uxLanguage.getCurrentLanguageName(); $scope.currentLanguageName = uxLanguage.getCurrentLanguageName();
$scope.selectedAlternative = { $scope.selectedAlternative = {

View file

@ -1,10 +1,12 @@
'use strict'; 'use strict';
angular.module('copayApp.controllers').controller('preferencesLanguageController', angular.module('copayApp.controllers').controller('preferencesLanguageController',
function($scope, $log, configService, profileService, uxLanguage, walletService, go) { function($scope, $log, $state, configService, profileService, uxLanguage, walletService, go) {
$scope.init = function() {
$scope.availableLanguages = uxLanguage.getLanguages(); $scope.availableLanguages = uxLanguage.getLanguages();
$scope.currentLanguage = uxLanguage.getCurrentLanguage(); $scope.currentLanguage = uxLanguage.getCurrentLanguage();
}
$scope.save = function(newLang) { $scope.save = function(newLang) {
var opts = { var opts = {

View file

@ -1,13 +1,16 @@
'use strict'; 'use strict';
angular.module('copayApp.controllers').controller('preferencesLogs', angular.module('copayApp.controllers').controller('preferencesLogs',
function(historicLog) { function($scope, historicLog) {
this.logs = historicLog.get();
this.sendLogs = function() { $scope.init = function() {
$scope.logs = historicLog.get();
}
$scope.sendLogs = function() {
var body = 'Copay Session Logs\n Be careful, this could contain sensitive private data\n\n'; var body = 'Copay Session Logs\n Be careful, this could contain sensitive private data\n\n';
body += '\n\n'; body += '\n\n';
body += this.logs.map(function(v) { body += $scope.logs.map(function(v) {
return v.msg; return v.msg;
}).join('\n'); }).join('\n');

View file

@ -2,9 +2,10 @@
angular.module('copayApp.controllers').controller('preferencesUnitController', function($scope, $log, configService, go, walletService, profileService) { angular.module('copayApp.controllers').controller('preferencesUnitController', function($scope, $log, configService, go, walletService, profileService) {
$scope.init = function() {
var config = configService.getSync(); var config = configService.getSync();
$scope.currentUnit = config.wallet.settings.unitCode; $scope.currentUnit = config.wallet.settings.unitCode;
}
$scope.unitList = [ $scope.unitList = [
{ {

View file

@ -0,0 +1,109 @@
'use strict';
angular.module('copayApp.controllers').controller('tabSettingsController', function($scope, $rootScope, $log, $ionicModal, lodash, configService, uxLanguage, platformInfo, pushNotificationsService, profileService, feeService) {
$scope.init = function() {
var config = configService.getSync();
var isCordova = platformInfo.isCordova;
var isWP = platformInfo.isWP;
var isIOS = platformInfo.isIOS;
$scope.unitName = config.wallet.settings.unitName;
$scope.currentLanguageName = uxLanguage.getCurrentLanguageName();
$scope.selectedAlternative = {
name: config.wallet.settings.alternativeName,
isoCode: config.wallet.settings.alternativeIsoCode
};
$scope.feeOpts = feeService.feeOpts;
$scope.currentFeeLevel = feeService.getCurrentFeeLevel();
$scope.usePushNotifications = isCordova && !isWP;
$scope.PNEnabledByUser = true;
$scope.isIOSApp = isIOS && isCordova;
if ($scope.isIOSApp) {
cordova.plugins.diagnostic.isRemoteNotificationsEnabled(function(isEnabled) {
$scope.PNEnabledByUser = isEnabled;
$scope.$digest();
});
}
$scope.spendUnconfirmed = config.wallet.spendUnconfirmed;
$scope.glideraEnabled = config.glidera.enabled;
$scope.coinbaseEnabled = config.coinbase.enabled;
$scope.pushNotifications = config.pushNotifications.enabled;
if (isCordova && StatusBar.isVisible) {
StatusBar.backgroundColorByHexString("#4B6178");
}
$scope.otherWallets = lodash.filter(profileService.getWallets(self.network), function(w) {
return w.id != self.walletId;
});
};
$scope.openAddressbookModal = function() {
$ionicModal.fromTemplateUrl('views/modals/addressbook.html', {
scope: $scope
}).then(function(modal) {
$scope.addressbookModal = modal;
$scope.addressbookModal.show();
});
};
$scope.openSettings = function() {
cordova.plugins.diagnostic.switchToSettings(function() {
$log.debug('switched to settings');
}, function(err) {
$log.debug(err);
});
}
$scope.spendUnconfirmedChange = function() {
var opts = {
wallet: {
spendUnconfirmed: $scope.spendUnconfirmed
}
};
configService.set(opts, function(err) {
$rootScope.$emit('Local/SpendUnconfirmedUpdated', $scope.spendUnconfirmed);
if (err) $log.debug(err);
});
};
$scope.pushNotificationsChange = function() {
var opts = {
pushNotifications: {
enabled: $scope.pushNotifications
}
};
configService.set(opts, function(err) {
if (opts.pushNotifications.enabled)
pushNotificationsService.enableNotifications(profileService.walletClients);
else
pushNotificationsService.disableNotifications(profileService.walletClients);
if (err) $log.debug(err);
});
};
$scope.glideraChange = function() {
var opts = {
glidera: {
enabled: $scope.glideraEnabled
}
};
configService.set(opts, function(err) {
if (err) $log.debug(err);
});
};
$scope.coinbaseChange = function() {
var opts = {
coinbase: {
enabled: $scope.coinbaseEnabled
}
};
configService.set(opts, function(err) {
if (err) $log.debug(err);
});
};
});

View file

@ -160,10 +160,15 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
}, },
} }
}) })
.state('feedback', {
url: '/feedback',
needProfile: true,
views: {
'main': {
templateUrl: 'views/feedback.html',
},
}
})
.state('unsupported', { .state('unsupported', {
url: '/unsupported', url: '/unsupported',
needProfile: false, needProfile: false,

View file

@ -1,6 +1,6 @@
'use strict'; 'use strict';
angular.module('copayApp.services').factory('feeService', function($log, bwcService, profileService, configService, gettext, lodash) { angular.module('copayApp.services').factory('feeService', function($log, bwcService, walletService, configService, gettext, lodash) {
var root = {}; var root = {};
// Constant fee options to translate // Constant fee options to translate
@ -16,7 +16,7 @@ angular.module('copayApp.services').factory('feeService', function($log, bwcServ
}; };
root.getCurrentFeeValue = function(cb) { root.getCurrentFeeValue = function(cb) {
var fc = profileService.focusedClient; var fc = walletService.focusedClient;
var feeLevel = root.getCurrentFeeLevel(); var feeLevel = root.getCurrentFeeLevel();
fc.getFeeLevels(fc.credentials.network, function(err, levels) { fc.getFeeLevels(fc.credentials.network, function(err, levels) {
@ -49,8 +49,8 @@ angular.module('copayApp.services').factory('feeService', function($log, bwcServ
if (errLivenet || errTestnet) $log.debug('Could not get dynamic fee'); if (errLivenet || errTestnet) $log.debug('Could not get dynamic fee');
else { else {
for (var i = 0; i < 4; i++) { for (var i = 0; i < 4; i++) {
levelsLivenet[i]['feePerKBUnit'] = profileService.formatAmount(levelsLivenet[i].feePerKB) + ' ' + unitName; levelsLivenet[i]['feePerKBUnit'] = walletService.formatAmount(levelsLivenet[i].feePerKB) + ' ' + unitName;
levelsTestnet[i]['feePerKBUnit'] = profileService.formatAmount(levelsTestnet[i].feePerKB) + ' ' + unitName; levelsTestnet[i]['feePerKBUnit'] = walletService.formatAmount(levelsTestnet[i].feePerKB) + ' ' + unitName;
} }
} }

View file

@ -56,7 +56,7 @@ angular.module('copayApp.services').factory('go', function($window, $ionicSideMe
}; };
root.preferencesGlobal = function() { root.preferencesGlobal = function() {
$state.transitionTo('preferencesGlobal'); $state.transitionTo('tabs.settings');
}; };
root.reload = function() { root.reload = function() {