sync accounts

This commit is contained in:
Mo Bitar
2017-01-26 19:50:47 -06:00
parent a255b8487e
commit b7492176d1
15 changed files with 167 additions and 114 deletions

View File

@@ -23,7 +23,7 @@
%label.center-align.block.faded — OR —
%a.block.center-align.medium-text{"ng-if" => "!formData.showAddLinkForm", "ng-click" => "formData.showAddLinkForm = true"} Add sync using secret link
%form{"ng-if" => "formData.showAddLinkForm"}
%input.form-control{:autofocus => 'autofocus', :name => 'url', :placeholder => 'Secret URL', :required => true, :type => 'url', 'ng-model' => 'formData.url'}
%input.form-control{:autofocus => 'autofocus', :name => 'url', :placeholder => 'Secret URL', :required => true, :type => 'url', 'ng-model' => 'formData.secretUrl'}
%button.btn.dark-button.btn-block{"ng-click" => "submitExternalSyncURL()"}
Add Sync Account
%a.block.center-align.mt-5{"ng-click" => "formData.showAddLinkForm = false"} Cancel

View File

@@ -3,7 +3,7 @@
%div{"ng-if" => "showSection"}
.small-v-space
%section.white-bg{"ng-repeat" => "provider in syncProviders"}
%section.white-bg.medium-padding{"ng-repeat" => "provider in syncProviders"}
%label {{!provider.enabled ? 'Not enabled' : (provider.primary ? 'Main' : 'Secondary')}}
%em{"ng-if" => "provider.keyName"} Using key: {{provider.keyName}}
%p {{provider.url}}
@@ -16,11 +16,15 @@
{{key.name}}
%button{"ng-click" => "saveKey(provider)"} Set
%div{"ng-if" => "!provider.enabled"}
%button.light{"ng-click" => "enableSyncProvider(provider, true)"} Set as Main
%button.light{"ng-if" => "syncProviders.length > 1", "ng-click" => "enableSyncProvider(provider, false)"} Add as Secondary
%button.light{"ng-if" => "!provider.enabled || !provider.primary", "ng-click" => "enableSyncProvider(provider, true)"} Set as Main
%button.light{"ng-if" => "syncProviders.length > 1 && (provider.primary || !provider.enabled)", "ng-click" => "enableSyncProvider(provider, false)"} Add as Secondary
%button.light{"ng-if" => "provider.keyName", "ng-click" => "changeEncryptionKey(provider)"} Change Encryption Key
%button.light{"ng-click" => "removeSyncProvider(provider)"} Remove Provider
%div{"style" => "height: 30px;", "delay-hide" => "true", "show" => "provider.syncOpInProgress", "delay" => "1000"}
%strong{"style" => "float: left;"} Syncing: {{provider.syncStatus.statusString}}
.spinner{"style" => "float: right"}
%button.light{"ng-click" => "removeSyncProvider(provider)"} Remove Account
.mt-15{"ng-if" => "provider.error"}
%strong.red Error syncing: {{provider.error.message}}
.mt-15{"style" => "height: 15px;", "delay-hide" => "true", "show" => "provider.syncOpInProgress", "delay" => "1000"}
.spinner{"style" => "float: left; margin-top: 3px; margin-left: 2px;"}
%strong{"style" => "float: left; margin-left: 7px;"} Syncing:
  {{provider.syncStatus.statusString}}

View File

@@ -1,7 +1,7 @@
.footer-bar
.pull-left
.footer-bar-link
%a{"ng-click" => "ctrl.accountMenuPressed()"} Account
%a{"ng-click" => "ctrl.accountMenuPressed()", "ng-class" => "{red: ctrl.error}"} Account
%account-data-menu{"ng-if" => "ctrl.showAccountMenu"}
.footer-bar-link
@@ -14,11 +14,12 @@
.pull-right
.footer-bar-link
.footer-bar-link{"style" => "margin-right: 5px;"}
%div{"ng-if" => "ctrl.lastSyncDate", "style" => "float: left; font-weight: normal; margin-right: 8px;"}
%span{"ng-if" => "!ctrl.isRefreshing"}
Last refreshed {{ctrl.lastSyncDate | appDateTime}}
%span{"ng-if" => "ctrl.isRefreshing"}
.spinner{"style" => "margin-top: 2px;"}
%a{"ng-click" => "ctrl.refreshData()"} Refresh
%strong{"ng-if" => "ctrl.offline"} Offline
%a{"ng-if" => "!ctrl.offline", "ng-click" => "ctrl.refreshData()"} Refresh