refactor settings tab

This commit is contained in:
Gabriel Bazán 2016-08-15 17:42:04 -03:00
commit 41cc509d47
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> -->
<!-- </ion&#45;nav&#45;bar> -->
<ion-nav-bar class="bar-stable"></ion-nav-bar>
<ion-nav-view name="main"></ion-nav-view>
<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
class="topbar-container"
ng-include="'views/includes/topbar.html'"
ng-init="titleSection='About Copay'; goBackToState = 'preferencesGlobal'; noColor = true">
</div>
<div class="content preferences" ng-controller="preferencesAbout as about">
<h4 translate>Release Information</h4>
<div ng-controller="versionController as v">
<ul class="no-bullet m0">
<li ng-conf>
<span translate>Version</span>
<span class="right text-gray">
v{{v.version}}
</span>
</li>
<li ng-conf ng-click="$root.openExternalLink('https://github.com/bitpay/copay/tree/'+v.commitHash)">
<span translate>Commit hash</span>
<span class="right text-gray">
#{{v.commitHash}}
</span>
</li>
</ul>
<ion-view ng-controller="preferencesAbout" cache-view="false">
<ion-nav-bar class="bar-stable">
<ion-nav-title>About Copay</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>
<div class="item item-divider">
Release information
</div>
<h4></h4>
<ul class="no-bullet m0">
<li href ui-sref="termOfUse">
<i class="icon-arrow-right3 size-24 right text-gray"></i>
<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 class="item item-icon-left">
<i class="icon ion-ios-film-outline"></i>
<span translate>Version</span>
<span class="item-note">
v{{v.version}}
</span>
</div>
<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 class="item-note">
#{{v.commitHash}}
</span>
</div>
<div class="item item-divider">
</div>
<div class="item item-icon-left" href ui-sref="termOfUse">
<i class="icon ion-ios-bell-outline"></i>
<span translate>Terms of Use</span>
</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'"
ng-init="titleSection='Alternative Currency'; goBackToState = 'preferencesGlobal'; noColor = true">
</div>
<div class="content preferences" ng-controller="preferencesAltCurrencyController" ng-init="init()">
<h4></h4>
<ion-view ng-controller="preferencesAltCurrencyController" cache-view="false" ng-init="init()">
<ion-nav-bar class="bar-stable">
<ion-nav-title>Alternative Currency</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-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}}
</ion-radio>
<ion-infinite-scroll
@ -15,5 +17,4 @@
distance="1%">
</ion-infinite-scroll>
</ion-content>
</div>
</ion-view>

View file

@ -1,39 +1,27 @@
<div
class="topbar-container"
ng-include="'views/includes/topbar.html'"
ng-init="titleSection='Bitcoin Network Fee Policy'; goBackToState = 'preferencesGlobal'; noColor = true">
</div>
<div class="content preferences" ng-controller="preferencesFeeController">
<h4></h4>
<div class="preferences-fee" ng-show="loading">
<div class="row p20 text-center">
<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>
<ion-view ng-controller="preferencesFeeController" cache-view="false" ng-init="init()">
<ion-nav-bar class="bar-stable">
<ion-nav-title>Preferences fee</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>
<div ng-show="loading">
<ion-spinner class="spinner-dark" icon="lines">Loading...</ion-spinner>
</div>
</div>
<ion-radio class="libe-b size-12 radio-label" ng-repeat="fee in feeLevels.livenet" ng-value="fee.level" ng-model="currentFeeLevel"
ng-click="save(fee)">{{feeOpts[fee.level]|translate}}
</ion-radio>
<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">
<span class="text-bold" translate>Average confirmation time: {{fee.nbBlocks * 10}} minutes</span>.
<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>
<div ng-repeat="fee in feeLevels.livenet" ng-if="fee.level == currentFeeLevel">
<div ng-show="fee.nbBlocks">
<span translate>Average confirmation time: {{fee.nbBlocks * 10}} minutes</span>.
</div>
<span translate>Current fee rate for this policy: {{fee.feePerKBUnit}}/kiB</span>
</div>
<span class="text-bold" translate>Current fee rate for this policy: {{fee.feePerKBUnit}}/kiB</span>
</div>
</div>
<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.
</div>
</div>
</div>
<div class="extra-margin-bottom"></div>
<div 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.
</div>
</ion-content>
</ion-view>

View file

@ -1,24 +1,20 @@
<div class="topbar-container" ng-include="'views/includes/topbar.html'"
ng-init="titleSection='Language'; goBackToState = 'preferencesGlobal'; noColor = true">
</div>
<div class="content preferences" ng-controller="preferencesLanguageController">
<h4></h4>
<ion-radio class="line-b size-12 radio-label" ng-repeat="lang in availableLanguages" ng-value="lang.isoCode" ng-model="currentLanguage"
ng-click="save(lang.isoCode)">{{lang.name}}
</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>
<a ng-click="$root.openExternalLink('https://crowdin.com/project/copay', '_system')">https://crowdin.com/project/copay</a>.
</p>
<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.
</span>
</div>
</div>
</div>
<ion-view ng-controller="preferencesLanguageController" ng-init="init()" cache-view="false">
<ion-nav-bar class="bar-stable">
<ion-nav-title>Languages</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-radio ng-repeat="lang in availableLanguages" ng-value="lang.isoCode" ng-model="currentLanguage"
ng-click="save(lang.isoCode)">{{lang.name}}
</ion-radio>
<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>.
<span translate>
Don't see your language on Crowdin? Contact the Owner on Crowdin! We'd love to support your language.
</span>
</ion-content>
</ion-view>

View file

@ -1,27 +1,22 @@
<div
class="topbar-container"
ng-include="'views/includes/topbar.html'"
ng-init="titleSection='Session log'; goBackToState = 'about'; noColor = true">
</div>
<div class="content preferences" ng-controller="preferencesLogs as logs">
<h4></h4>
<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>
</button>
<ul class="no-bullet size-14 oh" style="word-wrap: break-word;">
<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' }">
{{l.msg}}
</span>
</li>
</ul>
</div>
</div>
<ion-view ng-controller="preferencesLogs" ng-init="init()" cache-view="false">
<ion-nav-bar class="bar-stable">
<ion-nav-title>Session log</ion-nav-title>
<ion-nav-buttons side="primary">
 <button class="button" href ui-sref="about">
     <i class="ion-arrow-left-c"></i> Back
   </button>
  </ion-nav-buttons>
</ion-nav-bar>
<ion-content>
<button ng-show="isCordova" ng-click="logs.sendLogs()"><i class="fi-mail"></i>
<span translate>Send by email</span>
</button>
<ul>
<li ng-repeat="l in logs">
<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}}
</span>
</li>
</ul>
</ion-content>
</ion-view>

View file

@ -1,11 +1,15 @@
<div class="topbar-container" ng-include="'views/includes/topbar.html'"
ng-init="titleSection='Unit'; goBackToState = 'preferencesGlobal'; noColor = true">
</div>
<div class="content preferences" ng-controller="preferencesUnitController">
<h4></h4>
<ion-radio class="line-b size-12 radio-label" ng-repeat="unit in unitList" ng-value="unit.code" ng-model="currentUnit"
ng-click="save(unit)">{{unit.shortName}}
</ion-radio>
</div>
<ion-view ng-controller="preferencesUnitController" ng-init="init()" cache-view="false">
<ion-nav-bar class="bar-stable">
<ion-nav-title>Unit</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 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}}
</ion-radio>
</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-content class="Settings">
<h2>Welcome to Settings</h2>
<ion-toggle ng-show="!isWP" ng-model="coinbaseEnabled" toggle-class="toggle-balanced" ng-change="coinbaseChange()">
<span class="toggle-label" translate>Enable Coinbase Service</span>
</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-view>
</ion-view>

View file

@ -1,16 +1,20 @@
<div
class="topbar-container"
ng-include="'views/includes/topbar.html'"
ng-init="titleSection='Terms of Use'; goBackToState = 'about'; noColor = true">
</div>
<div ng-controller="termOfUseController" class="content">
<p class="enable_text_select m0">
<div class="terms" ng-include="'views/includes/terms.html'"></div>
<ion-view ng-controller="termOfUseController" cache-view="false">
<ion-nav-bar class="bar-stable">
<ion-nav-title>Terms of Use</ion-nav-title>
<ion-nav-buttons side="primary">
 <button class="button" href ui-sref="about">
     <i class="ion-arrow-left-c"></i> Back
   </button>
  </ion-nav-buttons>
</ion-nav-bar>
<ion-content>
<p>
<div ng-include="'views/includes/terms.html'"></div>
</p>
<div class="row text-center">
<div class="row">
<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>
</div>
</div>
<div class="extra-margin-bottom"></div>
</ion-content>
</ion-view>

View file

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